v1.0.0

API Documentation Backend NestJS

Complete guide for integrating with the Backend NestJS API. Here you will find endpoint documentation, business flows, and practical examples.

About the Project

The Backend NestJS is a solid and scalable foundation for building projects with the NestJS framework. This project was developed as a complete, functional template incorporating software architecture best practices, design patterns, and integrations with modern technologies.

What is it for?

  • Foundation for new NestJS projects
  • Template with complete architecture
  • Ready-made integrations (Redis, Kafka, MinIO, etc.)
  • Complete JWT authentication system
  • Repository pattern; CQRS-ready (Mongo and/or Postgres)

Features

  • Centralized configuration via environment
  • Persistence in MongoDB and/or PostgreSQL
  • Distributed cache with Redis
  • Structured logging with Graylog (GELF)
  • GraphQL and REST API
  • Complete Docker stack + /health endpoint

Git Repository

The source code for this project is available in the Git repository. You can clone, fork, or contribute to the project.

Git RepositoryClone
git clone https://github.com/mateuslacorte/backend-nestjs.git
cd backend-nestjs

Architecture

Technology Stack

  • N
    NestJS (Framework)
  • M
    MongoDB (optional / CQRS-ready)
  • P
    PostgreSQL (current default)
  • S
    MinIO (S3 Storage)
  • G
    Graylog (GELF Logging)

Patterns Used

  • CQRS-ready

    Mongo and Postgres repositories ready; service uses one database by default

  • Repository Pattern

    Data access abstraction (Mongo and/or Postgres)

  • JWT Authentication

    Token-based authentication

  • Docker Compose

    Local stack with API, DBs, Kafka, MailHog, and Graylog

Authentication

All routes require authentication

Include the Authorization: Bearer {token} header in all requests

HeadersHTTP
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Content-Type: application/json

Base URL and useful endpoints

Base URLProduction
https://nest.lacorte.dev/api/v1

Interactive Documentation

Swagger UI

Access the interactive documentation to test endpoints directly in the browser.

Open Swagger