Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FinTech Portfolio Management Platform

A modular, containerized full-stack FinTech application for managing investment portfolios, built with a modern web stack and an authentication-first architecture.

The system provides secure user authentication, portfolio tracking, transaction handling, and real-time market data integration, all orchestrated through Docker for consistent local development.


✨ Features

  • Secure authentication via OAuth2 / OpenID Connect
  • Portfolio & transaction management
  • Real-time asset valuation
  • RESTful backend API
  • Modern frontend with state management
  • Fully containerized development environment
  • Persistent relational database

🧱 Architecture Overview

The application is structured as a monorepo with clearly separated responsibilities:

Layer Technology
Frontend React + Vite (served via Nginx)
Backend Python + Flask
Authentication Keycloak (OIDC)
Database PostgreSQL
Infrastructure Docker & Docker Compose

All services communicate over an isolated Docker network, allowing the entire stack to be started with a single command.


📁 Repository Structure

.
├── backend/                # Flask API (business logic, auth, models)
│   ├── controllers/
│   ├── models/
│   ├── services/
│   ├── extensions.py
│   └── app.py
│
├── frontend/               # React frontend
│   ├── src/
│   ├── public/
│   └── vite.config.js
│
├── docker/                 # Dockerfiles & Nginx config
│   ├── backend/
│   └── frontend/
│
├── docker-compose.yml      # Full stack orchestration
├── .env.example            # Environment variable template
└── docs/                   # Architecture & design notes

🚀 Getting Started

Prerequisites

  • Docker Desktop
  • Docker Compose v2

No local installation of Node.js, Python, or PostgreSQL is required.


Environment Configuration

Create a local .env file using the provided template:

cp .env.example .env

Example values:

DATABASE_URL=postgresql+psycopg2://postgres:postgres@db:5432/fintech
KC_CLIENT_SECRET=replace-me
VITE_API_URL=http://localhost:8000

.env files are intentionally excluded from version control.


Run the Full Stack

docker compose up --build

This command:

  • Builds frontend and backend images
  • Starts PostgreSQL with persistent storage
  • Starts Keycloak for authentication
  • Serves the frontend via Nginx
  • Exposes the backend API

🌍 Service Access

Service URL
Frontend http://localhost:5173
Backend API http://localhost:8000
Auth Server http://localhost:8080

🔐 Authentication

Authentication is handled via Keycloak using OpenID Connect:

  • Users authenticate against the identity provider
  • Access tokens are issued and attached to API requests
  • Backend routes enforce authorization via token validation

This setup mirrors real-world enterprise identity architectures.


🗄️ Database & Persistence

PostgreSQL runs in a dedicated container with a named volume:

  • Data persists across container restarts
  • Schema is managed via SQLAlchemy models
  • Tables are initialized automatically on first run

To inspect the database:

docker compose exec db psql -U postgres -d fintech

🧪 API-First Development

The backend can be tested independently of the frontend using:

  • curl
  • Postman / Insomnia
  • Direct container access

Example:

curl http://localhost:8000/products/

🧰 Useful Commands

# Stop all services
docker compose down

# Rebuild everything
docker compose up --build

# View running containers
docker compose ps

# Follow logs
docker compose logs backend

🧭 Design Principles

  • Clear separation of concerns
  • Auth-first API design
  • Container-native development
  • Explicit configuration via environment variables
  • Minimal assumptions about runtime environment

⚠️ Notes

This project is intentionally focused on clarity, correctness, and architecture rather than production hardening (e.g. rate limiting, secrets management, CI/CD).


📄 License

MIT License


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages