Skip to content

Node.js API server/backend based on fastify and MongoDB as a database for persisting data, GitHub Actions build and code linter, minimal tooling (nodemon, standard), and node-tap tests. Can be used as a template to quickly bootstrap your Node.js API http server project.

License

Notifications You must be signed in to change notification settings

mihaur/node-fastify-template

Repository files navigation

Node.js API server based on fastify + MongoDB project template

js-standard-style Conventional Commits GitHub Actions CI Coverage Status MegaLinter

Node.js API server/backend based on fastify and MongoDB as a database for persisting data, GitHub Actions build and code linter, minimal tooling (nodemon, standard), and node-tap tests. Can be used as a template to quickly bootstrap yor Node.js API http server project.

All features

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Installing

  • git clone git@github.com:mihaur/node-fastify-template.git
  • cd node-fastify-template
  • cp .env.example .env
  • npm install
  • npm start

Configuring

Use .env to store your environment dependant configuration options and secrets. This file should not be checked in to your repository, use .env.sample as example but exclude real secrets.

Linting and code fixing

Linting is done using standard. Use npm run lint to run linter. Linter output is piped trough snazzy which converts "compact" text from a linter to "stylish". You can also automatically fix linter errors by running npm run lint:fix.

Integration tests

Integration tests are stored in test/**.spec.js. Tests are run by Node test runner. Run npm run test to run both unit and integration tests.

Coverage reports

Run npm run coverage to generate HTML test coverage report. Web browser is opened after tests are run.

About

Node.js API server/backend based on fastify and MongoDB as a database for persisting data, GitHub Actions build and code linter, minimal tooling (nodemon, standard), and node-tap tests. Can be used as a template to quickly bootstrap your Node.js API http server project.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published