iHospita Hospital Management System
Multi-Tenant SaaS Hospital Management System
Comprehensive HMS solution for modern healthcare facilities
About iHospita
iHospita is a multi-tenant Software-as-a-Service (SaaS) Hospital Management System designed for clinics and hospitals. The system allows multiple hospitals to use the same platform while keeping their data completely separate and secure.
Key Features
- Multi-Tenant Architecture - Complete data isolation between hospitals
- Enterprise Authentication - Keycloak-powered OAuth2/OIDC with 2FA
- API Gateway - Kong for rate limiting, load balancing, and routing
- Full Observability - Prometheus, Loki, Tempo, and Grafana stack
- Modular Microservices - NestJS monorepo with specialized services
- Modern Frontend - React + Vite Portal, Next.js Console and Queue Display
- Multi-Language - Support for English, Khmer, and Chinese
- Theme Support - Dark and Light mode with system preference detection
Architecture
iHospita follows a hierarchical multi-tenant architecture with complete data isolation:
┌─────────────────────────────────────────────────────────────┐
│ iHospita HMS (Multi-Tenant SaaS) │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ Hospital Level (Organization) │
│ • Multi-tenant isolation │
│ • Hospital-specific configuration │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ Clinic / Branch (Multiple Locations) │
│ • Multi-location support │
│ • Location-specific settings │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ Department (Emergency, Outpatient, Lab, Pharmacy) │
│ • Department-level operations │
│ • Specialized workflows │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ User Accounts (Staff) + RBAC │
│ ├─ Admin/Owner → Full system access │
│ ├─ Doctor → Clinical operations │
│ ├─ Nurse → Patient care │
│ ├─ Cashier → Billing & payments │
│ ├─ Lab Technician → Test processing │
│ ├─ Pharmacist → Medicine dispensing │
│ └─ Accountant → Financial reconciliation │
└─────────────────────────────────────────────────────────────┘
Platform Structure
The system consists of four separate applications:
| Application | Purpose | Deployment |
|---|---|---|
| Portal | Hospital staff operations | One instance per hospital |
| Console | iHospita platform administration | Single global instance |
| Queue Display | TV monitor queue display | One instance per hospital |
| Landing | Public marketing website | Single global instance |
Deployment Model
| Application | Deployment Type | URL Example |
|---|---|---|
| Portal | One instance per hospital | portal.samaki.com, portal.royal.com |
| Queue Display | One instance per hospital | queue.samaki.com, queue.royal.com |
| Console | Single global instance | console.ihospita.com |
| Landing | Single global instance | ihospita.com |
Technology Stack
Backend (NestJS Monorepo)
| Service | Purpose | Key Features |
|---|---|---|
| auth | Authentication & Authorization | Keycloak Integration, JWT, RBAC, 2FA |
| hms | Hospital Management System | Patient, Employee, Lab, Vaccination, Pharmacy |
| crm | Customer Relationship Management | Family Membership, VIP Tiers, Visitor Management |
| payment | Financial Management | Multi-payment, Reconciliation, Invoicing |
| queue | Appointment & Queue | Scheduling, Queue Management, Notifications |
| report | Analytics & Reporting | Financial, Clinical, Operational Reports |
| console | Platform Administration | Hospital Management, Role Templates, Subscriptions |
Frontend
| Application | Framework | UI Library |
|---|---|---|
| Portal | React + Vite | Ant Design |
| Console | Next.js 15 | Ant Design |
| Queue Display | Next.js 15 | Tailwind CSS |
| Landing | Next.js 15 | Tailwind + shadcn/ui |
Infrastructure
| Technology | Purpose |
|---|---|
| PostgreSQL 15 | Primary relational database |
| Redis 7 | Caching, sessions, real-time updates |
| Keycloak 23 | OAuth2/OIDC identity provider |
| Kong 3.5 | API Gateway |
| Docker | Containerization |
| DigitalOcean | Cloud hosting |
Observability Stack
| Technology | Purpose |
|---|---|
| Prometheus | Metrics collection and alerting |
| Loki | Log aggregation and querying |
| Tempo | Distributed tracing |
| Grafana | Dashboards and visualization |
| Alertmanager | Alert routing and notifications |
Key Differentiators
| Feature | Benefit |
|---|---|
| Multi-Tenant Architecture | One system serves multiple hospitals with complete data isolation |
| Enterprise Authentication (Keycloak) | OAuth2/OIDC, 2FA, SSO-ready, impersonation support |
| API Gateway (Kong) | Rate limiting, load balancing, centralized routing |
| Full Observability Stack | Prometheus metrics, Loki logs, Grafana dashboards |
| Real-Time Updates | Redis-powered instant data synchronization |
| Family-Centric CRM | Simplified loyalty system with family-based membership |
| Integrated Workflow | Seamless Patient → Enrollment → Lab → Pharmacy → Payment flow |
| Financial Compliance | Complete audit trail and reconciliation system |
| Modular Monorepo | Scalable, maintainable apps with shared database |
| Multi-Currency Support | USD & KHR with real-time exchange rates |
| Multi-Language Support | English, Khmer (ភាសាខ្មែរ), and Chinese (中文) |
| Dark/Light Mode | User-selectable theme with system preference detection |
Quick Navigation
- Getting Started - Start here for new developers
- User Requirements - Plain-language feature requirements
- Technical Architecture - Database schemas, APIs, implementation
- Infrastructure - Kong, Keycloak, Observability, DevOps
- UI/UX Design - Screen mockups and design specifications