# nayshasingh/caresync architecture

> Architecture diagram of the GitHub repository nayshasingh/caresync, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nayshasingh/caresync
- Repository: https://github.com/nayshasingh/caresync

## Overview

CareSync is a healthcare scheduling platform: patients and doctors use an Angular client or API to manage accounts, doctor availability, appointments, and consultation records. The backend applies business rules, persists data, and supports audit trails, reporting, and email reminders. The README documents the layered backend and major capabilities; sampled source confirms appointment/availability service behavior and notification calls. Most frontend feature implementations and several backend subsystems were not sampled, so those links are limited to documented relationships.

Main entry points: [`backend/src/main/java/com/cts/healthcare_appointment_system/repositories`](https://github.com/nayshasingh/caresync/tree/main/backend/src/main/java/com/cts/healthcare_appointment_system/repositories) (JPA repositories), [`backend/src/main/java/com/cts/healthcare_appointment_system/services/AppointmentService.java`](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/AppointmentService.java) (Appointment rules), [`backend/src/main/java/com/cts/healthcare_appointment_system/services/AvailabilityService.java`](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/AvailabilityService.java) (Availability rules), [`backend/src/main/java/com/cts/healthcare_appointment_system/controllers/UserController.java`](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/controllers/UserController.java) (User endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
  node_angular["Angular application<br/>[app.component.ts]"]
  node_routes["Page routing<br/>[app.routes.ts]"]
  node_authui["Login and registration<br/>[login.component.ts]"]
  node_clientauth["Auth API client<br/>[authapi.service.ts]"]
  node_bookingui["Appointment screens"]
  node_availabilityui["Availability screens"]
  node_consultationui["Consultation screens"]
end

subgraph group_api["Backend API"]
  node_userapi["User endpoints"]
  node_appointmentapi["Appointment endpoints"]
  node_availabilityapi["Availability endpoints"]
  node_consultationapi["Consultation endpoints"]
end

subgraph group_scheduling["Scheduling"]
  node_appointments["Appointment rules"]
  node_availability["Availability rules"]
end

subgraph group_care["Care operations"]
  node_consultations["Consultation records"]
  node_users["User management<br/>[UserService.java]"]
  node_audit["Audit logging"]
  node_reports["Summary reporting<br/>[ReportService.java]"]
  node_notifications["Email notifications"]
  node_email["Email delivery<br/>[EmailService.java]"]
  node_cron["Reminder jobs"]
end

subgraph group_platform["Security and persistence"]
  node_security["JWT and access control"]
  node_data["Domain entities"]
  node_repositories["JPA repositories"]
end

node_people(("Patients and doctors"))
node_mysql[("MySQL database")]
node_mail["Mail service"]

node_people -->|"use"| node_angular
node_angular -->|"routes through"| node_routes
node_routes -->|"routes to"| node_authui
node_routes -->|"routes to"| node_availabilityui
node_people -->|"request scheduling"| node_appointmentapi
node_people -->|"manage slots"| node_availabilityapi
node_people -->|"manage records"| node_consultationapi
node_people -->|"manage accounts"| node_userapi
node_authui -.->|"authenticates via"| node_clientauth
node_clientauth -->|"calls user API"| node_userapi
node_bookingui -.->|"calls appointments"| node_appointmentapi
node_availabilityui -.->|"calls availability"| node_availabilityapi
node_consultationui -.->|"calls consultations"| node_consultationapi
node_appointmentapi -->|"delegates to"| node_appointments
node_availabilityapi -->|"delegates to"| node_availability
node_appointments -->|"checks slots"| node_availability
node_appointments -->|"sends updates"| node_notifications
node_appointments -->|"records actions"| node_audit
node_availability -->|"sends updates"| node_notifications
node_consultationapi -->|"delegates to"| node_consultations
node_userapi -->|"delegates to"| node_users
node_users -->|"records actions"| node_audit
node_appointments -.->|"persists through"| node_repositories
node_availability -.->|"persists through"| node_repositories
node_users -.->|"persists through"| node_repositories
node_consultations -.->|"persists through"| node_repositories
node_repositories -->|"maps entities"| node_data
node_data -->|"stored in"| node_mysql
node_notifications -->|"delegates delivery"| node_email
node_email -.->|"sends email"| node_mail
node_cron -.->|"triggers reminders"| node_notifications
node_reports -.->|"reads counts"| node_repositories
node_security -->|"protects endpoints"| node_userapi

click node_angular "https://github.com/nayshasingh/caresync/blob/main/frontend/healthcare_app/src/app/app.component.ts"
click node_routes "https://github.com/nayshasingh/caresync/blob/main/frontend/healthcare_app/src/app/app.routes.ts"
click node_authui "https://github.com/nayshasingh/caresync/blob/main/frontend/healthcare_app/src/app/auth/login/login.component.ts"
click node_clientauth "https://github.com/nayshasingh/caresync/blob/main/frontend/healthcare_app/src/services/authapi.service.ts"
click node_bookingui "https://github.com/nayshasingh/caresync/blob/main/frontend/healthcare_app/src/app/appointment/appointment.component.ts"
click node_availabilityui "https://github.com/nayshasingh/caresync/blob/main/frontend/healthcare_app/src/app/availabilities/availabilities.component.ts"
click node_consultationui "https://github.com/nayshasingh/caresync/blob/main/frontend/healthcare_app/src/app/consultation/consultation.component.ts"
click node_userapi "https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/controllers/UserController.java"
click node_appointmentapi "https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/controllers/AppointmentController.java"
click node_availabilityapi "https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/controllers/AvailabilityController.java"
click node_consultationapi "https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/controllers/ConsultationController.java"
click node_appointments "https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/AppointmentService.java"
click node_availability "https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/AvailabilityService.java"
click node_consultations "https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/ConsultationService.java"
click node_users "https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/UserService.java"
click node_audit "https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/AuditLogService.java"
click node_reports "https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/ReportService.java"
click node_notifications "https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/NotificationService.java"
click node_email "https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/EmailService.java"
click node_cron "https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/CronJobsService.java"
click node_security "https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/security/SecurityConfig.java"
click node_data "https://github.com/nayshasingh/caresync/tree/main/backend/src/main/java/com/cts/healthcare_appointment_system/models"
click node_repositories "https://github.com/nayshasingh/caresync/tree/main/backend/src/main/java/com/cts/healthcare_appointment_system/repositories"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_angular,node_routes,node_authui,node_clientauth,node_bookingui,node_availabilityui,node_consultationui toneBlue
class node_userapi,node_appointmentapi,node_availabilityapi,node_consultationapi,node_mysql toneAmber
class node_appointments,node_availability toneMint
class node_consultations,node_users,node_audit,node_reports,node_notifications,node_email,node_cron toneRose
class node_security,node_data,node_repositories,node_people,node_mail toneIndigo
```

## Components

### Angular client

- [Angular application](https://github.com/nayshasingh/caresync/blob/main/frontend/healthcare_app/src/app/app.component.ts): `frontend/healthcare_app/src/app/app.component.ts`
- [Page routing](https://github.com/nayshasingh/caresync/blob/main/frontend/healthcare_app/src/app/app.routes.ts): `frontend/healthcare_app/src/app/app.routes.ts`
- [Login and registration](https://github.com/nayshasingh/caresync/blob/main/frontend/healthcare_app/src/app/auth/login/login.component.ts): `frontend/healthcare_app/src/app/auth/login/login.component.ts`
- [Auth API client](https://github.com/nayshasingh/caresync/blob/main/frontend/healthcare_app/src/services/authapi.service.ts): `frontend/healthcare_app/src/services/authapi.service.ts`
- [Appointment screens](https://github.com/nayshasingh/caresync/blob/main/frontend/healthcare_app/src/app/appointment/appointment.component.ts): `frontend/healthcare_app/src/app/appointment/appointment.component.ts`
- [Availability screens](https://github.com/nayshasingh/caresync/blob/main/frontend/healthcare_app/src/app/availabilities/availabilities.component.ts): `frontend/healthcare_app/src/app/availabilities/availabilities.component.ts`
- [Consultation screens](https://github.com/nayshasingh/caresync/blob/main/frontend/healthcare_app/src/app/consultation/consultation.component.ts): `frontend/healthcare_app/src/app/consultation/consultation.component.ts`

### Backend API

- [User endpoints](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/controllers/UserController.java): `backend/src/main/java/com/cts/healthcare_appointment_system/controllers/UserController.java`
- [Appointment endpoints](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/controllers/AppointmentController.java): `backend/src/main/java/com/cts/healthcare_appointment_system/controllers/AppointmentController.java`
- [Availability endpoints](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/controllers/AvailabilityController.java): `backend/src/main/java/com/cts/healthcare_appointment_system/controllers/AvailabilityController.java`
- [Consultation endpoints](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/controllers/ConsultationController.java): `backend/src/main/java/com/cts/healthcare_appointment_system/controllers/ConsultationController.java`

### Scheduling

- [Appointment rules](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/AppointmentService.java): `backend/src/main/java/com/cts/healthcare_appointment_system/services/AppointmentService.java`
- [Availability rules](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/AvailabilityService.java): `backend/src/main/java/com/cts/healthcare_appointment_system/services/AvailabilityService.java`

### Care operations

- [Consultation records](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/ConsultationService.java): `backend/src/main/java/com/cts/healthcare_appointment_system/services/ConsultationService.java`
- [User management](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/UserService.java): `backend/src/main/java/com/cts/healthcare_appointment_system/services/UserService.java`
- [Audit logging](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/AuditLogService.java): `backend/src/main/java/com/cts/healthcare_appointment_system/services/AuditLogService.java`
- [Summary reporting](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/ReportService.java): `backend/src/main/java/com/cts/healthcare_appointment_system/services/ReportService.java`
- [Email notifications](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/NotificationService.java): `backend/src/main/java/com/cts/healthcare_appointment_system/services/NotificationService.java`
- [Email delivery](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/EmailService.java): `backend/src/main/java/com/cts/healthcare_appointment_system/services/EmailService.java`
- [Reminder jobs](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/services/CronJobsService.java): `backend/src/main/java/com/cts/healthcare_appointment_system/services/CronJobsService.java`

### Security and persistence

- [JWT and access control](https://github.com/nayshasingh/caresync/blob/main/backend/src/main/java/com/cts/healthcare_appointment_system/security/SecurityConfig.java): `backend/src/main/java/com/cts/healthcare_appointment_system/security/SecurityConfig.java`
- [Domain entities](https://github.com/nayshasingh/caresync/tree/main/backend/src/main/java/com/cts/healthcare_appointment_system/models): `backend/src/main/java/com/cts/healthcare_appointment_system/models`
- [JPA repositories](https://github.com/nayshasingh/caresync/tree/main/backend/src/main/java/com/cts/healthcare_appointment_system/repositories): `backend/src/main/java/com/cts/healthcare_appointment_system/repositories`

### Other components

- **Patients and doctors**
- **MySQL database**
- **Mail service**

## Connections

- Patients and doctors → Angular application: use (evidence: `README.md`)
- Angular application → Page routing: routes through (evidence: `frontend/healthcare_app/src/app/app.routes.ts`)
- Page routing → Login and registration: routes to (evidence: `frontend/healthcare_app/src/app/app.routes.ts`)
- Page routing → Availability screens: routes to (evidence: `frontend/healthcare_app/src/app/app.routes.ts`)
- Patients and doctors → Appointment endpoints: request scheduling (evidence: `README.md`)
- Patients and doctors → Availability endpoints: manage slots (evidence: `README.md`)
- Patients and doctors → Consultation endpoints: manage records (evidence: `README.md`)
- Patients and doctors → User endpoints: manage accounts (evidence: `README.md`)
- Login and registration → Auth API client: authenticates via
- Auth API client → User endpoints: calls user API (evidence: `frontend/healthcare_app/src/services/authapi.service.ts`)
- Appointment screens → Appointment endpoints: calls appointments
- Availability screens → Availability endpoints: calls availability
- Consultation screens → Consultation endpoints: calls consultations
- Appointment endpoints → Appointment rules: delegates to (evidence: `backend/src/main/java/com/cts/healthcare_appointment_system/controllers/AppointmentController.java`)
- Availability endpoints → Availability rules: delegates to (evidence: `backend/src/main/java/com/cts/healthcare_appointment_system/controllers/AvailabilityController.java`)
- Appointment rules → Availability rules: checks slots (evidence: `backend/src/main/java/com/cts/healthcare_appointment_system/services/AppointmentService.java`)
- Appointment rules → Email notifications: sends updates (evidence: `backend/src/main/java/com/cts/healthcare_appointment_system/services/AppointmentService.java`)
- Appointment rules → Audit logging: records actions (evidence: `backend/src/main/java/com/cts/healthcare_appointment_system/services/AppointmentService.java`)
- Availability rules → Email notifications: sends updates (evidence: `backend/src/main/java/com/cts/healthcare_appointment_system/services/AvailabilityService.java`)
- Consultation endpoints → Consultation records: delegates to (evidence: `README.md`)
- User endpoints → User management: delegates to (evidence: `README.md`)
- User management → Audit logging: records actions (evidence: `backend/src/main/java/com/cts/healthcare_appointment_system/services/UserService.java`)
- Appointment rules → JPA repositories: persists through (evidence: `backend/src/main/java/com/cts/healthcare_appointment_system/services/AppointmentService.java`)
- Availability rules → JPA repositories: persists through (evidence: `backend/src/main/java/com/cts/healthcare_appointment_system/services/AvailabilityService.java`)
- User management → JPA repositories: persists through (evidence: `backend/src/main/java/com/cts/healthcare_appointment_system/services/UserService.java`)
- Consultation records → JPA repositories: persists through (evidence: `backend/src/main/java/com/cts/healthcare_appointment_system/services/ConsultationService.java`)
- JPA repositories → Domain entities: maps entities (evidence: `backend/src/main/java/com/cts/healthcare_appointment_system/repositories/AppointmentRepository.java`)
- Domain entities → MySQL database: stored in (evidence: `README.md`)
- Email notifications → Email delivery: delegates delivery (evidence: `backend/src/main/java/com/cts/healthcare_appointment_system/services/NotificationService.java`)
- Email delivery → Mail service: sends email
- Reminder jobs → Email notifications: triggers reminders
- Summary reporting → JPA repositories: reads counts
- JWT and access control → User endpoints: protects endpoints (evidence: `README.md`)
