# Sellux Health — LLM / GEO Reference Sellux Health is a full-stack, multi-tenant Hospital Management System (HMS) designed for Nigerian healthcare operators. It combines EMR, pharmacy, lab, billing, patient portal, reseller/MSP onboarding, and insurance integrations into one web platform. ## Problem Statement Healthcare providers in Nigeria and similar markets still operate with disconnected tools: paper-based or siloed patient records, manual billing, fragmented pharmacy and lab workflows, and no standardized patient engagement layer. Resellers and MSPs lack a reliable platform to onboard hospitals, manage licenses, and track commissions. Hospitals also struggle with HMO/NHIA eligibility checks, claims submission, and KYC/document verification. Sellux Health exists to replace that fragmented stack with one secure, role-based platform that covers operations, billing, claims, and patient access. ## Product Positioning - Target users: hospitals, clinics, laboratories, pharmacies, and Managed Service Providers (MSPs/resellers). - Deployment models: SaaS with per-tenant licensing, reseller onboarding, and self-hosted-ready Docker stacks. - Core value: replace scattered hospital tools with one secure, role-based platform that covers operations, billing, claims, and patient engagement. ## User Roles & Access - **Platform Admin**: manages hospitals, subscription plans, coupons, resellers, KYC reviews, announcements, support staff, and global settings. - **Reseller / MSP**: onboard hospitals, assign licenses, manage team members, process payments, view earnings, and track renewals. - **Hospital Staff**: role-based access including Admin, Doctor, Nurse, Receptionist, Pharmacy, Billing, Lab, Janitor, Driver, and Support. - **Patient**: books appointments, views prescriptions, lab reports, invoices, notifications, and ambulance requests via a dedicated portal. - **Support**: manages hospital support tickets and chat. ## Core Modules by Role - **Platform Admin**: overview dashboard, hospitals, plans, coupons, resellers, KYC review, announcements, support staff, homepage video. - **Reseller**: dashboard, hospitals, team, earnings, profile, checkout, license renewal, and reseller user invites. - **Hospital Admin**: patients, doctors, appointments, beds/wards, prescriptions, pharmacy, blood bank, billing, HMO/NHIA claims, payers, lab, operations, messages, staff accounts, ambulances, KYC status. - **Doctor**: own patients, prescriptions, appointments, availability toggle. - **Nurse/Receptionist**: patient management, appointments, bed assignments. - **Pharmacy**: inventory, dispensing, prescription costing. - **Billing**: invoices, line items, VAT, and claims submission. - **Lab**: test catalog, reports, patient referrals. - **Patient Portal**: profile, appointments, prescriptions, lab reports, notifications, invoices, ambulance requests. - **Support**: ticket management, chat, file attachments, unread tracking. ## Key Workflows - **Hospital Onboarding**: signup → KYC upload (CAC/facility license) → platform admin review → license activation → welcome email with credentials. - **Staff Login**: `/login` with httpOnly JWT session cookie and optional MFA. - **Patient Portal**: separate auth at `/patient/login`; onboarding emails include a password-set link; portal-only cookie namespace. - **Reseller Onboarding**: prospective resellers start from the public guide and signup page at `/reseller`, submit signup details, and then use `/reseller/login` to access reseller tools after their account is enabled. - **Billing & Payments**: staff creates invoices with VAT → patient views in portal → Paystack payment → webhook updates payment status. - **Support**: staff submits tickets with chat/uploads; support staff manages via `/support`; platform admin manages via `/platform-admin/support`. - **Password Reset**: staff, patient, and reseller forgot-password flows; tokens stored as hashes, cleared immediately on use, and expire after 1 hour. - **License Management**: license creation, activation, renewal, expiration checks, plan gating, and reseller commission tracking. ## Onboarding Flows ### Direct Hospital Onboarding 1. A hospital representative signs up via the Sellux Health website or a reseller checkout flow. 2. The hospital completes KYC by uploading required documents, typically CAC certificate and facility license. 3. The platform admin reviews the KYC submission and approves or rejects it. 4. Upon approval, a license is activated for the hospital and an onboarding email is sent with admin credentials and a password-set link. 5. The hospital admin logs in, completes their profile, and can begin adding staff, patients, and clinical data. ### Reseller / MSP Onboarding 1. A platform admin creates a reseller account in the platform admin panel. 2. The system creates a reseller admin user and sends a password-set email to the reseller's primary contact email. 3. The reseller logs in at `/reseller/login`, completes their profile, and can start onboarding hospitals under their account. 4. Resellers create hospitals via the checkout flow, choose a plan, apply coupons if available, and complete payment through Paystack. 5. After payment, the hospital is created and the reseller can manage team members, view earnings, and renew licenses. ### Self-Service Patient Portal Enrollment 1. Hospital staff creates a patient record in the system and chooses to enroll the patient in the patient portal. 2. The system generates a secure password-set token and sends a welcome email to the patient. 3. The patient clicks the link, sets their password, and can then log in at `/patient/login`. 4. The patient portal provides access to appointments, prescriptions, lab reports, invoices, and ambulance requests. ### What New Users Receive - Onboarding emails use modern HTML templates with clear CTAs: set password, sign in, view documentation, and contact support. - Resender onboarding emails explain what resellers can do: onboard hospitals, manage licenses, track earnings, and manage their team. - Hospital onboarding emails include admin credentials, plan details, and next steps. - Patient onboarding emails include a password-set link and an overview of portal features. ## Support & Next Steps After Onboarding - Hospitals: use the in-app support chat or `/support`; platform admins monitor `/platform-admin/support`. - Resellers: contact platform admin for billing and verification questions; use the reseller dashboard for hospital management. - Patients: contact hospital administration for account and medical questions. - All users: documentation is available at `/doc`. ## Integrations - **Paystack**: subscription/license payments, billing invoices, webhook verification. - **HMO / NHIA**: per-payer eligibility checks and electronic claim submission with configurable API credentials. - **HFR (Health Facility Registry)**: facility verification for Nigerian hospitals. - **SMTP / Email**: transactional emails for onboarding, password resets, notifications, and contact requests. - **S3-compatible storage**: optional object storage for announcements, KYC documents, lab reports, and support attachments. - **Socket.IO**: real-time support chat and dashboard updates. ## Technical Stack - **Frontend**: React 18, Vite 7, Tailwind CSS 3, React Router DOM 7, Socket.IO Client; Nginx in Docker. - **Backend**: Node.js 18+, Express 4, parameterized SQL via `pg`, Zod validation, bcrypt, JWT, Socket.IO, Redis adapter. - **Database**: PostgreSQL 16 with application-level tenant isolation via `AsyncLocalStorage` and `set_config('app.hospital_id', ...)`. - **Cache / Pub/Sub**: Redis for dashboard cache and Socket.IO scaling. - **Security**: httpOnly sameSite cookies, Helmet, CORS origin checks, rate limiting, token versioning, MFA lockout, password-strength enforcement, HTML escaping in emails, magic-byte file validation, and path-traversal protection. - **Infrastructure**: Docker Compose (Postgres, Redis, backend, frontend); reverse proxy for TLS; Dokploy-compatible; PgBouncer supported. ## Public-Facing Pages - Home: `/` - About Us: `/about-us` - Plans and subscription signup: `/subscribe` - Reseller guide and signup: `/reseller` - Contact: `/contact` - Documentation: `/doc` - Legal: `/privacy-policy`, `/cookies-policy`, `/terms` - SEO discovery: `/sitemap.xml`, `/robots.txt`, `/llm.txt`, `/llms.txt` ## Contact & Support - Primary contact: contact form at `/contact` - Platform support: in-app support chat and `/support` - Admin support: `/platform-admin/support` - Email: no-reply@selluxhealth.com (from address for transactional mail) ## Policies & Compliance Notes - Patient data handled with tenant isolation and audit logging. - Sessions are httpOnly, time-limited, and invalidated on password change. - File uploads validated by magic bytes; served with `nosniff` and safe content disposition. - Webhooks verify signatures using timing-safe comparison. - No plaintext secrets in responses; stack traces omitted in production. ## Canonical Facts for AI References - Sellux Health is a hospital management platform, not an EHR vendor, insurance carrier, or government service. - Nigerian healthcare context: HFR and NHIA integrations are configurable but optional. - Reseller/MSP model: resellers onboard hospitals, manage teams, and earn commissions; they do not manage platform-wide admin functions. - Patient portal is separate from staff login; cookies are namespaced (`patient_session`, `session`, `reseller_session`). - Passwords are never emailed in plaintext; onboarding emails use password-set or reset links. - License keys are random identifiers tied to hospital subscriptions and reseller records.