2.0.1 ā€¢ Published 1 year ago

create-sara-project v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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