/blog-api-nest

Primary LanguageTypeScript

What is this?

blog-api-nest is a fully featured REST API written in NestJS.

Features

This API has the following features:

  • Clean and easy to understand structure
  • Structured logging, ready for production use
  • Password reset via email
  • 2-Factor Authentication using TOTP
  • Role management with RBAC
  • Fully documented API with Swagger
  • 12 Factor compliant

Deployment using Docker

First, clone the repository:

git clone https://github.com/XiovV/blog-api-nest.git

Then build the image like this:

make build/image

Or, you can build it manually:

docker build -t blog-api-nest .

Now edit the docker-compose.yml to set your own environment variables and run it. Please note that this docker-compose.yml will run PostgreSQL as well:

docker-compose up -d

Optional environment variables

All of the environment variables inside the docker-compose.yml file are required, however there are a few which are optional:

  • PORT (defaults to 3000)
  • LOG_LEVEL (defaults to "info")
  • NODE_ENV (if set to "production", the logs will be logged in JSON. If it's set to something else, logs will be prettified)

Documentation

Once the API is up and running, you can visit the docs at http://localhost:3000/docs