How uibreaker/hospital-report-system works
This is a hospital-wide shift-reporting system: department staff submit specialty reports and clinical cases, administrators monitor submissions and locks, then present and export a consolidated view. The graph follows the documented flow and the source-visible API/controller relationships; several UI and service details are documented but unsampled, so those links are omitted rather than inferred. Storage is MySQL; Cloudinary image upload and the broader export/print capabilities are documented in the README.
Main entry points: adminRoutes.js Admin routes · app.js Express API · db.js MySQL database · App.jsx Application routes
Components 30
Staff and Admin UI
- Application routes
client/src/App.jsx - Session context
client/src/contexts/AuthContext.jsx - Login and registration
client/src/pages/LoginPage.jsx - Shift report entry
client/src/pages/ReportPage.jsx - Clinical case forms
client/src/components/forms - Dynamic forms
client/src/components/admin/custom-forms/DynamicFormRenderer.jsx - Administration
client/src/pages/AdminDashboard.jsx - Form management
client/src/components/admin/custom-forms/CustomFormBuilder.jsx
Reporting and Presentation
- Presentation engine
client/src/pages/PresentationPage.jsx - Excel and PDF export
client/src/services/excelExportService.js
API and Access
- HTTP client
client/src/services/api.js - Authentication service
client/src/services/authService.js - Express API
server/src/app.js - Authentication routes
server/src/routes/authRoutes.js - Report routes
server/src/routes/reportRoutes.js - Admin routes
server/src/routes/adminRoutes.js - Custom form routes
server/src/routes/customFormRoutes.js - JWT authorization
server/src/middleware/auth.js
Data Domains
- Report operations
server/src/controllers/reportController.js - Status and locks
server/src/controllers/adminController.js - Form submissions
server/src/controllers/customFormController.js - Account administration
server/src/controllers/userManageController.js - Hospital analytics
server/src/controllers/analyticsController.js - Submission history
server/src/controllers/submissionHistoryController.js - Data archive
server/src/controllers/dataArchiveController.js - Staff directory
server/src/controllers/staffController.js - MySQL database
server/src/config/db.js
Other components
- Department staff
- Hospital admin
- Cloudinary CDN
Connections 38
- Department staff → Application routes: uses
- Hospital admin → Application routes: uses
- Application routes → Session context: provides session
client/src/App.jsx - Application routes → Login and registration: routes
client/src/App.jsx - Application routes → Shift report entry: routes
client/src/App.jsx - Application routes → Administration: protects route
client/src/App.jsx - Session context → Authentication service: calls
client/src/contexts/AuthContext.jsx - Authentication service → HTTP client: sends requests
client/src/services/authService.js - Shift report entry → Clinical case forms: collects cases
- Dynamic forms → HTTP client: submits forms
- Administration → Form management: manages forms
- Presentation engine → Excel and PDF export: exports reports
- HTTP client → Express API: HTTP requests
- Express API → Authentication routes: mounts
server/src/app.js - Express API → Report routes: mounts
server/src/app.js - Express API → Admin routes: mounts
server/src/app.js - Express API → Custom form routes: mounts
server/src/app.js - Authentication routes → JWT authorization: guards
server/src/routes/authRoutes.js - Report routes → JWT authorization: guards
server/src/routes/reportRoutes.js - Admin routes → JWT authorization: guards
server/src/routes/adminRoutes.js - Custom form routes → JWT authorization: guards
server/src/routes/customFormRoutes.js - Report routes → Report operations: dispatches
server/src/routes/reportRoutes.js - Admin routes → Status and locks: dispatches
server/src/routes/adminRoutes.js - Admin routes → Account administration: dispatches
server/src/routes/adminRoutes.js - Admin routes → Hospital analytics: dispatches
server/src/routes/adminRoutes.js - Admin routes → Submission history: dispatches
server/src/routes/adminRoutes.js - Admin routes → Data archive: dispatches
server/src/routes/adminRoutes.js - Custom form routes → Form submissions: dispatches
server/src/routes/customFormRoutes.js - Express API → Staff directory: routes staff lookup
server/src/app.js - Report operations → MySQL database: reads and writes
server/src/controllers/reportController.js - Status and locks → MySQL database: reads and writes
server/src/controllers/adminController.js - Form submissions → MySQL database: reads and writes
server/src/controllers/customFormController.js - Account administration → MySQL database: reads and writes
server/src/controllers/userManageController.js - Submission history → MySQL database: queries
server/src/controllers/submissionHistoryController.js - Data archive → MySQL database: queries
server/src/controllers/dataArchiveController.js - Staff directory → MySQL database: queries
server/src/controllers/staffController.js - Status and locks → Excel and PDF export: exports reports
- Shift report entry → Cloudinary CDN: uploads images