01
Project name
PaySafe
PaySafe
One-line description
A payroll-linked lending platform API for employers and employees in Zambia, with an interactive architecture map that visualizes how requests move through the system.
My role
Timeline
Category
Platforms
Tech stack
Links
02
Employers and financial institutions in Zambia need a secure way to offer salary-backed loans to employees, with proper affordability checks, employer approval workflows, rate calculations, and compliant OTP-based authentication. The system had to support multiple user types (employees, sales agents, employer admins), handle sensitive financial data, integrate with async messaging for OTP delivery, and remain understandable to stakeholders who are not reading Python tracebacks.
03
I built PaySafe as a Django REST API that powers loan lifecycle management, employee onboarding, employer setup, rate-sheet processing, and multi-channel OTP (SMS, WhatsApp, email via queue workers). Alongside the API, I shipped an interactive architecture diagram, a layered, animated system map where users can simulate real request paths (OTP send, loan application, rates lookup, etc.) and watch nodes and edges light up step by step. This makes the backend tangible for demos, onboarding, and portfolio storytelling.
04
JWT authentication with MFA / OTP login
Secure auth flows with multi-factor and one-time password verification.
Loan lifecycle management
Loan creation, approval stages, refinancing, and deductions.
Employee & employer operations
Employee lookup, affordability checks, and employer hierarchy (divisions, departments, units).
Rates engine
PAYE calculations and employer rate-sheet uploads.
Async OTP delivery
OTP generation, verification, and async delivery through AWS SQS.
Geo & document storage
Zambian provinces and districts endpoints; employer MOUs and rate sheets on S3.
Interactive architecture diagram
Four-layer map (Client → Gateway → Services → Data) with five simulatable request flows, glowing nodes, animated edges, layer filtering, and live simulation HUD.
05
API: mobile/web clients → Django gateway (Gunicorn on AWS App Runner) → DRF viewsets and service modules (OTP, loans, rates, notifications) → PostgreSQL; async work via SQS; files on S3. Diagram app decoupled into four concerns: pure data definitions (nodes, edges, flow paths); React Context simulation engine; custom renderers; React Flow canvas.
Django 4.2 with Django REST Framework and SimpleJWT. Modular paysafeapp with viewsets, serializers, signals, and Celery tasks. Custom OTP kit: HMAC-hashed codes, rate limiting, Django-backed storage, SQS outbox channel. Employer settings, rate-sheet config, and document upload pipelines.
Vite + React 18 + TypeScript for the architecture tool. React Flow v11 for the diagram canvas; Framer Motion for node transitions. Strict edge naming (e-<source>-<target>) so the simulation engine reconstructs active segments from path arrays. All visual state derived from (activeSimulation, flowProgress).
PostgreSQL (AWS RDS) in production; SQLite for local development. Models cover users, employers, employees, loans, approvals, deductions, OTP records, refinances, and notification reminders.
REST API under /api/ (loans, employers, employees, users, deductions, refinances). Auth under /api/auth/ (JWT + MFA). OTP: /api/otp/send/, /api/otp/verify/. Rates health, lookup, suggest terms, tool endpoints. AWS SQS for OTP outbox; S3 via django-storages; Celery for background jobs.
AWS App Runner + Gunicorn for the Django API. Vercel for the static architecture diagram SPA. Secrets and queue config via AWS Secrets Manager. Migrations and superuser bootstrap in deployment startup script.
06
OTP delivery without blocking the API
OTP sends must be fast for the user but reliable across SMS/WhatsApp/email. Implemented an outbox pattern: the API writes to Django storage and enqueues SQS; workers handle provider routing separately.
Keeping the architecture diagram in sync with reality
Encoded real PaySafe paths (OTP send, verify, MFA, loan, rates) as data arrays where every consecutive node pair must match a real edge, so the simulation cannot lie about connectivity.
Vercel deploying a monorepo with Django present
Vercel auto-detected Django from manage.py and failed after the Vite build. Fixed by setting framework to Vite explicitly, pointing build output to architecture-flow/dist, and ignoring Python app files during deploy.
Complex loan domain logic
Loans tie together employees, employers, approvals, deductions, refinancing, and notifications. Used DRF viewsets, signals, and dedicated notification modules to keep side effects out of view logic.
07
Shipped a production-grade REST API covering auth, lending, employer setup, rates, and OTP. Deployed an interactive architecture experience at paysafe-architecture.vercel.app. Documented five critical request flows stakeholders can replay in one click. Established a reusable pattern for animated system diagrams (data → engine → renderers → canvas) applicable to other projects.
08
09
I design and ship production-ready systems at the intersection of cloud infrastructure, full-stack engineering, and human-centred product thinking.
Send email · kuzagbechristopher@gmail.com