Skip to content

DevLubab/nestjs-microservices-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NestJS Microservices Starter

A full-stack, distributed microservices Auth/Profile system implementing secure Google OAuth, JWT management as httpOnly cookie.

Quick Start

Prerequisites: Docker & Docker Compose

The entire infrastructure is containerized using Docker.

# 1. Clone repo
git clone https://github.com/TheLubab/nestjs-microservices-starter.git
cd nestjs-microservices-starter

# 2. Copy .env.example to .env, and put your google secrets

# 3. Start everything
docker-compose up -d --build

# 4. Read logs of services
docker-compose logs api-gateway auth-service user-service -f
docker-compose logs frontend -f

# 5. Access the app
#
# Frontend: http://localhost:4000
# API Gateway: http://localhost:4001

note: if you're on MacOs, you may need to let docker use more memory

Architecture

  • Frontend: Next.js
  • API Gateway: NestJS (Public) - The entry point
  • Auth Service: NestJS Microservice (Private) - Handles OAuth & JWT
  • User Service: NestJS Microservice (Private) - Handles User Data
  • Broker: Redis
  • Database: PostgreSQL

Features Checklist

  • Google OAuth 2.0 login flow.
  • JWT using HttpOnly cookie
  • Secure Profile Management (View & Edit).
  • Distributed Microservices (Gateway, Auth, User).
  • PostgreSQL and TypeORM.
  • Dockerized development environment.
  • Next.js proxy for instant redirects.
  • Logout.

About

NestJS Microservices Starter: Full-stack distributed Auth/Profile system with Next.js, Google OAuth 2.0, JWT (HttpOnly), Redis, and PostgreSQL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors