How samichen99/hps-hospital-management-system works
HAP is a hospital operations portal for staff to manage users, patients, doctors, appointments, medical records, files, invoices, and payments. Users sign in, then work through protected dashboard pages; those pages call the Go API through a shared Axios client. The README describes JWT authentication, role-based access, PostgreSQL, and Kafka. Frontend routing and several page-to-API calls are shown in the excerpts; backend internals were not excerpted, so their links are omitted or marked unverified rather than inferred.
Main entry points: apiClient.js HTTP API client · App.jsx Route application · router.go Go HTTP API · AuthContext.jsx Login and session
Components 24
Web application
- Route application
frontend/src/App.jsx - Login and session
frontend/src/context/AuthContext.jsx - Login page
frontend/src/pages/Login.jsx - Protected routes
frontend/src/components/ProtectedRoute.jsx - Portal layout
frontend/src/layouts/MainLayout.jsx - Hospital dashboard
frontend/src/pages/Dashboard.jsx - User administration
frontend/src/pages/Users.jsx - Patient management
frontend/src/pages/Patients.jsx - Doctor management
frontend/src/pages/Doctors.jsx - Appointment scheduling
frontend/src/pages/Appointments.jsx - Medical records
frontend/src/pages/Medical_records.jsx - Clinical files
frontend/src/pages/Files.jsx - Invoice management
frontend/src/pages/Invoices.jsx - Payment tracking
frontend/src/pages/payments.jsx - HTTP API client
frontend/src/services/apiClient.js
Go backend
- Go HTTP API
backend/api/router.go - Server startup
backend/cmd/server/main.go - Authentication and access
backend/handlers/auth_handler.go - Hospital domain handlers
backend/handlers - Data repositories
backend/repositories - Domain models
backend/models
Data services
- PostgreSQL
- Kafka
Other components
- Hospital user
Connections 27
- Hospital user → Route application: opens portal
- Route application → Login and session: provides session
frontend/src/App.jsx - Route application → Login page: routes to
frontend/src/App.jsx - Route application → Protected routes: protects routes
frontend/src/App.jsx - Protected routes → Login and session: checks session
frontend/src/components/ProtectedRoute.jsx - Route application → Portal layout: wraps pages
frontend/src/App.jsx - Portal layout → Hospital dashboard: renders route
frontend/src/App.jsx - Login page → Login and session: submits credentials
frontend/src/pages/Login.jsx - Login and session → HTTP API client: posts login
frontend/src/context/AuthContext.jsx - Hospital dashboard → Login and session: reads session
frontend/src/pages/Dashboard.jsx - User administration → HTTP API client: requests data
frontend/src/pages/Users.jsx - Patient management → HTTP API client: requests data
frontend/src/pages/Patients.jsx - Doctor management → HTTP API client: requests data
frontend/src/pages/Doctors.jsx - Appointment scheduling → HTTP API client: manages appointments
frontend/src/pages/Appointments.jsx - Medical records → HTTP API client: requests data
frontend/src/pages/Medical_records.jsx - Clinical files → HTTP API client: manages files
frontend/src/pages/Files.jsx - Invoice management → HTTP API client: manages invoices
frontend/src/pages/Invoices.jsx - Invoice management → HTTP API client: loads patients and appointments
frontend/src/pages/Invoices.jsx - Payment tracking → HTTP API client: requests data
frontend/src/pages/payments.jsx - HTTP API client → Go HTTP API: sends HTTP requests
- Server startup → Go HTTP API: starts API
- Go HTTP API → Authentication and access: routes authentication
- Go HTTP API → Hospital domain handlers: routes domain requests
- Hospital domain handlers → Data repositories: uses data access
- Data repositories → PostgreSQL: persists records
- Hospital domain handlers → Domain models: handles domain data
- Go HTTP API → Kafka: may publish events