fastify-boilerplate
Fastify 5 application boilerplate based on clean architecture, domain-driven design, CQRS, functional programming, vertical slice architecture for building production-grade applications π
File Explorer
Download Latest Version (.zip)- codeql-analysis.yml
- release.yml
- commit-msg
- pre-commit
- package.json
- 20240415225644_create_users_table.sql
- 20240415231037_users.seed.sql
- fastify-boilerplate.png
- fastify_logo.png
- CQRS.md
- dependency-graph.svg
- codegen.ts
- generate-types.sh
- env.ts
- index.ts
- create-settings.event-handler.ts
- create-user.graphql-schema.ts
- create-user.handler.ts
- create-user.resolver.ts
- create-user.route.ts
- create-user.schema.ts
- delete-user.handler.ts
- delete-user.route.ts
- user.repository.port.ts
- user.repository.ts
- user.domain.spec.ts
- user.domain.ts
- user.errors.ts
- user.events.ts
- user.types.ts
- user.graphql-schema.ts
- user.paginated.response.dto.ts
- user.response.dto.ts
- find-users.graphql-schema.ts
- find-users.handler.ts
- find-users.resolver.ts
- find-users.route.ts
- find-users.schema.ts
- index.ts
- user.action-creator.ts
- user.mapper.ts
- index.ts
- index.ts
- util.spec.ts
- util.ts
- cqrs.ts
- error-handler.ts
- gql.ts
- request-context.ts
- swagger.ts
- index.ts
- api-error.response.ts
- id.response.dto.ts
- paginated-query.request.dto.ts
- paginated.response.base.ts
- response.base.ts
- app-request-context.ts
- action-creator.spec.ts
- action-creator.ts
- bus.types.ts
- command-bus.ts
- event-bus.spec.ts
- event-bus.ts
- index.ts
- middlewares.ts
- otel-middleware.ts
- query-bus.ts
- request-bus.spec.ts
- request-bus.ts
- postgres.ts
- repository.port.ts
- sql-repository.base.ts
- aggregate.spec.ts
- aggregate.ts
- mapper.interface.ts
- query.base.ts
- exception-base.ts
- exceptions.ts
- index.ts
- compose-middlewares.spec.ts
- compose-middlewares.ts
- index.ts
- validator.util.ts
- declarations.d.ts
- index.ts
- instrumentation.ts
- common.steps.ts
- common-hooks.ts
- custom-world.ts
- server.ts
- create-user.feature
- create-user.k6.ts
- delete-user.feature
- user.steps.ts
- .dependency-cruiser.cjs
- .dockerignore
- .editorconfig
- .env.example
- .gitattributes
- .gitignore
- .nvmrc
- .releaserc
- AGENTS.md
- biome.json
- CHANGELOG.md
- CLAUDE.md
- commitlint.config.cjs
- cucumber.mjs
- docker-compose.yml
- Dockerfile
- LICENSE
- package.json
- pnpm-lock.yaml
- pnpm-workspace.yaml
- README.md
- renovate.json
- tsconfig.json
π Installation Guide
git clone https://github.com/marcoturi/fastify-boilerplate
Downloads the entire project code from GitHub to your computer.
cd fastify-boilerplate
Moves into the project folder you just downloaded.
2. Docker
Easy Recommended- Git Needed to download the project code from GitHub.
- Docker Desktop Needed to build and run containers. Install it and keep it running in the background.
docker compose up postgres -d # via Docker Compose
Builds and starts all defined containers (server, database, etc.) at once, in the background.
docker compose up # builds the app image and starts all services
Builds and starts all defined containers (server, database, etc.) at once, in the background.
docker build -t fastify-boilerplate .
Builds a runnable image based on the Dockerfile.
docker run -p 3000:3000 --env-file .env -e HOST=0.0.0.0 fastify-boilerplate
Runs the built image as an actual container.
Pulled directly from this repo's README.
3. Node.js
Easypnpm install
Downloads and installs the libraries listed in package.json.
pnpm create:env # copies .env.example β .env
Type this command into your terminal and run it.
pnpm db:migrate
Type this command into your terminal and run it.
pnpm start
Starts the development/run server.
pnpm create:env # create .env from .env.example (if not done already)
Type this command into your terminal and run it.
Pulled directly from this repo's README.
