Skip to content

vishalranaut/micro-stack-app

Repository files navigation

MicroStack App

A production-grade microservices application with micro-frontend architecture, built with Node.js, TypeScript, React, and PostgreSQL.

Architecture Overview

Backend

  • API Gateway: Single entry point for all client requests
  • Auth Service: Handles authentication and authorization (JWT-based)
  • User Service: Manages user profiles and user-related operations

Frontend

  • Shell Application: Main container application
  • Auth Module: Authentication UI (login/register)
  • Profile Module: User profile management

Tech Stack

Backend

  • Node.js 18+ with TypeScript
  • Express.js
  • PostgreSQL with Sequelize ORM
  • JWT for authentication
  • Zod for validation
  • Clean Architecture pattern

Frontend

  • React 18+ with TypeScript
  • Tailwind CSS
  • Framer Motion
  • Micro-frontend architecture

Infrastructure

  • Docker & Docker Compose
  • GitHub Actions for CI/CD

Prerequisites

  • Node.js 18+ and npm
  • Docker and Docker Compose
  • PostgreSQL (if running locally without Docker)

Quick Start

Using Docker (Recommended)

  1. Clone the repository:
git clone https://github.com/vishalranaut/micro-stack-app.git
cd microstack-app
  1. Create environment files:
cp backend/services/auth-service/.env.example backend/services/auth-service/.env
cp backend/services/user-service/.env.example backend/services/user-service/.env
cp backend/api-gateway/.env.example backend/api-gateway/.env
  1. Start all services:
docker-compose up -d
  1. Run database migrations:
docker-compose exec auth-service npm run migrate
docker-compose exec user-service npm run migrate
  1. Access the application:

Local Development

  1. Install dependencies:
npm install
  1. Start PostgreSQL (or use Docker):
docker-compose up -d postgres
  1. Setup environment variables (see .env.example files)

  2. Run migrations:

cd backend/services/auth-service && npm run migrate
cd backend/services/user-service && npm run migrate
  1. Start services in development mode:
npm run dev

Project Structure

microstack-app/
├── backend/
│   ├── api-gateway/          # API Gateway service
│   └── services/
│       ├── auth-service/     # Authentication service
│       └── user-service/     # User profile service
├── frontend/
│   ├── shell/                # Main application shell
│   └── modules/
│       ├── auth/             # Auth micro-frontend
│       └── profile/          # Profile micro-frontend
├── docker-compose.yml        # Docker orchestration
└── .github/
    └── workflows/            # CI/CD pipelines

API Endpoints

Authentication (via API Gateway)

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • POST /api/auth/refresh - Refresh JWT token

User Profile (via API Gateway)

  • GET /api/users/profile - Get current user profile
  • PUT /api/users/profile - Update user profile
  • GET /api/users/:id - Get user by ID (protected)

Development

Running Tests

npm test

Linting

npm run lint

Formatting

npm run format

Production Deployment

See .github/workflows/ for CI/CD pipeline configuration.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors