Skip to content

ayshishannidhya/Banking_System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏦 Neptune Bank - Online Banking System

A secure, scalable, and microservices-based online banking platform built using Spring Boot 3.5, Java 21, PostgreSQL, and RabbitMQ.

Neptune Bank provides a complete digital banking solution with user onboarding, KYC verification, account management, secure fund transfers, transaction tracking, OTP-based verification, and JWT-based authentication.


πŸš€ Features

πŸ‘€ User Management

  • User Registration with KYC verification
  • Profile Management (CRUD Operations)
  • Soft Delete Support
  • Contact & Nominee Management
  • Employee-based KYC Verification

🏦 Account Management

  • Savings Account
  • Current Account
  • Fixed Deposit Account
  • Branch Association
  • Balance Management
  • Optimistic Locking Support

πŸ’Έ Fund Transfers

  • Account-to-Account Transfers
  • RabbitMQ-based Processing
  • Automatic Rollback on Failures
  • Transaction Tracking

πŸ“œ Transaction History

  • Complete Audit Trail
  • Account-wise History
  • Chronological Ordering
  • Status Tracking

πŸ” Security

  • JWT Authentication (RS256)
  • RSA Key Pair Signing
  • BCrypt Password Hashing
  • Spring Security Integration
  • Role-Based Access Control (RBAC)

πŸ“± OTP Verification

  • SMS OTP via TextBee API
  • Email OTP via SMTP
  • OTP Expiry Management
  • Verification Tracking

πŸ›  Technology Stack

Category Technology
Language Java 21
Framework Spring Boot 3.5.5
Build Tool Gradle
Database PostgreSQL 16
ORM Spring Data JPA / Hibernate
Messaging RabbitMQ
Authentication JWT (RS256)
Security Spring Security
Password Hashing BCrypt
Mail Service Spring Mail
SMS Gateway TextBee API

πŸ— Microservices Architecture

The system consists of five independent microservices.

Service Port Responsibility
Auth Service 8086 Authentication & JWT
User Service 8080 User Profiles & KYC
OTP Service 8082 OTP Generation & Verification
Account Service 8083 Account Management
Transaction Service 8084 Fund Transfers & Transactions

System Architecture

                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚     Client      β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚     Auth Service    β”‚
                    β”‚      Port 8086      β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚ JWT
                             β–Ό

 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    RabbitMQ    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚  User Service   │◄──────────────►│ Account Service β”‚
 β”‚    Port 8080    β”‚                β”‚    Port 8083    β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                              β”‚
                                              β–Ό
                                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                     β”‚Transaction Svc β”‚
                                     β”‚    Port 8084   β”‚
                                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                              β”‚
                                              β–Ό
                                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                     β”‚   OTP Service   β”‚
                                     β”‚    Port 8082    β”‚
                                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”„ RabbitMQ Communication

Queues

Queue Name Producer Consumer
user-validation-queue account-service user-service
account-validation-queue transaction-service account-service
account-debit-queue transaction-service account-service
account-credit-queue transaction-service account-service

πŸ”‘ Authentication Flow

Client Login
     β”‚
     β–Ό
Auth Service
     β”‚
     β–Ό
Validate Credentials
     β”‚
     β–Ό
Generate JWT Token
     β”‚
     β–Ό
Return JWT
     β”‚
     β–Ό
Use JWT for API Requests

JWT Payload

{
  "sub": "john_doe",
  "role": "USER",
  "iat": 1718150400,
  "exp": 1718161200
}

πŸ‘₯ User Roles

Role Access
ADMIN Full System Access
EMPLOYEE KYC Verification & Customer Management
USER Banking Operations

πŸ“‚ Services


πŸ” Auth Service (Port 8086)

Responsibilities

  • Login Authentication
  • JWT Generation
  • User Credential Management
  • Role Assignment

Endpoints

POST /auth/login
POST /auth/add-user
GET  /auth/validate

Login Request

{
  "username": "john_doe",
  "password": "password123",
  "mode": "jwt"
}

πŸ‘€ User Service (Port 8080)

Responsibilities

  • User Registration
  • Profile Management
  • KYC Document Management
  • Nominee Management

KYC Documents Supported

  • Aadhaar
  • PAN
  • Passport
  • Voter ID
  • Driving License
  • User Photograph
  • Signature

Endpoints

POST   /auth/user
GET    /auth/user/{id}
GET    /auth/users
PUT    /auth/user/{id}
DELETE /auth/user/{id}
GET    /auth/user/exists/{id}

