Giter Club home page Giter Club logo

chainity-web's Introduction

Project 구조

webapp
├── app                             - Your application
│   ├── config                      - General configuration (redux store, middleware, etc.)
│   ├── entities                    - Generated entities
│   ├── modules                     - Main components directory
│   │   ├── account                 - Account related components
│   │   ├── administration          - Administration related components
│   │   └── login                   - Login related components
│   ├── pages      
│   │   ├── announce                - Announce related components
│   │   ├── evnets                  - events related components
│   │   ├── home                    - Application homepage
│   │   └── profile                 - Profile related components 
│   │   └── rank                    - Rank related components              
│   ├── shared                      - Shared elements such as your header, footer, reducers, models and util classes
│   ├── app.scss                    - Your global application stylesheet if you choose the Sass option
│   ├── app.css                     - Your global application stylesheet
│   ├── app.tsx                     - The application main class
│   ├── index.tsx                   - Index script
│   ├── routes.tsx                  - Application main routes
│   └── typings.d.ts                -
├── i18n                            - Translation files
├── static                          - Contains your static files such as images and fonts
├── swagger-ui                      - Swagger UI front-end
├── 404.html                        - 404 page
├── favicon.ico                     - Fav icon
├── index.html                      - Index page
├── manifest.webapp                 - Application manifest
└── robots.txt                      - Configuration for bots and Web crawlers

Project 실행방법

npm install (최초 실행시에만)

npm start

신규 페이지 Route 에 등록

  • routes.tsx 파일에 아래와 같이 등록 (profile 페이지 등록 예시)
 import Profile from 'app/pages/profile/profile';

 const Routes = () => (
   <div className="view-routes">
     <ErrorBoundaryRoute path="/login" component={Login} />
     <Switch>
       ... 기존 route
       <ErrorBoundaryRoute path="/profile" component={Profile} />
       <ErrorBoundaryRoute path="/" component={Home} />
     </Switch>
   </div>
 );

특정페이지로 이동

  • 로그인 페이지 이동 예
 import { Link } from 'react-router-dom';

 <Link to="/login">
    <Translate contentKey="global.messages.info.authenticated.link"> sign in</Translate>
</Link>

Reducer 신규 추가

  • reducer 를 사용하는 모듈과 같은 폴더에 생성. (모듈명.reducer.ts)
  • shared/reducers 폴더의 index.ts 파일에 신규 생성한 reducer 등록

Typescript 설정

  • tsconfig.json
  • tslint.json - 컴파일 에러 발생시 rule 이 적용되어있는지 확인 필요.

React & Redux in TypeScript - Static Typing Guide

https://github.com/piotrwitek/react-redux-typescript-guide/blob/master/README.md

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.