Hello everybody, I'm very happy because after study too much I could apply the SOLID principles in this restfulAPI built with NODEJS and TypeScript. The principles just was applied because the typescript syntax have allowed me to use Object Oriented Programing. The S and D principles that talk about Single Reponsability and Dependency Inversion Princple respectively was used in class structures. I've used different layers to divide my code. Here you will find the entities of the application, the domain, useCases, Repositories, and routes. Such as MVC layers the responsibilities was separated. The code was deployed in Heroku.
finished 🚀
To run this application locally you just need to install node in your computer. By doing that npm (node package manager) will be installed too. So know you can start the application by running:
# Install all dependencies
npm install
# Start the application
npm run dev
If you prefer you can run by using yarn
instead:
# Install yarn in computer globally
npm install yarn --global
# Install all dependencies with yarn
yarn
# Start the application with yarn
yarn dev
- NodeJS - To built the API with JavaSCript
- typescript - To apply types to our variables
- Express - To create the routes of API
- CORS - To handle the access control to API
- SupaBase - To comunicate with PostgreSQL database in cloud
- dotenv - To get the enviroment variables from .env file
- commitlint - To verify the structures of commits prior to push them
- commitizen - To give us a CLI to build our commits in commitlint pattern
- husky - To execute functions hooks prior git commands
-
Fork the project.
-
Create a new branch with your changes:
git checkout -b my-feature
-
Save the changes and create a commit message telling what you did:
git commit -m "feature: My new feature"
-
Push your changes:
git push origin my-feature
If you have any questions, check out this guide on how to contribute on GitHub