Boilerplate for creating nodejs app using Docker multistage build
src/api/controllers/ # actual API request handlers
src/api/models/ # Mongoose model
src/api/routes/ # Routes definitions
src/config/ # Common configuration/setup files (es. db connection, logger, production stuff)
src/middleware/ # Just middlewares
src/shared/ # The place to put other common stuff (es. errors, mail handling)
tests/ # tests for controllers, models, other logical units - within properly reflected file structure
Follow Airbnb style guide. ESLint together with Airbnb base config is set-up to lint your code.
- Install Docker
- Create your own
.env
file based ondefault.env
- For development it'll be necessary to run
docker-compose run backend npm i
for installing dependencies on host machine after the initial build failed. - Run
docker-compose up
for a dev environment. The API endpoint islocalhost:3000/api
- For debugging use the handy Chrome DevTools
- For local env testing
sh devtests.sh
To connect with a GUI to the dev mongo db instance use MongoDb Express provided at localhost:8081
If something is unclear, confusing, or needs to be refactored, please let us know. Pull requests are always welcome, but note the minimalistic nature of the repository - it's designed as lean, universal starting point for actual projects, and nothing more.
The MIT License (MIT)