This project template serves as a starting point for building efficient and scalable server-side applications with Fastify, TypeScript, and best practices in place. It comes pre-configured with essential tools to ensure code quality, maintainability, and a streamlined development workflow.
npm ci
Create a .env
file in the root directory if one does not already exist and copy the contents of the desired environment file over (.env.development
or .env.production
)
# Watch mode
npm run dev:watch
# Production mode
npm run build && npm run start
docker build -t fastify-template . && docker run fastify-template
# There are multiple profiles that can be run
# dev -> Mounts the current directory to the container and runs the service in watch mode
# local -> Builds and runs the application image from the current code
docker compose --profile=PROFILE up --build
# Unit tests
npm run test
# Test coverage
npm run test:coverage
# E2e tests
npm run test:e2e
This project is licensed under the MIT License. Feel free to customize and use it for your own projects.