How kanishkasahal24/lablens works
LabLens is a patient-and-doctor app for recording blood-test results, tracking health trends, and sharing reports with linked clinicians. Patients register, complete a profile, enter reports, and review analysis; doctors manage patient links and review linked patients’ reports. The client routes users to these workflows and sends requests through a shared API client; the server routes requests to controllers, which use models and report-analysis utilities. The README is empty, so feature coverage is inferred from the source tree and indexed modules; unsampled page behavior and database wiring are not asserted beyond visible references.
Main entry points: App.jsx App routes · reportController.js Report operations · server.js Express API · linkController.js Doctor-patient links
Components 34
Client app
- App routes
client/src/App.jsx - Auth state
client/src/context/AuthContext.jsx - Auth hook
client/src/hooks/useAuth.js - API client
client/src/api/axios.js - Profile onboarding
client/src/pages/OnboardingPage.jsx - Profile management
client/src/pages/ProfilePage.jsx - Patient dashboard
client/src/pages/DashboardPage.jsx - Report entry
client/src/pages/AddReportPage.jsx - Report analysis view
client/src/pages/ReportDetailPage.jsx - Trend view
client/src/pages/TrendsPage.jsx - Doctor dashboard
client/src/pages/DoctorDashboardPage.jsx - Link requests
client/src/pages/DoctorRequestsPage.jsx - Patient detail
client/src/pages/DoctorPatientDetailPage.jsx
Identity and care links
- Auth routes
server/routes/auth.js - Authentication
server/controllers/authController.js - Link routes
server/routes/links.js - Doctor-patient links
server/controllers/linkController.js - JWT and role checks
server/middleware/authMiddleware.js - User records
server/models/User.js - Doctor profile
server/models/DoctorProfile.js - Patient profile
server/models/PatientProfile.js - Care links
server/models/Link.js - Profile routes
server/routes/profile.js - Profile operations
server/controllers/profileController.js - Doctor routes
server/routes/doctors.js
Reports and insights
- Report routes
server/routes/reports.js - Report operations
server/controllers/reportController.js - Report records
server/models/Report.js - Parameter references
server/models/ParameterReference.js - Parameter status rules
server/utils/parameterStatus.js - Health analysis
server/utils/analysisEngine.js - Report access control
server/utils/accessControl.js
API runtime
- Express API
server/server.js
Other components
- Patient or doctor
Connections 48
- Patient or doctor → App routes: uses
client/src/App.jsx - App routes → Auth state: provides auth
client/src/App.jsx - App routes → Profile onboarding: routes to
client/src/App.jsx - App routes → Profile management: routes to
client/src/App.jsx - App routes → Patient dashboard: routes to
client/src/App.jsx - App routes → Report entry: routes to
client/src/App.jsx - App routes → Report analysis view: routes to
client/src/App.jsx - App routes → Trend view: routes to
client/src/App.jsx - App routes → Doctor dashboard: routes to
client/src/App.jsx - App routes → Link requests: routes to
client/src/App.jsx - App routes → Patient detail: routes to
client/src/App.jsx - Auth hook → Auth state: reads context
client/src/hooks/useAuth.js - Auth state → API client: requests
client/src/context/AuthContext.jsx - Profile onboarding → API client: requests
client/src/pages/OnboardingPage.jsx - Profile management → API client: requests
client/src/pages/ProfilePage.jsx - Report entry → API client: requests
client/src/pages/AddReportPage.jsx - Report analysis view → API client: requests
client/src/pages/ReportDetailPage.jsx - Express API → Auth routes: mounts
server/server.js - Express API → Report routes: mounts
server/server.js - Express API → Profile routes: mounts
server/server.js - Express API → Doctor routes: mounts
server/server.js - Express API → Link routes: mounts
server/server.js - Auth routes → Authentication: dispatches
server/routes/auth.js - Auth routes → JWT and role checks: uses
server/routes/auth.js - Link routes → Doctor-patient links: dispatches
server/routes/links.js - Link routes → JWT and role checks: uses
server/routes/links.js - Report routes → Report operations: dispatches
server/routes/reports.js - Report routes → JWT and role checks: uses
server/routes/reports.js - Profile routes → Profile operations: dispatches
server/routes/profile.js - Profile routes → JWT and role checks: uses
server/routes/profile.js - Doctor routes → JWT and role checks: uses
server/routes/doctors.js - Authentication → User records: reads/writes
server/controllers/authController.js - Authentication → Doctor profile: reads/writes
server/controllers/authController.js - Doctor-patient links → User records: reads
server/controllers/linkController.js - Doctor-patient links → Doctor profile: reads
server/controllers/linkController.js - Doctor-patient links → Patient profile: reads
server/controllers/linkController.js - Doctor-patient links → Care links: reads/writes
server/controllers/linkController.js - Profile operations → User records: reads/writes
server/controllers/profileController.js - Profile operations → Patient profile: reads/writes
server/controllers/profileController.js - Profile operations → Doctor profile: reads/writes
server/controllers/profileController.js - Report operations → Report records: reads/writes
server/controllers/reportController.js - Report operations → Care links: checks links
server/controllers/reportController.js - Report operations → Patient profile: reads
server/controllers/reportController.js - Report operations → Parameter references: reads
server/controllers/reportController.js - Report operations → Parameter status rules: calculates status
server/controllers/reportController.js - Report operations → Health analysis: builds analysis
server/controllers/reportController.js - Report operations → Report access control: checks access
server/controllers/reportController.js - Report access control → Care links: checks links
server/utils/accessControl.js