Skip to content

Repository files navigation

FinBridgeAA — Account Aggregator Platform

FinBridgeAA is a full-stack, microservices-based application that simulates India's Account Aggregator (AA) framework. It acts as a secure, consent-driven intermediary between Users, Financial Information Providers (FIPs/Banks), and Financial Information Users (FIUs). The platform features an event-driven architecture using Apache Kafka, a modern glassmorphism UI, real-time analytics, and JWT-secured microservices.

Table of Contents

Features

  • User Authentication — Register and log in using phone number OTP simulation; sessions are secured with JWT tokens.
  • Role-Based Access Control — Users can interact with the system via distinct roles: User (Customer), FIU (Lender/Client), and AA/FIP (Aggregator).
  • Consent Management — Users can view, approve, pause, or revoke data sharing requests. Consents have distinct lifecycles and expiry states (Pending, Active, Expired, Revoked).
  • FIP & FIU Simulation — Built-in mock services to simulate Banks (FIP) returning financial data, and Lending Platforms (FIU) consuming consented data.
  • Analytics Orchestrator — Kafka-driven analytics that processes events across the ecosystem to generate real-time metrics on consents, success rates, and API activity.
  • Event-Driven Microservices — Distributed communication using Apache Kafka topics to ensure loose coupling, asynchronous processing, and high scalability across consent and user events.
  • Modern UI / UX — A fully responsive, dark-mode frontend featuring glassmorphism design, interactive dashboards, micro-animations, and animated statistics counters.

Architecture

FinBridgeAA follows a microservices architecture. New services communicate via Apache Kafka for asynchronous event processing.

                        ┌─────────────────────┐
                        │   Vanilla Frontend  │
                        │     (HTML/JS/CSS)   │
                        └────────┬────────────┘
                                 │ HTTP
                        ┌────────▼────────────┐
                        │    API Gateway      │  JWT validation
                        │   (api-gateway)     │  Route forwarding · CORS
                        └──┬──────┬──────┬────┘
                           │      │      │
          ┌────────────────▼─┐ ┌──▼───┐ ┌▼──────────┐
          │   Auth-service   │ │ User │ │  Consent  │
          │                  │ │      │ │           │
          └──────────────────┘ └──────┘ └──────┬────┘
                           │      │            │
                           ▼      ▼            ▼
                    ┌─────────────────────────────────────┐
                    │            Apache Kafka             │
                    │   Topics: auth-events, fiu-events,  │
                    │   consent-events, fip-events        │
                    └──────────────────┬──────────────────┘
                                       │
                      ┌────────────────▼────────────────┐
                      │ Analytics Orchestrator Service  │
                      └─────────────────────────────────┘

Tech Stack

Layer Technology
Frontend HTML5, CSS3 (Custom Glassmorphism), Vanilla JavaScript
Backend (Java) Java 17, Spring Boot 3.x, Spring Cloud Gateway
Security Spring Security, JWT
Relational Database PostgreSQL, MySQL / H2
Message Broker Apache Kafka
Containerization Docker, Docker Compose

Services

Service Language / Framework Description
api-gateway-service Java / Spring Cloud Central entry point — JWT validation, CORS, routing
Auth-service Java / Spring Boot Manages OTP, user sessions, and JWT issuance
User-service Java / Spring Boot Manages user profiles, settings, and FIU/FIP links
Consent-service Java / Spring Boot Core AA engine managing the consent artefact lifecycle
Fiu-service Java / Spring Boot Simulates Financial Information Users (e.g. lenders) requesting data
Fip-mock-bank-service Java / Spring Boot Simulates Banks providing financial data upon valid consent
Account-aggregator-service Java / Spring Boot Analytics orchestrator consuming Kafka events
frontend HTML/JS/CSS SPA interface dynamically injecting views into an App Shell

Getting Started

Prerequisites

  • Java 17+ and Maven 3.8+
  • Node.js (for serving frontend locally if needed)
  • Docker Desktop (Docker Compose v2) — required for Kafka and Zookeeper

Run with Docker Compose

A docker-compose.yml file is provided to quickly spin up the required infrastructure (Kafka, Zookeeper, databases).

# Start infrastructure
docker-compose up -d

Manual / Local Development Setup

Option 1: Using the automated startup script (Recommended)

You can start all backend microservices simultaneously in the background using the provided script:

bash start-backend.sh

This will launch all services and write their output to the logs/ directory. To stop all background services started this way, press Ctrl+C in the terminal where the script is running.

Option 2: Running individually

If you prefer to run them manually, start the Java Backend Services in separate terminals:

cd api-gateway-service && ./mvnw spring-boot:run
cd Auth-service && ./mvnw spring-boot:run
cd User-service && ./mvnw spring-boot:run
cd Consent-service && ./mvnw spring-boot:run
cd Fiu-service && ./mvnw spring-boot:run
cd Fip-mock-bank-service && ./mvnw spring-boot:run
cd Account-aggregator-service && ./mvnw spring-boot:run

