Skip to content

Repository files navigation

Tay Bank Microservices

A polyglot microservices banking application built with NestJS, Django, Go, Spring Boot, FastAPI, and Flask.

🏗️ Architecture

This project consists of 9 backend microservices and 1 frontend web application:

  • API Gateway (NestJS) - Single entry point for all client requests
  • User/Auth Service (NestJS) - Authentication and user management
  • Account Service (Django) - Bank account management
  • Transaction Service (Django) - Transaction processing
  • Card Service (Go) - Card management and authorization
  • Payment Service (FastAPI) - External payments
  • Notification Service (Flask) - Email/SMS notifications
  • Audit Service (Go) - Centralized logging
  • Statement Service (Spring Boot) - PDF statement generation
  • Web App (Next.js + Tailwind) - User interface

📋 Prerequisites

  • Docker & Docker Compose
  • Node.js 20+ (for local development)
  • Python 3.11+ (for local development)
  • Go 1.21+ (for local development)
  • Java 17+ (for local development)

🚀 Quick Start

Using Docker Compose (Recommended)

  1. Clone the repository
git clone <repository-url>
cd tay-bank-microservices
  1. Install local dependencies (optional but recommended for IDE support)
./scripts/setup-local.sh
  1. Start all services
docker-compose up --build
  1. Access the applications

🔥 Hot Reload Enabled!

This setup includes hot reload - edit your code locally and see changes instantly in Docker!

How it works:

  • Your source code is mounted into containers
  • node_modules are kept separate (no conflicts)
  • Edit → Save → Auto-reload (no rebuild needed)

See DOCKER_SETUP_EXPLAINED.md for details.

Local Development (Without Docker)

API Gateway

cd services/api-gateway
npm install
npm run start:dev

User/Auth Service

cd services/user-auth-service
npm install
npm run start:dev

Web App

cd web-app
npm install
npm run dev

📁 Project Structure

tay-bank-microservices/
├── services/                    # Backend microservices
│   ├── api-gateway/            # NestJS - API Gateway
│   ├── user-auth-service/      # NestJS - User/Auth
│   ├── account-service/        # Django - Accounts
│   ├── transaction-service/    # Django - Transactions
│   ├── card-service/           # Go - Cards
│   ├── payment-service/        # FastAPI - Payments
│   ├── notification-service/   # Flask - Notifications
│   ├── audit-service/          # Go - Audit Logs
│   └── statement-service/      # Spring Boot - Statements
├── web-app/                    # Next.js frontend
├── shared/                     # Shared code and contracts
│   ├── api-contracts/         # API documentation
│   └── constants/             # Shared constants
├── infrastructure/             # Infrastructure configs
│   ├── docker/                # Docker configs
│   └── k8s/                   # Kubernetes manifests
├── scripts/                    # Helper scripts
├── docker-compose.yml         # Local orchestration
├── ARCHITECTURE.md            # Architecture documentation
└── README.md                  # This file

🔧 Available Services

Currently Implemented (Boilerplates)

1. API Gateway (Port 3000)

  • Health check: GET http://localhost:3000/api/health

2. User/Auth Service (Port 3001)

  • Health check: GET http://localhost:3001/health

3. Web App (Port 3100)

  • Homepage: http://localhost:3100

To Be Implemented

Refer to ARCHITECTURE.md for complete specifications of all services.

🛠️ Development

Environment Variables

Each service has a .env.example file. Copy it to .env and update values:

# Example for api-gateway
cd services/api-gateway
cp .env.example .env
# Edit .env with your values

Database Setup

PostgreSQL is included in docker-compose. Default credentials:

  • Host: localhost
  • Port: 5432
  • User: postgres
  • Password: postgres

Testing Services

Test if services are running:

# API Gateway
curl http://localhost:3000/api/health

# User/Auth Service
curl http://localhost:3001/health

# Web App
open http://localhost:3100

📖 Documentation

  • Architecture Guide: See ARCHITECTURE.md for complete service specifications
  • API Documentation: Each service will have Swagger/OpenAPI docs (to be implemented)

🎯 Next Steps

  1. API Gateway: Add routing logic to forward requests to services
  2. User/Auth Service: Implement login, registration, and JWT authentication
  3. Web App: Build login/register pages and connect to API Gateway

🤝 Contributing

This is a personal learning project. Feel free to fork and experiment!

📝 License

See LICENSE file for details.

🙏 Acknowledgments

Built as a learning project to understand microservices architecture across multiple technology stacks.

About

Side project on microservices and scaling

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages