How dheer2005/smarthealthcare works
Project type and purpose
• This is a single‐page application (SPA) front-end built with Angular (version 18), called “SmartHealthCare.”
• It implements a healthcare portal with distinct user roles (Admin, Doctor, Patient), authentication, messaging (chat), appointment management, prescriptions, and lab results views.
File structure
• Top-level artifacts:
• angular.json, package.json, tsconfig*.json → Angular CLI configuration
• /public or /src/index.html → host page for the SPA
• Feature modules under src:
• Authentication (login/register)
• Admin (dashboard, manage doctors, manage patients)
• Doctor (dashboard, messages, prescriptions, appointments)
• Patient (appointments, lab results, history, messages, prescriptions)
• Shared cross-cutting pieces:
• /Service → injectable services (authentication.service, doctor.service, patient.service, chat.service)
• /Guards → AuthGuard protecting routes
• /Models → TypeScript interfaces and enums
• Routing is configured in src/app/app.routes.ts, and bootstrapping in src/main.ts.
README for additional insights
• Confirms this is purely a front-end Angular project.
• Standard build/test/run commands.
• No back-end code in this repo, so it must rely on external REST/WS services.
Main components
a. Client (Web Browser)
b. Angular SPA
– App Module & Router
– Feature Modules (Authentication, Admin, Doctor, Patient)
– Components within each module
– Shared Models
– Guards (AuthGuard)
– Services (AuthService, DoctorService, PatientService, ChatService)
c. External Services
– REST API server (endpoints: /auth, /admin, /doctor, /patient, /appointments, /prescriptions, /lab-results)
– WebSocket (for real-time chat)
d. Persistence Layer (Database) – behind the REST API
Relationships and data flow
• User interacts with Browser → loads Angular SPA.
• The Router directs to a feature module (e.g., Patient).
• Components call a Service (e.g., patient.service) → issues HTTP request to REST API.
• ChatService opens a WebSocket connection to a chat server.
• REST API reads/writes to the Database.
• AuthGuard intercepts route activation, calls AuthService → validates JWT via /auth endpoint.
Important architectural patterns
• Modular, component-based front-end
• Separation of concerns: UI components vs. data services vs. routing vs. models
• SPA with client-side routing
• Guard pattern for route protection
• API-first back-end communication (REST + WebSocket)