Skip to content
/ demo Public

A concrete example of a Fastify application using what are considered best practices by the Fastify community

License

Notifications You must be signed in to change notification settings

fastify/demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1d430da · Apr 14, 2025

History

49 Commits
Apr 1, 2025
Oct 21, 2024
Jan 31, 2025
Apr 14, 2025
Apr 14, 2025
Apr 14, 2025
Oct 21, 2024
Oct 21, 2024
Jan 17, 2025
May 31, 2024
Jan 27, 2025
Nov 3, 2024
Mar 11, 2025
Apr 14, 2025
Oct 21, 2024

Repository files navigation

Fastify Official Demo

CI

The aim of this repository is to provide a concrete example of a Fastify application using what are considered best practices by the Fastify community.

Prerequisites: You need to have Node.js version 22 or higher installed.

Getting started

Install the dependencies:

npm install

Database

You can run a MySQL instance with Docker:

docker compose up

To run it in the background:

docker compose up -d

To create and update the database schema, run the migrations:

npm run db:migrate

To populate the database with initial data, run:

npm run db:seed

TypeScript

To build the project:

npm run build

Start the server

In dev mode:

npm run dev

Open http://localhost:3000 to view it in the browser.

In production mode:

npm run start

Testing

To run the tests:

npm run test

Standalone

dev and start leverage fastify-cli, but you can run the demo as a standalone executable (see server.ts):

npm run standalone

Linting

To check for linting errors:

npm run lint

To check and automatically fix linting errors:

npm run lint:fix

Learn More

To learn more about Fastify, check out the Fastify documentation.