Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/FerchoSG/healthcare-web/llms.txt

Use this file to discover all available pages before exploring further.

CitaBox uses a role-based access model to control what each user can see and do after logging in. Every user belongs to one or more clinics, and their role within each clinic determines their default landing view, the navigation items available in the sidebar, and the actions they can perform. Roles are assigned at the clinic membership level, so the same person can be an administrator at one clinic and a receptionist at another.

Role mapping

When a user authenticates, CitaBox reads the role field from their active clinic membership and maps it to one of three internal roles:
RoleAPI value(s)Default viewKey capabilities
AdminSUPER_ADMIN, ADMINDashboardKPI monitoring, revenue analytics, patient management, clinic settings
ReceptionistSTAFFFront deskAppointment queue, walk-in registration, payment checkout
DoctorDOCTORSchedulePersonal agenda, consultation workflow, EMR documentation
The mapping is defined in lib/store.ts:
export const AUTH_ROLE_TO_ROLE: Record<string, Role> = {
  SUPER_ADMIN: "admin",
  ADMIN: "admin",
  STAFF: "receptionist",
  DOCTOR: "doctor",
}

Default views on login

After a successful login, CitaBox redirects each role to its default view automatically. Users cannot change this initial redirect — it is determined by the role on the active membership at the time of login.
const defaultViewPerRole: Record<Role, View> = {
  admin: "dashboard",
  receptionist: "front-desk",
  doctor: "schedule",
}

Multi-clinic membership

A single user account can hold memberships in multiple clinics, each with an independent role. The active clinic context is stored in the browser and can be changed at any time from the clinic switcher in the top header. Switching clinics triggers a fresh /me request, which re-evaluates the user’s role for that clinic and redirects them to the appropriate default view.
When a user has memberships in multiple clinics, their permissions — including the views available in the sidebar — reflect only the role in the currently active clinic.
The sidebar shows only the views relevant to each role. There is no way for a receptionist or doctor to access the settings or billing views by navigating through the sidebar.
ViewAdminReceptionistDoctor
Dashboard
Calendar
Patients
Settings
Front desk
Schedule

Role pages

Administrator

KPI dashboard, revenue analytics, patient records, and clinic configuration.

Receptionist

Front-desk queue management, walk-in registration, and appointment scheduling.

Doctor

Personal schedule, consultation workflow, and electronic medical records.

Build docs developers (and LLMs) love