This is a Fastify starter project for your new projects. Out-of-the-box, it includes:
- TypeScript (with tsx for development);
- OpenAPI support with Scalar theme;
- File based routing and auto-loading plugins provided by fastify-autoload;
- GitHub Actions for auto-merging Dependabot PRs, running tests, building the project and validate the Dockerfile;
- VS Code settings for debugging and formatting;
- Vitest for testing;
- Biome for code formatting and linting;
- Commitlint for commit message linting;
- Lefthook for git hooks;
- Wireit to make npm/pnpm/yarn scripts smarter and more efficient;
- Docker for containerization;
- Docker Compose for running the app in a container;
- Release It! to automate versioning and package publishing-related tasks (by default, the versioning is done following CalVer format).
Use this template to start your Fastify project.
npx degit DouglasdeMoura/fastify-ts-starter my-fastify-app
cd my-fastify-app
npm install
In the project directory, you can run:
To start the app in dev mode.
Open http://localhost:3000 to view it in the browser.
For production mode
Run the test cases.
This project uses LeftHook to manage git hooks.
After cloning the project, run the following command to install the git hooks:
npx lefthook install
To learn Fastify, check out the Fastify documentation.