React-template
A template for react projects in typescript.
Features
- TS
- React Router
- Redux
- Less, CSS modules
- cra, craco
- PWA
Available Scripts
Project setup
npm install
Compiles and hot-reloads for development
npm start
Compiles and minifies for production
npm run build
Run your tests
npm test
Folder Structure
├── public
│ ├── index.html # html template
│ └── favicon.png # Favicon
├── src
│ ├── assets # Local static resources
│ ├── components # Business common components
│ ├── pages # Business page entry and common templates
│ │ ├── Welcome # No other routing components should be included under routing components.
│ │ | ├── components # You can do more in-depth organization for complex pages, but it is recommended not to exceed three levels
│ │ | ├── index.tsx # code of page component
│ │ | └── index.less # page style
│ │ ├── user # A series of pages recommend using a single lowercase letter as the group directory
│ │ | ├── components # public component collection under group
│ │ | ├── Login # page under group Login
│ │ | ├── Register # page under group Register
│ │ | └── util.ts # There can be some shared methods here, do not recommend and restrict
│ │ └── * # Other page component codes
│ ├── hooks # Global hooks
│ ├── models # Global models
│ ├── services # Background interface services
│ ├── utils # tool library
│ ├── types # *.d.ts
│ ├── index.less # global style
│ └── index.ts # Global JS
├── README.md
└── package.json