Backend service template using PostgreSQL, Node, and Koa
See my outreach
page's Node Template post
This is a template for a relatively production ready backend Node micro-service. It already has error handling, logging, observability, rate limiting, graceful shutdown, a test file, and Docker optimizations.
- Ensure the Node.js version listed in the
.nvmrc
file is active:
nvm install && nvm use
- Install dependencies:
make install-dev
- Run locally at
localhost:3000
:
make dev
- Compose the Docker image:
docker compose up -d
- Run the database migration:
docker compose exec app npx prisma migrate deploy
- Test the code:
make test