Start the frontend: Simply open frontend/index.html in your browser, or serve it via a local HTTP server:

cd frontend
npx serve .

Event-Driven Flow

Consent Approval Lifecycle

When a user approves a consent request, the following pipeline executes:

consent-service  ──publish──►  Kafka topic: consent-events (CONSENT_APPROVED)
                                      │
               ┌──────────────────────┴──────────────────────┐
               ▼                                             ▼
     FIP Mock Bank Service                            Analytics Orchestrator
   • Validates the consent artefact                   • Updates total approved consents count
   • Prepares encrypted data payload                  • Updates approval latency metrics
   • Publishes DATA_READY event                       • Dashboard stats updated in real-time

FIU Data Request Lifecycle

When the FIU requests data for an approved consent:

fiu-service  ──publish──►  Kafka topic: fiu-events (DATA_REQUESTED)
                                   │
             ┌─────────────────────┴─────────────────────┐
             ▼                                           ▼
   FIP Mock Bank Service                          Analytics Orchestrator
 • Validates request against consent            • Logs data fetch request metrics
 • Fetches FIU public key                       • Tracks data flow volume
 • Encrypts account data
 • Publishes fip-events (DATA_READY)
             │
             ▼
        fiu-service
 • Consumes encrypted data
 • Decrypts with FIU private key
 • Presents data to FIU user

User Registration Lifecycle

When a new user signs up:

auth-service  ──publish──►  Kafka topic: auth-events (USER_REGISTERED)
                                   │
             ┌─────────────────────┴─────────────────────┐
             ▼                                           ▼
        user-service                              Analytics Orchestrator
 • Creates user profile                         • Updates total user count
 • Generates default settings                   • Tracks registration velocity
 • Maps user to initial FIP mock accounts

Implementation Deep-Dives

Detailed write-ups on key cross-cutting concerns implemented in this project:

Topic Summary
Event-Driven Architecture (Kafka) End-to-end Kafka event streaming: topic design (auth-events, consent-events, fiu-events, fip-events), asynchronous data delivery, and consumer groups in the analytics orchestrator.
Consent Management Robust consent artefact lifecycle engine (Pending, Active, Revoked, Expired) acting as the central trust intermediary between FIU and FIP services.
Data Security & Encryption End-to-end data encryption simulation: The FIP Mock Bank encrypts financial payloads using the FIU's public key before publishing them through the AA flow, ensuring zero-knowledge intermediary transport.
🐳 Docker & Microservices Containerized Spring Boot microservices ecosystem with centralized API routing via Spring Cloud Gateway, JWT validation, CORS configuration, and integrated Docker Compose setup for Kafka and Zookeeper.
Glassmorphism UI A fully responsive, modern frontend featuring dark-mode glassmorphism design, interactive dashboards, dynamic routing, and animated statistics counters.
Real-Time Analytics Centralized Kafka consumer (Account-aggregator-service) acting as an analytics orchestrator to track total approved consents, event throughput, and API activity metrics in real-time.

API Overview

All requests (except auth endpoints) must include an Authorization: Bearer <token> header.

Authentication & Users

Method Endpoint Service Description
POST /auth/request-otp Auth-service Request login OTP for phone number
POST /auth/verify-otp Auth-service Verify OTP and receive JWT
POST /auth/logout Auth-service Log out current session
POST /auth/change-role Auth-service Change active user role (USER / FIU / FIP)
GET /user/profile User-service Get user profile and linked accounts
PUT /user/profile User-service Update user profile details
POST /user/kyc-simulate User-service Simulate KYC verification for new users

Consent Management

Method Endpoint Service Description
POST /api/consents Consent-service FIU initiates a new consent request
GET /api/consents?userId= Consent-service List all consents for a user
GET /api/consents/{consentId} Consent-service View specific consent artefact details
POST /api/consents/{consentId}/approve Consent-service User approves a pending consent — triggers Kafka event
POST /api/consents/{consentId}/revoke Consent-service User revokes an active consent — triggers Kafka event

FIP Mock Bank (Financial Information Provider)

Method Endpoint Service Description
POST /bank/accounts Fip-mock-bank Add a mock bank account for a user
POST /bank/accounts/{accountId}/transactions Fip-mock-bank Add mock transactions to an account
GET /bank/data Fip-mock-bank Internal: FIP provides encrypted data matching a consent artefact
POST /bank/seed Fip-mock-bank Seed database with dummy financial data

FIU Analytics & Usecases (Financial Information User)

All FIU endpoints simulate lending and analysis based on consented FIP data.

Method Endpoint Service Description
POST /fiu/loan/eligibility Fiu-service Calculate loan eligibility based on financial data
POST /fiu/credit/score Fiu-service Generate credit score from transaction history
POST /fiu/budget/analyze Fiu-service Analyze spending patterns and budget
POST /fiu/health/analyze Fiu-service Generate financial health scorecard
GET /fiu/analytics/report Fiu-service Get comprehensive FIU analytics report
GET /fiu/public-key Fiu-service Fetch FIU public key for FIP data encryption

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages