This project structure is inspired in clean architecture code structure, by Uncle Bob. The main purpose of clean architecture is creating a strong project structure, splitting all the application in layers. The best advantages of using it, is create a application independent of any frameworks, tool, database or technology, being easy to handle the code, create a new features, fix any issue, or change some framework, thanks to the adapters and ports.
root
βββ .github - Github setup files
β βββ assets
β βββ workflow
βββ src - Application main code
β βββ app - Composition layer, entry point code
β β βββ routes - routes files
β β βββ setup - server config (middlewares, cors, body-parser)
β β βββ builds - classes instances
β β βββ adapters - components adapters
β βββ config - Some global config files (.env, path alias, logger)
β βββ domain - Business rules definition
β β βββ entities
β β βββ usecases
β βββ infra - External frameworks and libs implementation
β βββ presentation - External api communication layer (controllers, presenters, validators)
β βββ useCases - Usecases implementation
ββββ tests - Components tests
βββ e2e
βββ unit
All controllers unexpected errors are stored in the database, becoming available for future analysis and corrections. Having a console available, the errors and the requests data can be logged on console, for faster viewing while running the application.
To run this project locally, you will have to install Nodejs and PostgreSQL on the machine, or run everything with Docker. After run the project, go to .env.example file, on project root, and rename it to .env, filling all the properties in the file with your information.
git clone https://github.com/gabriellopes00/help-women.git
or
git clone git@github.com:gabriellopes00/help-women.git
docker-compose up
npm install
npm run build
npm run start
- All β―
yarn test
- Coverage β―
yarn test:ci
- Unit β―
yarn test:unit
- e2e β―
yarn test:e2e
- Lint(eslint) β―
yarn lint
- Style(prettier) β―
yarn style
Following the standard of the Conventional Commits.
- feature commits(amount) β―
git shortlog -s --grep feat
- test commits(amount) β―
git shortlog -s --grep test
- refactor commits(amount) β―
git shortlog -s --grep refactor
- chore commits(amount) β―
git shortlog -s --grep chore
- docs commits(amount) β―
git shortlog -s --grep docs
- build commits(amount) β―
git shortlog -s --grep build