Employee Engagement Platform
Multi-Tenant Gamification Backend on Python FastAPI
Role: Built the Python FastAPI backend — tenancy, auth, points ledger, redemption, insights, notifications and the HRIS integration — and worked on the React web client.
Python FastAPI backend for a multi-tenant gamification platform for hourly workers: subdomain tenancy, JWT access/refresh with role guards, an append-only points ledger with approvals, gift-card redemption, KPI goal and insights endpoints, a WebSocket notifications inbox, and a UKG Pro integration driving shift polls and SMS. ~73 API operations used by the web client.
Key Features
- Python FastAPI backend, multi-tenant by subdomain, with a global login and JWT access/refresh + role guards
- Append-only points ledger from five earning sources with pending → approved status
- Gift-card redemption with points ↔ dollar conversion and per-card denomination ranges
- KPI goal and manager-insights endpoints: targets, comparators, date-ranged summaries, sortable paginated submissions
- WebSocket notifications inbox: role-based subscriptions, pushed unread counts, read acknowledgements
- UKG Pro (HRIS) integration driving shift-attendance polls and scheduled SMS
Tech Stack
Backend
Integrations
Infra
Frontend
Challenges & Solutions
Points That Can Be Audited
Workers earn points from five different sources and cash them out as gift cards. A single mutable balance can't be audited or recomputed, and it invites double-spend when two redemptions race.
An append-only ledger: every earning event writes a transaction with a category and a pending or approved status, the balance is derived from approved rows, and a redemption writes a negative ledger row plus a redemption record. Pending rows let leaders approve points before they count.
One Backend, Many Companies
Each customer company needed its own isolated space with its own users, branding and settings, while employees should still be able to log in from one place.
Multi-tenancy by subdomain: every request resolves its tenant from the host, and a global login looks up the user's tenant and returns it so the client can continue on the right subdomain. The WebSocket carries the tenant too, since browsers can't set headers on it.
Real-Time Manager Inbox
Leaders need to see new check-in and issue reports from their team as they arrive, without polling every list.
A WebSocket channel per user: the client subscribes by role, the server pushes only unread counts and the client acknowledges reads. Each push triggers a targeted refetch of the affected list, so REST stays the source of truth and messages stay small.
Shift Polls Driven by the HRIS
Attendance polls must go out before each worker's shift, but shifts live in the customer's HRIS, not in our database.
A UKG Pro integration with per-tenant credentials and a mapping between our locations and the HRIS locations drives shift-attendance polls and a configurable SMS scheduler; late or absent answers notify the leader.