
Architect a secure banking api with dockerized services, using nginx as reverse proxy and load balancer for ssl termination, routing to the api and postgres, supporting core banking services.
Targeted at experienced python developers, this course outlines prerequisites for building a Django banking API, including rest framework basics, docker, http vs https, token authentication, and testing and logging.
Explore the course tech stack, including Python three with type hints, Django and rest framework, Pipenv, Docker and Docker compose, Celery and Flower, Redis and RabbitMQ, and SSL with Letsencrypt.
Install Python 3.12.5 and pip, create a working directory and api folder, set up a Pipenv virtual environment, install Django 4.2.5, and activate the environment in an IDE.
Here are the packages installed in this lecture, if you dont want to type them out in your terminal:
pipenv install python-dotenv==1.0.1 djangorestframework==3.15.2 django-countries==7.6.1 django-phonenumber-field==8.0.0 phonenumbers==8.13.42 drf-spectacular==0.27.2 Pillow==10.4.0 argon2-cffi==23.1.0 djoser==2.2.3 django-filter==24.3 django-celery-email==3.0.0 django-celery-beat==2.6.0 cloudinary==1.39.1 python-dateutil==2.9.0 psycopg2-binary==2.9.9
Configure local.py using environment variables from base.py. Set allowed hosts and admin URL, and implement a 1 MB upload limit with base64-encoded small images and temporary storage for large files.
Define and add django apps—user auth, user profile, and common—within a project, configure app names and translations, then run the dev server and commit the setup.
Explore detailed logging with Log Guru to debug web apps. Learn file rotation, automatic exception logging with tracebacks, runtime level changes, and seven unique log levels with integer values.
Install luguru version 0.7.2 and configure Django logging with debug and error handlers, rotation and formatting. Create an interceptor to forward logs to luguru.
configure log guru logging via interceptor in django base.py, set up a log guru handler and debug route, test with a view, then switch to postgres docker with env vars.
Configure Docker Desktop, set up Docker Compose, and build a multi-stage Dockerfile to containerize a Django app, manage dependencies, and prepare entrypoint and start scripts.
Create a start script to migrate models, collect static files, and run the Django server on port 8000, while configuring a docker ignore file to exclude git, envs, and logs.
Learn to automate long docker compose tasks with a makefile, including build, up, down, migrations, and database management for a Django banking API.
Configure Django OTP by updating base and local settings, set CSRF trusted origins, manage OTP expiration, implement six-digit OTP generation, and create email utilities for OTP and account-locked notifications.
Create a custom user model with a UUID primary key and email-based username. Add security questions, account status and role enums, plus OTP with expiry and failed login attempts.
Extend the custom Django user model with brute force protection by locking after multiple failed logins, recording the last failed attempt, and enabling auto unlock after the lockout duration.
Build two Django admin forms for user creation and change by extending Django forms with custom fields and validation. Enforce unique email and id number, security questions, and is_superuser.
Set up nginx as a reverse proxy for the Django API, serve admin static files, define an upstream to api:8000, and implement detailed logging and static file caching with docker.
Configure celery by updating base.py: set time zone, broker URL, result backend, content and serializers, enable task events, and use django celery beat with a database scheduler.
Update the docker-compose setup by adding redis and rabbitmq services, declare their ports and volumes, align networks, and reuse api service anchors for celery and flower workers.
Create the profiles model for KYC data, linked 1-to-1 to the user, with defaults from base.py and fields for salutation, gender, marital status, identification, and contact details.
Add a next of kin model linked to the profile via a foreign key, enabling a one-to-many relationship, with salutation, gender, contact details, and is_primary; enforce primary kin per profile.
Learn to implement Django signals that auto-create a user profile on new user creation and update the profile on save, using the post_save signal, receiver, and app config ready.
Configure a Django admin for user profiles with Cloudinary photo uploads, inline next of kin, and rich list displays, then run migrations and verify profile creation via signals.
Implement jwt-based token authentication, returning access tokens as secure http-only cookies named access; set lax same-site path; create a cookie authentication class to read tokens from header or cookie.
Configure Djoser and Rest framework simplejwt by generating a signing key, setting environment variables, and wiring authentication, permissions, throttling, and token lifetimes for a secure banking API.
Develop a Django banking API authentication flow using custom cookie-based access and refresh tokens, OTP verification, and email delivery, with login attempt handling and account lockout.
Implement class-based auth views for a Django banking API, including a custom token refresh view, OTP verify view, and logout with cookie-based access and refresh tokens.
Set up user auth urls with login, verify otp, refresh, and logout, and include them under api/v1/auth. Demonstrate registration, activation emails, and activation workflow via uuid and token.
Test and validate jwt endpoints for secure login using email otp, cookies, and access and refresh tokens; handle failed attempts, account lock, and otp expiry with automatic api docs.
Define a generic json renderer in django rest framework that outputs a status code and an object-labeled data payload, configurable via view attributes, and encoded with utf eight.
Enhance profile photo handling by implementing a Celery task that uploads images to Cloudinary, supports base64 and file inputs, updates profile fields, and logs outcomes for reliability.
Build Django profile views for a fintech API, including a list with search by first name, last name, and ID number, plus detail view with permissions and profile view recording.
Build the next of kin API view and detail API view tied to the current user's profile, enabling list and create operations with pagination and a JSON renderer.
In this comprehensive course we shall learn the art of building a professional-grade Banking API using Django and modern best practices!
You'll learn how to create a secure, scalable, and feature-rich banking system that handles everything from user authentication and KYC verification to real-time transactions, multi-currency support, creation of virtual cards, Fraud detection/suspicious transactions detection and automated PDF statement generation.
You'll dive deep into industry-standard practices like implementing Two-Factor Authentication via otp, rate limiting, comprehensive logging, JWT auth via cookies, asynchronous task processing with Celery,Setting up reverse proxies via NGINX, API Documentation, email notifications, among many other practices
By leveraging powerful tools like PostgreSQL, Redis, RabbitMQ, and Docker, you'll build a production-ready API that could serve as the backbone of a modern digital banking platform. Throughout the course, you'll gain hands-on experience with essential banking operations including deposits, withdrawals, and inter-account transfers, while implementing robust error handling and transaction logging by using popular third party tools such as Loguru.
Whether you're an aspiring FinTech developer or looking to level up your Django skills, this course will teach you how to architect and implement banking-grade security measures, handle financial transactions, and create maintainable, well-documented code that follows real-world banking protocols.