Skip to content

tryb3l/fastify-template

Repository files navigation

My Fastify Template for Future Projects

Status

CI

Requirements

To execute this example, you'll need to install Node.js, Docker, and MongoDB. MongoDB can be installed locally or used in a Docker environment.

You can use the following versions:

  • Node.js 22
  • MongoDB 7
  • Latest Docker engine

Getting Started

Running the Project Using Docker

  1. Build the Docker Image:

    docker build -t fastify-boilerplate .
  2. Start the Docker Containers:

    docker-compose -f docker/docker-compose-test.yml up

Running the Project Locally

  1. Install Dependencies:

    npm install
  2. Start MongoDB:

    npm run mongo:start
  3. Start the Server:

    npm run start
  4. Run Tests:

    npm run test

Makefile Commands

  • Build the Project:

    make build
  • Run the Database:

    make run_database
  • Run the Server:

    make run_server
  • Run Tests:

    make run_test
  • Stop the Database:

    make stop_database
  • Run All (Build, Run Database, Run Server):

    make all