Skip to content

About

ample backend for a digital banking platform with user authentication, KYC profiles, multi-currency bank accounts, transactions, virtual cards, and role-based access control.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

Β 

History

53 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏦 Digital Banking Platform

Modern banking platform built with :

Python Django Docker License
Technology stack

This project provides a sample backend for a digital banking platform with user authentication, KYC profiles, multi-currency bank accounts, transactions, virtual cards, and role-based access control.

Database Schema :


Service Schema :

πŸ— Architecture

Service Port Description
Nginx (API) 8080 Main API endpoint
PostgreSQL 5432 Database
Mailpit UI 8025 Local email testing
Flower 5555 Celery monitoring
RabbitMQ 15672 RabbitMQ management
                 Client
                    |
                  Nginx
                    |
            Django REST API
             /      |       \
      PostgreSQL   Redis   RabbitMQ
                              |
                           Celery Worker
                              |
                        Background Jobs

✨ Features

Authentication & Security

  • Custom User model (email-based login)
  • Role-based access control (Customer, Teller, Account Executive, Branch Manager)
  • OTP verification
  • Security questions
  • Account lockout after failed login attempts
  • JWT authentication via Djoser

User Profile & KYC

  • Comprehensive user profile
  • Identity documents (photo, ID photo, signature)
  • Next of Kin management
  • Employment and personal information

Bank Accounts

  • Multiple account types: Current & Saving
  • Multi-currency support: Toman, US Dollar, Euro
  • Primary account designation
  • KYC verification workflow
  • Daily interest calculation for savings accounts

Transactions

  • Deposit
  • Withdrawal
  • Transfer (with Security Question + OTP verification)
  • Interest transactions
  • Transaction history with filtering & pagination
  • PDF statement generation (sent via email)

Virtual Cards

  • Create and manage virtual cards linked to bank accounts
  • Card status management (Active / Inactive / Blocked)

Infrastructure

  • Docker & Docker Compose ready
  • PostgreSQL
  • Redis + Celery + Celery Beat + Flower
  • RabbitMQ
  • Nginx reverse proxy
  • Mailpit (local email testing)
  • API documentation with drf-spectacular (Swagger / ReDoc)

πŸ›  Tech Stack

Category Technology
Framework Django + Django REST Framework
Authentication Djoser + JWT
Database PostgreSQL
Task Queue Celery + Redis + RabbitMQ
API Docs drf-spectacular
Containerization Docker + Docker Compose
Reverse Proxy Nginx
Email (Local) Mailpit

πŸš€ Installation

This project is simple to run in local, I have created a Makefile for shorten the commands.

So You need to install the lastest version of Docker

And after the installation of Docker just run the following command :

git clone https://github.com/maryus1991/BankingSystem.git
cd BankingSystem/api
make build

And open the localhost:8080/ for swagger documentation

And for admin page just run the following to create superuser and enter the admin panel

make superuser

Some kind of information for create admin user :

admin panel path : localhost:8080/admin/

Useful Make Commands

Command Description
make build <container name> Build and start all services
make up <container name> Start services
make ps <container name> Start services
make down <container name> Stop services
make down-v <container name> Stop and remove volumes
make restart <container name> Restart the container
make logs-f <container name> Follow logs
make migrate Run database migrations
make makemigrations Create new migrations
make superuser Create a superuser
make sh <container name> Open shell in a container
make flush Flush the database

container name can be provided or be empty

For more command read the makefile

Production deployment configuration is available through production.yml


πŸ“‚ Database Backup & Restore

This project includes PostgreSQL backup and restore scripts with Makefile commands to simplify database maintenance in self-hosted environments.

Command Description
make banker-take-backup Create a database backup
make banker-list-backups List available backups
make banker-restore-backup <backup name> Restore a database backup

⚠️ Restore Notice

Before restoring a backup, the database will be flushed to ensure a clean restore process.

This backup system is only compatible with PostgreSQL.

Backup and maintenance scripts are located at:

api/docker/local/maintenance/

πŸ“‚ Project Structure

BankingSystem/
β”œβ”€β”€ api/
β”‚   β”œβ”€β”€ core_apps/
β”‚   β”‚   β”œβ”€β”€ accounts/          # Bank accounts & transactions
β”‚   β”‚   β”œβ”€β”€ cards/             # Virtual cards
β”‚   β”‚   β”œβ”€β”€ user_auth/         # Custom authentication
β”‚   β”‚   β”œβ”€β”€ user_profile/      # KYC & profile management
β”‚   β”‚   └── common/            # Shared models & utilities
β”‚   β”œβ”€β”€ config/                # Django settings
β”‚   β”œβ”€β”€ docker/                # Dockerfiles
β”‚   β”œβ”€β”€ requirements/          # Dependencies
β”‚   β”œβ”€β”€ local.yml              # Local Docker Compose
β”‚   β”œβ”€β”€ production.yml         # Production Docker Compose
β”‚   └── Makefile               # Useful commands
β”œβ”€β”€ docs/
β”‚   └── DBSchema/              # Database schema diagrams
└── LICENSE

πŸ“‘ API Documentation

After starting the project, you can access the interactive API documentation at:

  • Swagger UI: http://localhost:8080/api/docs/
  • ReDoc: http://localhost:8080/api/redoc/

πŸ” Security

Implemented security mechanisms:

  • JWT authentication
  • OTP verification
  • Account lockout protection
  • Role-based permissions
  • Secure transaction verification
  • KYC workflow

πŸš€ Production Deployment

Production stack:

  • Nginx
  • Gunicorn
  • PostgreSQL
  • Redis
  • Celery Workers
  • RabbitMQ
  • Docker Compose

🌟 Highlights

  • Designed a modular banking backend architecture
  • Implemented multi-currency accounts
  • Built asynchronous transaction processing
  • Designed role-based banking permissions
  • Containerized full development environment

License

This project is licensed under the BSD 3-Clause License.
See the LICENSE file for details.


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

Mostafa EbrahimZadeh (@maryus1991)

About

ample backend for a digital banking platform with user authentication, KYC profiles, multi-currency bank accounts, transactions, virtual cards, and role-based access control.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages