How lohithpesala-08-05/health-hub-project works
Health Hub combines a React wellness portal with an Express API. Users register or log in, then access BMI, hydration, sleep, habit tracking, and guidance; they can book appointments or send contact messages, while doctors can view bookings. The API routes these requests to authentication, appointment, and contact controllers, which use MongoDB models or the local JSON-backed store. The README also lists legacy server-rendered pages. The sampled excerpts support the main client/API and persistence links; unsampled model details and legacy rendering are represented conservatively.
Main entry points: App.jsx React app · authController.js Authentication · apiRoutes.js API routes · dataStore.js Local JSON store
Components 23
Wellness portal
- React app
client/src/App.jsx - API client
client/src/api.js - Wellness tools
client/src/App.jsx - Wellness guidance
client/src/App.jsx - Account forms
client/src/App.jsx - Doctor bookings view
client/src/App.jsx
API and access
- Express app
server/src/app.js - API routes
server/src/routes/apiRoutes.js - Legacy web routes
server/src/routes/webRoutes.js - Legacy page rendering
server/src/controllers/pageController.js - View registry
server/src/config/viewRegistry.js
Health services
- Authentication
server/src/controllers/authController.js - Appointment handling
server/src/controllers/appointmentController.js - Contact handling
server/src/controllers/contactController.js - Password hashing
server/src/utils/hash.js
Persistence
- Appointment records
server/src/models/Appointment.js - User records
server/src/models/User.js - Doctor records
server/src/models/Doctor.js - Contact records
server/src/models/Contact.js - Local JSON store
server/src/services/dataStore.js - MongoDB connection
server/src/config/database.js
Other components
- Visitor
- Doctor
Connections 24
- Visitor → React app: uses
README.md - Doctor → React app: views bookings
README.md - React app → API client: calls
client/src/App.jsx - React app → Wellness tools: renders
client/src/App.jsx - React app → Wellness guidance: renders
client/src/App.jsx - React app → Account forms: renders
client/src/App.jsx - React app → Doctor bookings view: renders
client/src/App.jsx - API client → Express app: requests API
README.md - Express app → API routes: mounts
server/src/app.js - API routes → Authentication: routes auth
server/src/routes/apiRoutes.js - API routes → Appointment handling: routes bookings
server/src/routes/apiRoutes.js - API routes → Contact handling: routes messages
server/src/routes/apiRoutes.js - Authentication → Local JSON store: reads/writes
server/src/controllers/authController.js - Authentication → User records: queries
server/src/controllers/authController.js - Authentication → Doctor records: queries
server/src/controllers/authController.js - Authentication → Password hashing: verifies passwords
server/src/controllers/authController.js - Appointment handling → Local JSON store: reads/writes
server/src/controllers/appointmentController.js - Appointment handling → Appointment records: queries
server/src/controllers/appointmentController.js - Contact handling → Local JSON store: writes
server/src/controllers/contactController.js - Contact handling → Contact records: creates records
server/src/controllers/contactController.js - Express app → MongoDB connection: connects
server/src/app.js - MongoDB connection → Local JSON store: sets connection state
server/src/config/database.js - Legacy web routes → Legacy page rendering: routes pages
server/src/routes/webRoutes.js - Legacy page rendering → View registry: looks up views
server/src/controllers/pageController.js