Real-time financial transaction intelligence platform built with Node.js, React, Kafka, AWS, and a local RAG-powered AI assistant.
FinSight ingests financial transactions through a Kafka event stream, runs real-time anomaly detection on each transaction, stores results in PostgreSQL, archives data to S3, and exposes a React dashboard with live WebSocket updates and an AI chat interface powered by Llama 3.2 and FAISS.
React Frontend (nginx / EC2)
|
| REST + WebSocket
v
Node.js API (PM2 / EC2)
|
_____|_____
| |
Kafka PostgreSQL
Producer (AWS RDS)
|
Kafka Consumer
|
|-- Anomaly Detection Engine
|-- S3 Archival (AWS S3)
|-- WebSocket Broadcast
|
FAISS Vector Store + Ollama (local)
|-- nomic-embed-text embeddings
|-- Llama 3.2 LLM
| Layer | Technology |
|---|---|
| Frontend | React, Recharts, WebSocket |
| Backend | Node.js, Express |
| Messaging | Apache Kafka (KafkaJS) |
| Database | PostgreSQL (AWS RDS) |
| Storage | AWS S3 |
| Infra | AWS EC2, Docker, PM2, nginx |
| Monitoring | AWS CloudWatch |
| AI | Ollama, Llama 3.2, nomic-embed-text, FAISS |
| Auth | JWT |
- Real-time transaction ingestion via Kafka producer/consumer pipeline
- Rule-based anomaly detection: velocity checks, high-amount thresholds, odd-hour detection, high-risk location flagging
- Live WebSocket feed showing transactions and anomaly alerts as they are processed
- Paginated transaction table with filters by type, status, category, amount range, and anomaly flag
- Analytics dashboard with volume charts and summary stats
- Transaction simulator and CSV upload for seeding data
- S3 archival of transaction batches and uploaded CSV files
- RAG-powered AI chat using FAISS vector search and Llama 3.2 to answer natural language queries over transaction history
- JWT-based authentication with rate limiting
- Structured JSON logging shipped to CloudWatch
finsight/
├── backend/
│ ├── src/
│ │ ├── ai/ # RAG pipeline, embeddings, FAISS vector store
│ │ ├── config/ # DB connection, logger
│ │ ├── kafka/ # Producer and consumer
│ │ ├── middleware/ # JWT auth
│ │ ├── routes/ # auth, transactions, alerts, chat, upload
│ │ └── services/ # Anomaly detection, S3, simulator
│ └── .env
├── frontend/
│ └── src/
│ ├── components/ # Layout, StatCard, TransactionTable, AnomalyPanel, LiveFeed, ChatPanel, SimulateBar
│ ├── context/ # AuthContext
│ ├── hooks/ # useWebSocket, useTransactions
│ └── pages/ # Login, Dashboard, Transactions, Chat
└── docker-compose.yml
- Node.js 20+
- Docker and Docker Compose
- PostgreSQL (local or via Docker)
- Ollama
git clone https://github.com/shubham0730/FinSight.git
cd FinSightdocker compose up -dollama serve
ollama pull llama3.2
ollama pull nomic-embed-textcd backend
cp .env.example .env
npm install
npm run devcd frontend
npm install
npm run devOpen http://localhost:3000, register an account, then simulate transactions from the dashboard.
Click "Index transactions" in the AI Assistant page after simulating data.
PORT=3001
DB_HOST=
DB_PORT=5432
DB_NAME=finsight
DB_USER=
DB_PASSWORD=
JWT_SECRET=
JWT_EXPIRES_IN=7d
KAFKA_BROKER=localhost:9092
AWS_REGION=ap-south-1
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
S3_BUCKET=
OLLAMA_URL=http://localhost:11434| Service | Usage |
|---|---|
| EC2 t3.micro | Hosts Node.js API, Kafka, nginx |
| RDS t3.micro | Managed PostgreSQL database |
| S3 | Transaction archival and CSV file storage |
| CloudWatch | Application logs and CPU/memory metrics |
| Rule | Condition |
|---|---|
| High amount | Exceeds 3x user 30-day average AND above INR 45,000 |
| Velocity | More than 4 transactions within 10 minutes |
| Odd hours | Transaction between 2 AM and 4 AM |
| High-risk location | Transaction from Dubai or Singapore |
Severity is set to high when two or more rules trigger simultaneously.
POST /api/auth/register
POST /api/auth/login
GET /api/transactions
GET /api/transactions/summary
GET /api/transactions/:id
POST /api/transactions/simulate
POST /api/transactions/export
GET /api/transactions/exports
GET /api/alerts
PATCH /api/alerts/:id/resolve
POST /api/upload
POST /api/chat
GET /api/chat/status
POST /api/chat/ingest