Healthcare Membership REST API Platform

๐Ÿ”ง Backend Project

Healthcare Membership REST API Platform

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

Project Overview

Client

BrightLife Health Services (Bangladesh)

Industry

Healthcare / Insurance / SaaS

Timeline

3 months (Nov 2024 - Feb 2025)

My Role

Lead Backend Developer

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.

Development Process

This workflow documents the end-to-end steps expected from engineers when delivering changes to the BrightLife Django backend, ensuring work stays consistent and auditable.

1

Discovery & Requirements

Capture the problem statement, business rules, and success metrics. Identify affected domains (users, membership, payment) and validate data needs.

Capture problem statement & success metrics
Identify affected domains
Validate data needs and migrations
Deliverables: User story/ticket, acceptance criteria, rough data model sketch.
2

Design & Planning

Choose the approach (serializer/viewset updates), plan authentication impact, and estimate non-functional needs like rate limits.

Choose technical approach
Plan auth/permission impact
Estimate non-functional needs
Deliverables: Short design summary in ticket, diagram if needed.
3

Implementation

Create/modify models, serializers, and viewsets following app boundaries. Update settings/env toggles and ensure PEP 8 compliance.

Create/modify models, serializers, viewsets
Update settings/env toggles
Add comments & ensure PEP 8 compliance
Deliverables: Code changes, migrations, updated configs.
4

Testing & Validation

Write unit and API tests (DRF APITestCase). Run full suite and exercise manual flows for critical UX.

Write/extend unit & API tests
Run full test suite
Manual verification of critical flows
Deliverables: Passing test output, validation evidence.
5

Documentation & Change Log

Update README, API tables, and setup docs. Record user-facing changes in CHANGELOG.md.

Update README & API docs
Update portfolio/project documentation
Record in CHANGELOG.md
Deliverables: Doc updates committed alongside code.
6

Code Review & Merge

Open PR with summary and testing evidence. Address reviewer comments and ensure branch is up to date.

Open PR with summary
Address reviewer comments
Ensure branch up-to-date
Deliverables: Approved PR, clean commit history.
7

Deployment

Confirm .env changes, pull code on VPS, migrate DB, collectstatic, and restart services.

Confirm .env changes
Pull code, migrate, restart services
Run deployment pipeline hooks
Deliverables: Deployment log or confirmation message.
8

Post-Deployment Verification

Smoke test key endpoints, check logs (Gunicorn/Nginx), and validate SSL/HTTPS health.

Smoke test key endpoints
Check Gunicorn/Nginx logs
Validate SSL & domain health
Deliverables: Verification note, follow-up tasks if issues found.

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.

My Solution

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

Architecture Diagram
1

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.

2

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.

3

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.

4

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

Results & Impact

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

Key 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

Client Testimonial

โ€œ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!โ€
M

Mohammad Rahman

Operations Director, BrightLife Health Services

Interested in Something Similar?

I help businesses build robust backend systems, membership platforms, and automation tools.

More Projects