🏦 Account Service (Port 8083)

Responsibilities

  • Account Creation
  • Balance Management
  • Branch Management
  • Account Validation

Supported Account Types

SAVINGS
CURRENT
FIXED_DEPOSIT

Endpoints

POST   /api/accounts/create
GET    /api/accounts/get/{id}
GET    /api/accounts/get/all
GET    /api/accounts/user/{userId}
GET    /api/accounts/number/{number}
PUT    /api/accounts/update/{id}
DELETE /api/accounts/delete/{id}

πŸ’Έ Transaction Service (Port 8084)

Responsibilities

  • Fund Transfers
  • Transaction Tracking
  • Audit Trail

Endpoints

POST /transactions/create
POST /transactions/transfer
GET  /transactions/{transactionId}
GET  /transactions/account/{accountId}
GET  /transactions/all

Fund Transfer Workflow

Validate Accounts
       β”‚
       β–Ό
Create Transaction (PENDING)
       β”‚
       β–Ό
Debit Source Account
       β”‚
       β–Ό
Credit Destination Account
       β”‚
       β–Ό
Success

Rollback Strategy

Debit Success
      β”‚
      β–Ό
Credit Failed
      β”‚
      β–Ό
Refund Source Account
      β”‚
      β–Ό
Mark Transaction Failed

πŸ“± OTP Service (Port 8082)

Responsibilities

  • OTP Generation
  • OTP Verification
  • SMS Delivery
  • Email Delivery

Endpoints

POST /api/otp/send
POST /api/otp/verify

OTP Properties

Property Value
Length 6 Digits
Generator SecureRandom
Expiry 5 Minutes
Usage One Time

πŸ—„ Database Setup

Create the following databases:

CREATE DATABASE AuthDB;
CREATE DATABASE UserDB;
CREATE DATABASE OtpDB;
CREATE DATABASE AccountDB;
CREATE DATABASE TransactionDB;

Database Configuration

spring.datasource.url=jdbc:postgresql://localhost:5433
spring.datasource.username=neptune
spring.datasource.password=********

βš™ Prerequisites

  • Java 21
  • PostgreSQL 16
  • RabbitMQ
  • Gradle
  • RSA Public Key
  • RSA Private Key

πŸ”¨ Build Project

cd auth-service
./gradlew build -x test

cd ../user-service
./gradlew build -x test

cd ../otp-service
./gradlew build -x test

cd ../account-service
./gradlew build -x test

cd ../transaction-service
./gradlew build -x test

β–Ά Running Services

Start services in the following order:

1. Auth Service
2. OTP Service
3. User Service
4. Account Service
5. Transaction Service

πŸ“š API Quick Reference

Authentication

POST /auth/login
POST /auth/add-user
GET  /auth/validate

User APIs

POST   /auth/user
GET    /auth/user/{id}
GET    /auth/users
PUT    /auth/user/{id}
DELETE /auth/user/{id}

Account APIs

POST   /api/accounts/create
GET    /api/accounts/get/{id}
GET    /api/accounts/get/all
PUT    /api/accounts/update/{id}
DELETE /api/accounts/delete/{id}

Transaction APIs

POST /transactions/create
POST /transactions/transfer
GET  /transactions/{id}
GET  /transactions/account/{accountId}

OTP APIs

POST /api/otp/send
POST /api/otp/verify

⚠ Error Response Format

{
  "success": false,
  "message": "Resource not found",
  "errors": [
    "validation message"
  ]
}

πŸ“ˆ Highlights

βœ… Spring Boot Microservices

βœ… PostgreSQL Persistence

βœ… RabbitMQ Messaging

βœ… JWT Authentication

βœ… BCrypt Security

βœ… OTP Verification

βœ… KYC Document Management

βœ… Saga-Based Transaction Rollback

βœ… Role-Based Access Control

βœ… Scalable Architecture


πŸ‘¨β€πŸ’» Author

Ayshi Shannidhya Panda

GitHub: https://github.com/ayshishannidhya

Email: a.shannidhya@gmail.com


πŸ“œ License

Copyright Β© 2025-2026 Ayshi Shannidhya Panda.

This project is distributed under a Proprietary License. Unauthorized copying, modification, distribution, or commercial use is prohibited without explicit permission from the author.


⭐ Neptune Bank

A modern microservices-based banking platform designed for security, scalability, reliability, and enterprise-grade banking operations.

About

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors