Skip to content

carryhome/carryhome_node_api

Repository files navigation

carryhome

Note:

  1. Raise all pull request to develop branch only

  2. Please use transactions whenever there are more than one DB action. It's a real pain to add it later. See https://medium.com/cashpositive/the-hitchhikers-guide-to-mongodb-transactions-with-mongoose-5bf8a6e22033 to know how to use transactions

  3. Use logger being initialized instead of console.log, so that we can ship logs easily in future.

  4. Use errorHandler class, if new functionality is to be added we can add there

  5. Use wrap, to bring async functions to express router.

  6. Added lint, use defined rules and can add more. Run npm run lint before commiting. Added general rules there

  7. Add security rules while developing controller itself

  8. Add environment variables in .env file. Dotenv lib package is added to read and populate into process.env

  9. Add swagger document when-ever we are creating new endpoint. It is already configured and again it's a pain to add later for multiple endpoints at one-go

  10. Use models.js file for model imports rather than invididual model file import

Side Note: https://eslint.org/docs/rules/semi https://evanhahn.com/newline-necessary-at-the-end-of-javascript-files/ https://staxmanade.com/2018/03/should-i-use-javascript-single-or-double-quotes/ https://eslint.org/docs/rules/comma-dangle