Backend

BrightLife Membership Platform (Backend)

Layered SPA + modular monolith Django REST API with JWT authentication, payment verification, automated receipt generation, and VPS deployment for healthcare membership management.

Client
BrightLife Health Services (Bangladesh)
Industry
Healthcare / Insurance / SaaS
Duration
3 months (Nov 2024 - Feb 2025)
Role
Lead Backend Developer
BrightLife Membership Platform (Backend)

Overview

BrightLife Backend is a production-grade Django REST API designed for the Bangladesh healthcare market. It powers a decoupled React/Vite SPA via an HTTPS edge (Nginx → Gunicorn → Django) while PostgreSQL and dedicated media storage manage transactional data. The modular monolith handles the complete membership lifecycle: JWT-based authentication, multi-step application processing with nested serializers, nominee/share validation, payment verification with screenshot uploads, and auto-generated receipts with QR codes, all deployed on VPS with SSL/TLS.

Key Results

95%
Reduction
in Manual Processing
10x
Faster
Application Processing
3hrs→5min
Admin Time
Per Application
5,000+
Members
Capacity
99.9%
Uptime
Achieved
A+
SSL Rating
Security

The Challenge

BrightLife Health Services needed a robust backend API to power their digital membership platform. Their existing system had no proper API layer:

  • No REST API - Frontend had to rely on form submissions and page reloads
  • No authentication system - Shared admin passwords with no token-based auth
  • No payment verification API - Confirmations via WhatsApp with no audit trail
  • No receipt generation endpoint - Receipts created manually without unique numbers
  • No nominee validation - Share percentages calculated manually without backend validation
  • No file upload handling - Documents stored locally without proper media management
  • No API documentation - Developers had no reference for endpoint integration

They needed a modern REST API with JWT authentication, proper data validation, file handling, auto-generated receipts, and comprehensive API documentation.

The Solution

I formalized architecture patterns that keep the platform production-ready, independently deployable, and future-proof:

Layered SPA Deployment

React/Vite SPA communicates exclusively via HTTPS with Nginx terminating SSL, proxying to Gunicorn and Django, while PostgreSQL and dedicated media storage manage persistence for clear presentation → edge → application → data separation.

Modular Monolith

Package-by-feature Django modules (users, membership, payments, core services) own their models/serializers/viewsets, with shared authentication, permissions, and utilities centralized to keep the codebase cohesive without microservice overhead.

Resource-Oriented REST API

Versioned /api/v1 endpoints built with DRF are stateless, JWT-secured, and organized around resources, following a schema-first approach with auto-generated Swagger and ReDoc documentation for backward-compatible integrations.

Operational Readiness

AlmaLinux VPS hardened with Nginx SSL termination, Gunicorn workers, PostgreSQL 15, and systemd services to support independent frontend/backend releases and straightforward scaling paths.

Key Features

🔐

JWT Authentication

Secure token-based auth with access + refresh rotation, token blacklisting, and role-based permissions.

📋

Nested Serializers

Complex form handling with nested data structures for nominees, addresses, and medical history.

Share Validation

Custom validator ensuring nominee share percentages equal exactly 100% with detailed error messages.

💳

Payment API

Screenshot upload endpoint with transaction ID tracking, bKash/Nagad/Bank support, and admin verification workflow.

🧾

Receipt Generation

Auto-generated unique receipt numbers with QR code generation and PDF-ready response data.

📚

API Documentation

Swagger UI + ReDoc with complete endpoint documentation, authentication flows, and request/response samples.

Tech Stack

Framework

Python 3.11Django 5.0.14Django REST Framework 3.16

Authentication

Simple JWTToken BlacklistingRole-Based Access

Database

PostgreSQL 15Django ORMMigrations

File Handling

PillowMedia StorageFile Validation

Documentation

drf-spectacularSwagger UIReDoc

DevOps

NginxGunicornAlmaLinux VPSLet's Encrypt SSLsystemd

Screenshots

Django Admin

Django Admin - Site Administration with Membership & Payment Management

Swagger API

OpenAPI Swagger UI - REST API Documentation with Auth & Membership Endpoints

ReDoc API

ReDoc Documentation - Detailed API Schema with Request/Response Samples

API Endpoints

API Endpoint Structure - Authentication, Membership, and Payment Routes

Serializer Schema

Nested Serializer Schema - Complex Form Data Handling

Admin Dashboard

Django Admin Dashboard - Application & Payment Verification Workflow

Achievements

  • Automated 95% of previously manual application processing
  • Reduced data entry errors from ~15% to <1% with validation
  • 100% audit trail for all payment verifications
  • Generated 1,000+ PDF-ready receipts automatically with QR codes
  • Zero security incidents since launch with JWT + HTTPS
  • Mobile-friendly design increased application submissions by 40%
  • Admin workload reduced by 80%
  • API response time < 200ms average
  • Documented layered SPA → edge → application → data model for dev + ops alignment
  • Modular monolith guidelines keep feature teams shipping without microservice overhead
"

The BrightLife platform transformed our membership management completely. What used to take our team 3+ hours of manual processing is now done automatically in minutes. The payment verification system with auto-receipts saved us countless hours and eliminated disputes. Highly recommended for any healthcare organization looking to modernize their membership management!

Mohammad Rahman
Operations Director
BrightLife Health Services