How johannpdaniel/erp works
This is a multi-tenant clinic-management SaaS with staff workflows, patient self-service, and platform administration. The principal user journey is staff sign-in, then managing clinical and operational work—patients, appointments, records, and payments—through authenticated screens and API routes backed by a shared database. Patient-facing portal and public signup/survey journeys are distinct branches. The tree shows broad capabilities, but most route-to-service wiring was not sampled; edges below are limited to relationships visible in the source index or excerpts.
Main entry points: api HTTP API · quality/page.tsx Quality and surveys · login/page.tsx Staff sign-in · auth.ts Authentication
Components 22
Access and portals
- Staff sign-in
app/login/page.tsx - Authentication
lib/auth.ts - Patient portal
components/portal-dashboard.tsx - Organization signup
app/signup/page.tsx - Patient surveys
components/survey-form.tsx
Clinic operations
- Patient records
app/(authenticated)/patients/page.tsx - Appointments
app/api/appointments/route.ts - Medical records
app/api/medical-records/route.ts - Telemedicine
app/api/telemedicine/appointments/route.ts - Waiting queue
app/api/waiting-queue/route.ts - Inventory
app/api/inventory/route.ts - Quality and surveys
app/(authenticated)/quality/page.tsx
Business operations
- Financial operations
app/(authenticated)/financial/page.tsx - Patient payments
app/api/patient-payments/route.ts - Campaigns
app/(authenticated)/marketing/page.tsx - Reports and analytics
app/api/reports/advanced/route.ts
Platform services
- Platform administration
app/(authenticated)/admin/page.tsx - HTTP API
app/api - Application database
lib/db.ts - Domain validation
lib/validations.ts - Browser API client
lib/axios.ts
Other components
- Clinic staff
Connections 14
- Clinic staff → Staff sign-in: signs in
- Staff sign-in → Authentication: configures auth
app/login/page.tsx - Clinic staff → Patient portal: uses portal
- Clinic staff → Patient records: manages patients
- Clinic staff → Appointments: schedules visits
- Clinic staff → Medical records: records care
- Clinic staff → Financial operations: reviews finances
- Patient portal → HTTP API: uses endpoints
- Organization signup → Browser API client: imports client
app/signup/page.tsx - Quality and surveys → Browser API client: imports client
app/(authenticated)/quality/page.tsx - Quality and surveys → Patient surveys: uses survey form
app/(authenticated)/quality/page.tsx - HTTP API → Application database: accesses records
app/api/payment-gateway-config/route.ts - HTTP API → Domain validation: validates input
app/api/subscription/route.ts - Authentication → Application database: queries users
lib/auth.ts