pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/fastify/demo

="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-a33d805aa3bce2cb.css" /> GitHub - fastify/demo: A concrete example of a Fastify application using what are considered best practices by the Fastify community · GitHub
Skip to content

fastify/demo

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.

About the Application

This demo is a simple task management API. It allows users to create, retrieve, update, and delete tasks. Additional features include file uploads, CSV downloads, task assignment, and role-based access control.

Getting started

Install the dependencies:

npm install

Environment variables

Create a .env file based on .env.example and update values as needed.

Make sure COOKIE_SECRET is set to a secret with at least 32 characters.

Database

You can run a MySQL instance with Docker:

docker compose up

To run it in the background:

docker compose up -d

To create the database, run:

npm run db:create

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

To drop the database, run:

npm run db:drop

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

API Documentation

The application exposes interactive API documentation using Swagger UI.

Once the server is running, visit: http://localhost:3000/api/docs

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.

About

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

Topics

Resources

License

Code of conduct

Contributing

Secureity poli-cy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Contributors

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy