Skip to content

An app that help woman in risky situations. Receiving a help requests with current victim location, and providing a better help action πŸ†˜πŸš¨

Notifications You must be signed in to change notification settings

gabriellopes00/helpy-node

Repository files navigation

API Help Women

An API built with

typescript nodejs socket.io docker eslint jest heroku

Api Structure

Clean Architecture Schema

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.

Folders πŸ—‚

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

Logs πŸ“œ

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.

Building and contributing πŸ› 

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.

Cloning Repository
git clone https://github.com/gabriellopes00/help-women.git
or
git clone git@github.com:gabriellopes00/help-women.git
Running with Docker
docker-compose up
Running locally
npm install
npm run build
npm run start
Tests (jest) πŸ§ͺ
  • All ❯ yarn test
  • Coverage ❯ yarn test:ci
  • Unit ❯ yarn test:unit
  • e2e ❯ yarn test:e2e
Linting (eslint and prettier) 🎭
  • Lint(eslint) ❯ yarn lint
  • Style(prettier) ❯ yarn style
Statistics of the types of commits πŸ“ŠπŸ“ˆ

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

Contact πŸ“±

Github Badge Linkedin Badge Twitter Badge Gmail Badge Facebook Badge Instagram Badge StackOverflow Badge