Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FinGuard

Full-Stack Transaction Risk Monitoring Platform

FinGuard is a full-stack transaction risk monitoring platform that simulates how financial analysts can investigate suspicious transactions, review risk factors, and make approval or blocking decisions.

The project combines a Next.js + TypeScript frontend, FastAPI + Python backend, PostgreSQL, Redis, JWT authentication, SQLAlchemy, Docker, and a deterministic rule-based risk engine.

Note: FinGuard is an educational portfolio project. Its risk engine is a deterministic demonstration and is not intended for real banking or production fraud-detection decisions.


What FinGuard Does

FinGuard provides an end-to-end transaction investigation workflow:

Transaction
    ↓
Risk Analysis
    ↓
Risk Factors
    ↓
Analyst Investigation
    ↓
Approve / Block
    ↓
Status Updated

An analyst can open a transaction, review its risk information, investigate individual risk factors, and update the final transaction decision.


Key Features

  • JWT-based authentication
  • Interactive transaction dashboard
  • Transaction history and filtering
  • Rule-based risk scoring
  • Explainable risk factors
  • Suspicious and high-risk transaction detection
  • Transaction investigation modal
  • Approve or block transaction workflow
  • Persistent transaction status updates
  • Dashboard statistics
  • PostgreSQL data persistence
  • Redis caching
  • FastAPI OpenAPI documentation
  • Pytest backend testing
  • Docker Compose development environment
  • Responsive Next.js/TypeScript UI

Screenshots

Login

FinGuard Login

Dashboard

FinGuard Dashboard

Transaction Investigation

Transaction Investigation

Risk Factor Explanation

Risk Factor Explanation

Transaction Approved

Transaction Approved

Transaction Blocked

Transaction Blocked


Risk Engine

FinGuard uses a deterministic rule-based risk engine so that every score can be reproduced and explained.

The engine considers signals such as:

  • Large transaction amounts
  • New or unfamiliar devices
  • Unusual transaction hours
  • Unusual locations
  • Rapid repeated transactions

Each transaction receives:

Risk Score
Risk Level
Risk Factors
Transaction Status

This makes the demonstration easy to test and understand without relying on a black-box model.


Analyst Decision Workflow

The transaction review interface allows an analyst to investigate a flagged transaction before making a decision.

For example:

Luxury Retailer
$7,600.00
Unknown location
New device
High risk
95/100

The analyst can then choose:

Approve transaction
        OR
Keep blocked

After the decision:

  • The transaction status is updated through the backend API.
  • The updated transaction is reflected in the dashboard.
  • The investigation modal displays the new status.
  • A confirmation notification informs the analyst that the decision was recorded.

Architecture

                 ┌──────────────────────────┐
                 │    Next.js + TypeScript   │
                 │       Frontend UI         │
                 └────────────┬─────────────┘
                              │
                           REST API
                              │
                              ▼
                 ┌──────────────────────────┐
                 │      FastAPI + Python    │
                 │       Backend API        │
                 └────────────┬─────────────┘
                              │
              ┌───────────────┼───────────────┐
              │               │               │
              ▼               ▼               ▼
       ┌────────────┐  ┌────────────┐  ┌──────────────┐
       │ PostgreSQL │  │   Redis    │  │ Risk Engine  │
       │            │  │            │  │              │
       │ Users      │  │ Dashboard  │  │ Risk Score   │
       │ Transactions│ │ Cache      │  │ Risk Factors │
       │ Alerts     │  │            │  │              │
       └────────────┘  └────────────┘  └──────────────┘

Technology Stack

Layer Technologies


Frontend Next.js, React, TypeScript Backend Python, FastAPI ORM SQLAlchemy Database PostgreSQL Caching Redis Authentication JWT, password hashing Testing Pytest Infrastructure Docker, Docker Compose


Project Structure

FinGuard/
├── backend/              # FastAPI API, database, authentication & risk engine
├── frontend/             # Next.js dashboard and transaction UI
├── screenshots/          # Application screenshots
├── .env.example          # Environment variable template
├── .gitignore
├── docker-compose.yml
└── README.md

Getting Started

Prerequisites

  • Docker Desktop
  • Git

1. Clone the repository

git clone https://github.com/Aaryan1265/FinGuard.git
cd FinGuard

2. Configure environment variables

Create a local .env file from the provided example.

On Windows PowerShell:

Copy-Item .env.example .env

On macOS/Linux:

cp .env.example .env

Do not commit .env to Git.

3. Start the application

From the project root:

docker compose up --build

4. Seed demo data

Open another terminal:

docker compose exec backend python -m app.seed

Demo Account

Use the demo credentials displayed on the FinGuard login page:

Email: demo@finguard.com
Password: DemoPass123!

Application URLs

Service URL


Frontend http://localhost:3000 Backend http://localhost:8000 API Documentation http://localhost:8000/docs

The FastAPI documentation provides an interactive view of the available backend endpoints.


API Endpoints

Authentication

POST /api/auth/register
POST /api/auth/login

Dashboard

GET /api/dashboard/stats

Transactions

GET   /api/transactions
POST  /api/transactions
GET   /api/transactions/{id}
PATCH /api/transactions/{id}/status

Health

GET /api/health

Testing

Run the backend tests with:

cd backend
pytest

The test suite verifies the deterministic behavior of the risk engine.


Local Development

Backend

cd backend
python -m venv .venv

Windows:

.venv\Scripts\activate

macOS/Linux:

source .venv/bin/activate

Install dependencies:

pip install -r requirements.txt

Run FastAPI:

uvicorn app.main:app --reload

Frontend

In another terminal:

cd frontend
npm install
npm run dev

The frontend will run at:

http://localhost:3000

Engineering Highlights

This project demonstrates practical experience with:

  • Full-stack application architecture
  • REST API development
  • React and TypeScript
  • FastAPI backend development
  • JWT authentication
  • Relational database design
  • SQLAlchemy ORM
  • Redis caching
  • Explainable rule-based risk scoring
  • Interactive analyst workflows
  • API error handling
  • Docker containerization
  • Automated backend testing

Future Improvements

Potential future enhancements include:

  • Historical transaction charts
  • More advanced anomaly detection
  • Machine-learning-based risk scoring
  • Role-based access control
  • Analyst audit logs
  • Email and notification alerts
  • Advanced transaction analytics
  • CI/CD integration
  • Production monitoring and observability

These are planned ideas and are not presented as currently implemented features.


Author

Aaryan Shukla

Computer Programming & Analysis
Seneca Polytechnic


Disclaimer

FinGuard was created as a student portfolio project for educational and demonstration purposes.

The application uses simulated transaction data and a deterministic rule-based risk engine. It should not be used to make real financial, banking, credit, or fraud-detection decisions.

About

Full-stack fraud risk monitoring platform built with FastAPI, Next.js, PostgreSQL, Redis, and Docker.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages