# bikalpcdr/visionflow architecture

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

- Interactive diagram: https://gitdiagram.com/bikalpcdr/visionflow
- Repository: https://github.com/bikalpcdr/visionflow

## Overview

VisionFlow is a vision-therapy management system with an Angular dashboard and a Spring REST backend. Users authenticate, then manage patient and doctor records, assessments, therapy plans and exercises, sessions and exercise logs, and appointments; notifications and reports support that care workflow. The frontend route map and the appointment and therapy-plan controller-to-service calls are directly evidenced. Other backend module connections and database interactions are shown only as documented capabilities, so those links are dashed and unverified.

Main entry points: [`visionflow-frontend/src/app/dashboard/dashboard.component.ts`](https://github.com/bikalpcdr/visionflow/blob/development/visionflow-frontend/src/app/dashboard/dashboard.component.ts) (Care dashboard), [`visionflow-frontend/src/app/app.routes.ts`](https://github.com/bikalpcdr/visionflow/blob/development/visionflow-frontend/src/app/app.routes.ts) (App routes), [`src/main/java/com/visionflow/core/auth/controller/AuthController.java`](https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/auth/controller/AuthController.java) (Auth API), [`src/main/java/com/visionflow/core/appointment/controller/AppointmentController.java`](https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/appointment/controller/AppointmentController.java) (Appointments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_routes["App routes<br/>[app.routes.ts]"]
  node_authui["Auth client<br/>[auth.service.ts]"]
  node_dashboard["Care dashboard"]
end

subgraph group_identity["Identity and access"]
  node_authapi["Auth API"]
  node_authservice["Auth service"]
  node_security["JWT security"]
end

subgraph group_care["Clinical care"]
  node_patients["Patient records"]
  node_doctors["Doctor records"]
  node_assessments["Vision assessments"]
  node_plans["Therapy plans"]
  node_sessions["Therapy sessions"]
end

subgraph group_operations["Clinic operations"]
  node_appointments["Appointments"]
  node_notifications["Notifications"]
  node_reports["Reports"]
end

subgraph group_platform["Backend platform"]
  node_postgres[("PostgreSQL")]
  node_apiresponse["API responses"]
end

node_user(("Clinic user"))

node_user -->|"uses"| node_routes
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_authui
node_authui -.->|"authenticates"| node_authapi
node_user -->|"authenticates"| node_authapi
node_authapi -.->|"delegates"| node_authservice
node_security -.->|"validates tokens"| node_authservice
node_dashboard -.->|"manages"| node_patients
node_dashboard -.->|"manages"| node_doctors
node_dashboard -.->|"records"| node_assessments
node_dashboard -.->|"manages"| node_plans
node_dashboard -.->|"tracks"| node_sessions
node_dashboard -.->|"schedules"| node_appointments
node_dashboard -.->|"views"| node_notifications
node_dashboard -.->|"views"| node_reports
node_plans -.->|"persists plans"| node_postgres
node_appointments -.->|"persists appointments"| node_postgres
node_notifications -.->|"persists notices"| node_postgres
node_reports -.->|"reads data"| node_postgres
node_apiresponse -.->|"wraps responses"| node_appointments

click node_routes "https://github.com/bikalpcdr/visionflow/blob/development/visionflow-frontend/src/app/app.routes.ts"
click node_authui "https://github.com/bikalpcdr/visionflow/blob/development/visionflow-frontend/src/app/service/auth.service.ts"
click node_dashboard "https://github.com/bikalpcdr/visionflow/blob/development/visionflow-frontend/src/app/dashboard/dashboard.component.ts"
click node_authapi "https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/auth/controller/AuthController.java"
click node_authservice "https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/auth/service/impl/AuthServiceImpl.java"
click node_security "https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/config/security/JwtAuthenticationFilter.java"
click node_patients "https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/patient/service/impl/PatientServiceImpl.java"
click node_doctors "https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/doctor/service/impl/DoctorServiceImpl.java"
click node_assessments "https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/assessment/service/impl/AssessmentServiceImpl.java"
click node_plans "https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/therapyplan/controller/TherapyPlanController.java"
click node_sessions "https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/session/service/impl/SessionServiceImpl.java"
click node_appointments "https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/appointment/controller/AppointmentController.java"
click node_notifications "https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/notification/service/impl/NotificationServiceImpl.java"
click node_reports "https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/report/service/impl/ReportServiceImpl.java"
click node_apiresponse "https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/api/ResponseWrapperAdvice.java"

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_routes,node_authui,node_dashboard,node_user toneBlue
class node_authapi,node_authservice,node_security toneAmber
class node_patients,node_doctors,node_assessments,node_plans,node_sessions toneMint
class node_appointments,node_notifications,node_reports toneRose
class node_postgres,node_apiresponse toneIndigo
```

## Components

### Web application

- [App routes](https://github.com/bikalpcdr/visionflow/blob/development/visionflow-frontend/src/app/app.routes.ts): `visionflow-frontend/src/app/app.routes.ts`
- [Auth client](https://github.com/bikalpcdr/visionflow/blob/development/visionflow-frontend/src/app/service/auth.service.ts): `visionflow-frontend/src/app/service/auth.service.ts`
- [Care dashboard](https://github.com/bikalpcdr/visionflow/blob/development/visionflow-frontend/src/app/dashboard/dashboard.component.ts): `visionflow-frontend/src/app/dashboard/dashboard.component.ts`

### Identity and access

- [Auth API](https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/auth/controller/AuthController.java): `src/main/java/com/visionflow/core/auth/controller/AuthController.java`
- [Auth service](https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/auth/service/impl/AuthServiceImpl.java): `src/main/java/com/visionflow/core/auth/service/impl/AuthServiceImpl.java`
- [JWT security](https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/config/security/JwtAuthenticationFilter.java): `src/main/java/com/visionflow/config/security/JwtAuthenticationFilter.java`

### Clinical care

- [Patient records](https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/patient/service/impl/PatientServiceImpl.java): `src/main/java/com/visionflow/core/patient/service/impl/PatientServiceImpl.java`
- [Doctor records](https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/doctor/service/impl/DoctorServiceImpl.java): `src/main/java/com/visionflow/core/doctor/service/impl/DoctorServiceImpl.java`
- [Vision assessments](https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/assessment/service/impl/AssessmentServiceImpl.java): `src/main/java/com/visionflow/core/assessment/service/impl/AssessmentServiceImpl.java`
- [Therapy plans](https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/therapyplan/controller/TherapyPlanController.java): `src/main/java/com/visionflow/core/therapyplan/controller/TherapyPlanController.java`
- [Therapy sessions](https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/session/service/impl/SessionServiceImpl.java): `src/main/java/com/visionflow/core/session/service/impl/SessionServiceImpl.java`

### Clinic operations

- [Appointments](https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/appointment/controller/AppointmentController.java): `src/main/java/com/visionflow/core/appointment/controller/AppointmentController.java`
- [Notifications](https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/notification/service/impl/NotificationServiceImpl.java): `src/main/java/com/visionflow/core/notification/service/impl/NotificationServiceImpl.java`
- [Reports](https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/core/report/service/impl/ReportServiceImpl.java): `src/main/java/com/visionflow/core/report/service/impl/ReportServiceImpl.java`

### Backend platform

- **PostgreSQL**
- [API responses](https://github.com/bikalpcdr/visionflow/blob/development/src/main/java/com/visionflow/api/ResponseWrapperAdvice.java): `src/main/java/com/visionflow/api/ResponseWrapperAdvice.java`

### Other components

- **Clinic user**

## Connections

- Clinic user → App routes: uses (evidence: `visionflow-frontend/src/app/app.routes.ts`)
- App routes → Care dashboard: routes to (evidence: `visionflow-frontend/src/app/app.routes.ts`)
- App routes → Auth client: routes to (evidence: `visionflow-frontend/src/app/app.routes.ts`)
- Auth client → Auth API: authenticates
- Clinic user → Auth API: authenticates (evidence: `README.md`)
- Auth API → Auth service: delegates
- JWT security → Auth service: validates tokens
- Care dashboard → Patient records: manages
- Care dashboard → Doctor records: manages
- Care dashboard → Vision assessments: records
- Care dashboard → Therapy plans: manages
- Care dashboard → Therapy sessions: tracks
- Care dashboard → Appointments: schedules
- Care dashboard → Notifications: views
- Care dashboard → Reports: views
- Therapy plans → PostgreSQL: persists plans
- Appointments → PostgreSQL: persists appointments
- Notifications → PostgreSQL: persists notices
- Reports → PostgreSQL: reads data
- API responses → Appointments: wraps responses
