Typescript based REST API lite boilerplate using Fastify framework.
- Autoload fastify plugins with @fastify/autoload
- Security headers with @fastify/helmet
- CORS with @fastify/cors
- Process load measuring with @fastify/under-pressure
- Swagger with @fastify/swagger
- Swagger UI with @fastify/swagger-ui
- JSON Schema builder with TypeBox
- Enhanced support for TypeBox with @fastify/type-provider-typebox
- Environment utility checker with env-schema
- The project uses biome to lint and format the codebase.
- Enforce commit message conventions with commitlint.
- fastify/tsconfig is used to provide a base TypeScript configuration for Fastify projects.
- husky is used to manage git hooks.
- pm2 is a process manager that provides a simple way to run the server in cluster mode with built-in load balancing feature. You can edit the
process.yml
file to customize the app configuration.
Install Node dependencies:
pnpm install
Running development server is pretty straightforward. It uses tsx, the easiest way to run Typescript in Node.js. Just run the following command in watch mode:
pnpm dev
To generate a production build, the project uses tsup. Build server with command:
pnpm build
To run tests, the project uses borp that is a typescript-aware test runner for Node.js built-in testing library. It also supports c8
coverage. Borp is very usefull if you want avoid struggling with loaders and false positives uncovered code.
pnpm test