Healthcare Clinic Management — Super Admin Platform (Full-Stack)
A Full-Stack Super Admin Platform for a Healthcare Clinic Management SaaS product built entirely with Next.js and Firebase — no separate backend server. Built solo from database schema through deployment, covering multi-branch clinic management, role-based access control, clinic approval workflows, invoice management, and real-time Firestore synchronization. Firebase serves as the complete backend: Auth, Firestore, Storage, Cloud Functions, and Security Rules.
Tech Stack
Key Features
- Multi-branch clinic management with per-branch CRUD operations and configuration
- Role-based access control — Super Admin, Branch Manager, Clinic Staff roles
- Clinic approval and onboarding workflow — create, review, approve, and activate clinics
- Invoice approval and change-request management with audit trail
- Real-time Firestore data sync — dashboard updates instantly across all sessions
- Secure Firebase Authentication with per-role route protection
- User administration — create, manage, suspend, and configure staff across branches
- Clinic changes tracking — approve or reject configuration change requests from clinic admins
Problem Statement
A Healthcare Clinic Management SaaS platform needed a centralized Super Admin interface to manage dozens of clinics spread across multiple branches — with approval workflows, user management, and real-time operational visibility. No existing solution existed; I was tasked with building it from scratch as the sole engineer.
Architecture Overview
Next.js App Router frontend with server and client components organized by feature. Firebase Auth handles authentication with custom claims enforcing RBAC. Firestore is structured with top-level collections per domain (clinics, branches, users, invoices) with subcollections for granular data. Firebase Security Rules enforce per-role read/write boundaries. Tailwind CSS with a consistent design system across all admin views.
Challenges
- Designing Firestore schema to support multi-tenant isolation while keeping queries efficient
- Implementing RBAC across Next.js routes with Firebase custom claims and server-side validation
- Building clinic approval workflows that maintain audit history for compliance
- Keeping all dashboard metrics real-time without excessive Firestore read costs
- Sole engineer ownership — architecture, implementation, testing, and deployment all on one person
Solutions
- Modeled Firestore with compound keys and denormalized snapshots for read-heavy dashboard queries
- Used Firebase custom claims checked in Next.js middleware for server-side route protection
- Implemented a status-machine pattern for approval flows (pending → review → approved/rejected) with immutable history sub-documents
- Used Firestore onSnapshot listeners scoped to user role to minimize reads while maintaining real-time UI
- Structured the project with a feature-based folder architecture enabling independent development of each domain
Results & Impact
- Delivered full production platform as sole engineer — live and serving real clinic operations
- Real-time sync ensures zero-latency updates across all connected admin sessions
- RBAC implementation prevents any cross-tenant data access — zero security incidents post-launch
- Clinic onboarding time reduced from manual emails to a structured self-service approval flow