Skip to content

kortkamp/template-node-api

Repository files navigation

👷 Template API

Base template API to quick start api projects


✨ Features

  • Basic users module with email activation, avatar, jwt authorization middleware;
  • Persistence with PostgreSQL;
  • Storage provider;
  • Typeorm 0.3 compatible;
  • Mail provider;
  • Logger;
  • Graceful shutdown;
  • Connections rate limiter middleware for DDoS protection;
  • Dynamic role-permissions system;
  • Decent unit tests coverage;

🔧 Installation

You need Git, Node.js, Yarn, Docker and Docker Compose in order to run the project.

First of all, clone the repository:

git clone https://github.com/kortkamp/template-node-api.git

Then enter the folder and install dependencies

cd template-node-api
yarn install

Create your .env file and put there your configs

cp .env.example .env

Pull and build the docker images

docker-compose up

📖 Docs

The API provides Swagger docs at http://localhost:3003/api-docs/#/ in case you already have the project running in your computer. In case you do not want to run the project, just got to docs.

Do not edit swagger.json file directly, instead edit the files inside ./src/docs to update you project documentations, then if you need a unique file for static serving purposes generate a new one by running the command below.

yarn docs:build

🔬 Tests

This project is covered by tests. If you make any changes to the code, run the command below to ensure your change didn't break anything:

yarn test

Made with love by Kortkamp