create-sara-project

2.0.1Β β€’Β PublicΒ β€’Β Published

Syntactically Awesome React App πŸš€

Logo
version Β  downloads Β  issues Β  license
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 πŸ™ƒ. I hope this template can help at least someone to bootstrap their react projects. πŸš€πŸš€πŸš€

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:

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

Package Sidebar

Install

npm i create-sara-project

Weekly Downloads

6

Version

2.0.1

License

MIT

Unpacked Size

698 kB

Total Files

104

Last publish

Collaborators

  • rodrigoteran