How xenocore-wirachain/wirachain-frontend works
This is a role-based clinic and medical-consultation management frontend. Users authenticate, enter a role-specific dashboard, and work with clinic, doctor, patient, appointment, and administration features through a shared Redux/RTK Query layer. The tree and sampled files support the routing, auth state, shared API setup, and several feature areas; most feature-page and endpoint implementations were not sampled, so their internal call paths are not asserted.
Main entry points: routers/index.tsx Role router · CustomBaseQuery.tsx Authenticated API transport · redux/index.tsx Redux store · main.tsx React app mount
Components 17
Application entry
- React app mount
src/main.tsx
Identity and routing
- Role router
src/routers/index.tsx - Sign in and register
src/features/auth/pages - Auth selector
src/features/auth/hooks/UseAuth.tsx - Token storage
src/features/auth/utils/TokenManager.tsx
Role-based workflows
- Dashboard shell
src/layouts/BodyDashboard.tsx - Platform administration
src/features/admin - Clinic management
src/features/clinic - Doctor workflow
src/features/doctor - Patient workflow
src/features/patient
Shared state and APIs
- Auth state
src/redux/slices/AuthSlice.tsx - Consultation data
src/redux/api/MedicalConsultationAPI.tsx - RTK Query APIs
src/redux/api - Redux store
src/redux/index.tsx - Authenticated API transport
src/redux/api/CustomBaseQuery.tsx
Other components
- User
- Backend API
Connections 19
- User → React app mount: uses
- React app mount → Redux store: provides state
src/main.tsx - React app mount → Role router: mounts routes
src/main.tsx - Role router → Sign in and register: routes to
src/routers/index.tsx - Role router → Dashboard shell: renders dashboard
src/routers/index.tsx - Role router → Platform administration: routes by role
src/routers/index.tsx - Role router → Clinic management: routes by role
src/routers/index.tsx - Role router → Doctor workflow: routes by role
src/routers/index.tsx - Role router → Patient workflow: routes by role
src/routers/index.tsx - Role router → Auth selector: checks identity
src/routers/index.tsx - Auth selector → Redux store: selects state
src/features/auth/hooks/UseAuth.tsx - Auth state → Token storage: persists tokens
src/redux/slices/AuthSlice.tsx - Redux store → Auth state: registers reducer
src/redux/index.tsx - Redux store → RTK Query APIs: registers APIs
src/redux/index.tsx - RTK Query APIs → Authenticated API transport: uses transport
src/redux/api/AuthAPI.tsx - Authenticated API transport → Token storage: reads credentials
src/redux/api/CustomBaseQuery.tsx - Authenticated API transport → Auth state: refreshes or logs out
src/redux/api/CustomBaseQuery.tsx - Authenticated API transport → Backend API: sends requests
src/redux/api/CustomBaseQuery.tsx - RTK Query APIs → Consultation data: registers endpoint
src/redux/index.tsx