π
Syntactically Awesome React App
Β
Β
Β
Template for React Apps using TypeScript obviously...
This project was made for react developers that need a more
sophisticated configuration to start their react-apps. We believe in a simple
but high scalable template. We left the folders that shape the structure of this
template empty, since it is not necessary to fill all the files to demonstrate each and
every use case. We provide with a very descriptive documentation so developers will
understand how to operate them.
in the other hand... this is a personal project
Getting Started
Dependencies
NPM is the project package manager.
Because create-sara-project
has a lot of configurations, we have tested the app with this environment versions:
npm@8.9.0
node@v16.17.1
git@2.28.0
If something is not working, try to update to these specific versions...
Update package
If you have previously installed:
npm i create-sara-project -g
and you want to update it, run:
npm update create-sara-project -g
Commands
Install
Run the following command to install create-sara-project globally
npm i create-sara-project -g
Then you can go to your project folder and run:
create-sara-project
Once you run the command the app will ask you the app name and the template type...
Once you created a sara project...
you can run the development server:
cd <app_name>
npm start
Open cypress
npm run cypress:open
Run cypress tests
npm test
Build
npm run build
Test
Cypress is the testing framework for this project.
Check the ./cypress configuration folder.
Docker
SARA uses Docker to containerize this app. Check the Dockerfile configuration file.
Linters and Code Style
The mix of tools used to ensure code and commit style and best practices:
- ESLint
- Prettier
- Commitlint
- Lint Staged
- Husky
Examples
SARA project for Monorepos
If you are building a monorepo, here is an example of how to implement a monorepo with create-sara-project
Template structure
.
βββ src
β βββ assets
β β βββ fonts
β β β βββ ...
β β βββ css
β β β βββ ...
β β βββ icons
β β β βββ ...
β β βββ img
β β βββ ...
β βββ components
β β βββ ...
β β βββ Modals
β β β βββ ...
β β βββ Toastr
β β β βββ ...
β β βββ <component-name>
β β βββ <component-name>.types.ts # Component types
β β βββ <component-name>.module.css
β β βββ <component-name>.tsx
β βββ layouts
β β βββ ... # AuthLayout/AdminLayout/etc
β βββ config
β β βββ ...
β β βββ constants.ts
β βββ contexts
β β βββ ...
β β βββ <page_name>
β β βββ Page.context.ts # Context page/multiple pages
β β
β βββ store # Without the need of redux, just useReducer hook
β β βββ actions
β β β βββ ...
β β βββ reducers
β β βββ ...
β βββ pages
β β βββ ...
β β βββ <page_name> # Keep unique page components here
β β βββ ...
β β βββ <component-name>.tsx
β β βββ <folder>
β β βββ ...
β β βββ <component-name>.tsx
β β βββ <folder>
β βββ utils
β β βββ ...
β βββ shared # api/global-state related interfaces/types
β β βββ interfaces
β β β βββ ...
β β βββ types
β β βββ ...
β βββ cache
β β βββ ...
β βββ animations # variants from framer motion
β β βββ ...
β βββ hooks
β β βββ ...
β βββ App.tsx
β βββ index.tsx
β βββ services # rest-api related routes and validators (zod)
β βββ routes
β β βββ ...
β βββ schemas # zod schemas
β βββ ...
β βββ <model.zod>.ts
βββ cypress
β βββ .gitignore
β βββ support
β β βββ ...
β βββ plugins
β β βββ ...
β βββ fixtures
β β βββ ...
β βββ integration
β βββ ...
βββ scripts
β βββ ...
βββ ...
βββ ...
βββ ...
βββ README.md