Skip to main content

Architecture

Layout

The Admin Portal uses Medplum's built-in AppShell component, which provides the full layout including the top header, left sidebar navigation, and main content area. This is different from the Member Portal which uses a custom Mantine AppShell.

┌─────────────────────────────────────────────┐
│ Header (logo + user menu) │
├──────────────┬──────────────────────────────┤
│ │ │
│ Sidebar │ Main Content │
│ Navigation │ (AppRoutes renders │
│ │ the active page) │
│ │ │
└──────────────┴──────────────────────────────┘

Authentication

App.tsx uses useMedplum() to check login state:

  • medplum.isLoading() → shows a loading spinner while the session is checked.
  • Once loaded, the AppShell itself handles redirecting unauthenticated users to /signin.

Public routes (no login required):

  • /signin
  • /register
  • /resetpassword
  • /setpassword/:id/:secret
  • /verifyemail/:id/:secret
  • /oauth

The sidebar navigation is assembled in App.tsx inside the userConfigToMenu() function. It combines two sources:

  1. User configuration — shortcuts loaded from the logged-in user's UserConfiguration FHIR resource (e.g., quick links to Patient, Practitioner, etc.)
  2. Hardcoded menu groups — fixed sections for Reports, Support, Integrations, and Settings
GroupLinks
(User shortcuts)Patient, Practitioner, Organization, etc.
PatientsInvite Patient
ReportsPatient Engagement, AI Chat Analytics, EHR Integration Health
SupportSupport Tickets
IntegrationsHospital Integrations, SSO Integrations, SSO Configuration
(Admin groups)Project, Users, Bots, Clients, Secrets, Sites (from UserConfiguration)
SettingsAudit Log, Security

Generic FHIR Resource Browser

A large portion of the Admin Portal is a generic FHIR resource browser — any FHIR resource type can be viewed, created, edited, and deleted through a standard set of pages:

Path patternWhat it does
/:resourceTypeList all resources of that type
/:resourceType/newCreate a new resource
/:resourceType/:idView resource timeline
/:resourceType/:id/detailsView resource fields
/:resourceType/:id/editEdit the resource
/:resourceType/:id/jsonView/edit raw JSON
/:resourceType/:id/historyView version history
/:resourceType/:id/deleteDelete the resource

This is inherited from Medplum's open-source admin app and works for any FHIR resource type (Patient, Observation, Condition, etc.).