NodeJs Rest API best practices & project structure
product-catalogue A simple catalogue of products that can be accesses by rest api.( https://github.com/satyajitnayk/product-catalogue ) Postman Documentation [postman documentation] ( https://documenter.getpostman.com/view/19777887/2s8YswRBd6 ) Steps to Run the project locally: Run > npm i create .dev.env file. Fill them with the following informations DATABASE_URL= PORT= APP_SECRET= DATABASE_HOST= DATABASE_USERNAME= DATABASE_PASSWORD= Do Database migration: Run > npx sequelize db:migrate Start server: Run > npm run dev PROJECT FRAMEWORK / STRUCTURE JUSTIFICATION: I have followed the 3 layer structure. i.e. Api Layer, Service Layer, Repository Layer. Advantages of above structure: This provides the “separation of concerns” principle. Dividing the project into 3 layers allows me to test each layer separately hence decreasing the debugging speed. We can test each layer separately hence improve readability & development speed & deployment. This makes the code modula...