# sreypy/vactracker_intership architecture

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

- Interactive diagram: https://gitdiagram.com/sreypy/vactracker_intership
- Repository: https://github.com/sreypy/vactracker_intership

## Overview

VacTracker is a poultry and veterinary tracking application. Farmers and veterinarians use authenticated API endpoints to manage profiles and connections, flocks, vaccinations, and illness reports; the API also exposes vaccine reference data, notifications, and reminders. The graph focuses on the NestJS backend: the supplied frontend files are platform launchers, not the app’s feature implementation. Controller-to-service and sampled service dependencies are shown; links for unsampled subsystems are omitted where their runtime wiring is not evidenced.

Main entry points: [`backend/src/sick-reports/sick-reports.service.ts`](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/sick-reports/sick-reports.service.ts) (Sick report handling), [`backend/src/auth/auth.service.ts`](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/auth/auth.service.ts) (OTP and sign-in), [`backend/src/vaccinations/vaccinations.service.ts`](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccinations/vaccinations.service.ts) (Vaccination records), [`backend/src/notifications/notifications.service.ts`](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/notifications/notifications.service.ts) (Notification handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and connections"]
  node_users_api["User endpoints"]
  node_users_service["User profiles<br/>[users.service.ts]"]
  node_user_model["User and connections<br/>[user.entity.ts]"]
  node_auth_api["Authentication endpoints<br/>[auth.controller.ts]"]
  node_auth_service["OTP and sign-in<br/>[auth.service.ts]"]
  node_otp_model["OTP records<br/>[otp-code.entity.ts]"]
  node_auth_sms["OTP SMS sender<br/>[sms.service.ts]"]
end

subgraph group_flockcare["Flock and care records"]
  node_flocks_api["Flock endpoints"]
  node_flocks_service["Flock management<br/>[flocks.service.ts]"]
  node_flock_model["Flock records<br/>[flock.entity.ts]"]
  node_vaccination_api["Vaccination endpoints"]
  node_vaccination_service["Vaccination records"]
  node_vaccination_model["Vaccination data"]
end

subgraph group_vetcare["Veterinary workflows"]
  node_sick_api["Sick report endpoints"]
  node_sick_service["Sick report handling"]
  node_sick_model["Illness reports"]
  node_vet_connections["Vet connection requests"]
  node_vet_connection_service["Connection decisions"]
  node_vet_dashboard["Vet dashboard"]
  node_farmer_detail["Farmer details"]
end

subgraph group_engagement["Notifications and reminders"]
  node_notifications_api["Notification endpoints"]
  node_notifications_service["Notification handling"]
  node_notification_model["Notification records"]
  node_reminders_api["Reminder endpoints"]
  node_reminders_service["Reminder handling"]
  node_reminder_scheduler["Reminder scheduler"]
end

subgraph group_reference["Reference data"]
  node_vaccine_library_api["Vaccine library endpoints"]
  node_vaccine_library_service["Vaccine library"]
  node_vaccines_api["Vaccine endpoints"]
  node_vaccines_service["Vaccine catalog"]
  node_vaccine_model["Vaccine data<br/>[vaccine.entity.ts]"]
end

node_farmers(("Farmers"))
node_vets(("Veterinarians"))

node_farmers -.->|"request access"| node_auth_api
node_vets -.->|"request access"| node_auth_api
node_auth_api -->|"delegates"| node_auth_service
node_auth_service -->|"reads and writes"| node_otp_model
node_auth_service -->|"looks up users"| node_user_model
node_auth_service -->|"sends OTP"| node_auth_sms
node_farmers -.->|"manage profile"| node_users_api
node_users_api -->|"delegates"| node_users_service
node_users_service -->|"uses user data"| node_user_model
node_vets -.->|"manage requests"| node_vet_connections
node_vet_connections -->|"delegates"| node_vet_connection_service
node_farmers -.->|"manage flocks"| node_flocks_api
node_flocks_api -->|"delegates"| node_flocks_service
node_flocks_service -->|"uses flock data"| node_flock_model
node_farmers -.->|"record vaccination"| node_vaccination_api
node_vaccination_api -->|"delegates"| node_vaccination_service
node_vaccination_service -->|"uses records"| node_vaccination_model
node_vaccination_service -->|"uses flock data"| node_flock_model
node_vaccination_service -->|"uses vaccine data"| node_vaccine_model
node_farmers -.->|"report illness"| node_sick_api
node_vets -.->|"review reports"| node_sick_api
node_sick_api -->|"delegates"| node_sick_service
node_sick_service -->|"uses report data"| node_sick_model
node_sick_service -->|"creates notifications"| node_notifications_service
node_sick_service -->|"uses user data"| node_user_model
node_sick_service -->|"uses flock data"| node_flock_model
node_sick_service -->|"checks connections"| node_user_model
node_farmers -.->|"view notifications"| node_notifications_api
node_vets -.->|"view notifications"| node_notifications_api
node_notifications_api -->|"dispatches by role"| node_notifications_service
node_notifications_service -->|"uses notification data"| node_notification_model
node_notifications_service -->|"uses vaccination data"| node_vaccination_model
node_farmers -.->|"manage reminders"| node_reminders_api
node_reminders_api -->|"delegates"| node_reminders_service
node_reminders_service -.->|"scheduled integration"| node_reminder_scheduler
node_farmers -.->|"browse vaccines"| node_vaccine_library_api
node_vaccine_library_api -->|"delegates"| node_vaccine_library_service
node_farmers -.->|"browse vaccines"| node_vaccines_api
node_vaccines_api -->|"delegates"| node_vaccines_service
node_vaccines_service -.->|"uses vaccine data"| node_vaccine_model

click node_users_api "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/users/users.controller.ts"
click node_users_service "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/users/users.service.ts"
click node_user_model "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/users/entities/user.entity.ts"
click node_auth_api "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/auth/auth.controller.ts"
click node_auth_service "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/auth/auth.service.ts"
click node_otp_model "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/auth/entities/otp-code.entity.ts"
click node_auth_sms "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/auth/sms.service.ts"
click node_flocks_api "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/flocks/flocks.controller.ts"
click node_flocks_service "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/flocks/flocks.service.ts"
click node_flock_model "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/flocks/entities/flock.entity.ts"
click node_vaccination_api "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccinations/vaccinations.controller.ts"
click node_vaccination_service "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccinations/vaccinations.service.ts"
click node_vaccination_model "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccinations/entities/vaccination.entity.ts"
click node_sick_api "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/sick-reports/sick-reports.controller.ts"
click node_sick_service "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/sick-reports/sick-reports.service.ts"
click node_sick_model "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/sick-reports/entities/sick-report.entity.ts"
click node_vet_connections "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vet/vet-connections.controller.ts"
click node_vet_connection_service "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vet/vet-connections.service.ts"
click node_vet_dashboard "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vet/vet-dashboard.controller.ts"
click node_farmer_detail "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vet/farmer-detail.controller.ts"
click node_notifications_api "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/notifications/notifications.controller.ts"
click node_notifications_service "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/notifications/notifications.service.ts"
click node_notification_model "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/notifications/entities/notification.entity.ts"
click node_reminders_api "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/reminders/reminders.controller.ts"
click node_reminders_service "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/reminders/reminders.service.ts"
click node_reminder_scheduler "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/reminders/reminder.scheduler.ts"
click node_vaccine_library_api "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccine-library/vaccine-library.controller.ts"
click node_vaccine_library_service "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccine-library/vaccine-library.service.ts"
click node_vaccines_api "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccines/vaccines.controller.ts"
click node_vaccines_service "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccines/vaccines.service.ts"
click node_vaccine_model "https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccines/entities/vaccine.entity.ts"

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_users_api,node_users_service,node_user_model,node_auth_api,node_auth_service,node_otp_model,node_auth_sms toneBlue
class node_flocks_api,node_flocks_service,node_flock_model,node_vaccination_api,node_vaccination_service,node_vaccination_model toneAmber
class node_sick_api,node_sick_service,node_sick_model,node_vet_connections,node_vet_connection_service,node_vet_dashboard,node_farmer_detail toneMint
class node_notifications_api,node_notifications_service,node_notification_model,node_reminders_api,node_reminders_service,node_reminder_scheduler toneRose
class node_vaccine_library_api,node_vaccine_library_service,node_vaccines_api,node_vaccines_service,node_vaccine_model,node_farmers,node_vets toneIndigo
```

## Components

### Identity and connections

- [User endpoints](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/users/users.controller.ts): `backend/src/users/users.controller.ts`
- [User profiles](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/users/users.service.ts): `backend/src/users/users.service.ts`
- [User and connections](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/users/entities/user.entity.ts): `backend/src/users/entities/user.entity.ts`
- [Authentication endpoints](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/auth/auth.controller.ts): `backend/src/auth/auth.controller.ts`
- [OTP and sign-in](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/auth/auth.service.ts): `backend/src/auth/auth.service.ts`
- [OTP records](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/auth/entities/otp-code.entity.ts): `backend/src/auth/entities/otp-code.entity.ts`
- [OTP SMS sender](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/auth/sms.service.ts): `backend/src/auth/sms.service.ts`

### Flock and care records

- [Flock endpoints](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/flocks/flocks.controller.ts): `backend/src/flocks/flocks.controller.ts`
- [Flock management](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/flocks/flocks.service.ts): `backend/src/flocks/flocks.service.ts`
- [Flock records](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/flocks/entities/flock.entity.ts): `backend/src/flocks/entities/flock.entity.ts`
- [Vaccination endpoints](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccinations/vaccinations.controller.ts): `backend/src/vaccinations/vaccinations.controller.ts`
- [Vaccination records](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccinations/vaccinations.service.ts): `backend/src/vaccinations/vaccinations.service.ts`
- [Vaccination data](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccinations/entities/vaccination.entity.ts): `backend/src/vaccinations/entities/vaccination.entity.ts`

### Veterinary workflows

- [Sick report endpoints](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/sick-reports/sick-reports.controller.ts): `backend/src/sick-reports/sick-reports.controller.ts`
- [Sick report handling](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/sick-reports/sick-reports.service.ts): `backend/src/sick-reports/sick-reports.service.ts`
- [Illness reports](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/sick-reports/entities/sick-report.entity.ts): `backend/src/sick-reports/entities/sick-report.entity.ts`
- [Vet connection requests](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vet/vet-connections.controller.ts): `backend/src/vet/vet-connections.controller.ts`
- [Connection decisions](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vet/vet-connections.service.ts): `backend/src/vet/vet-connections.service.ts`
- [Vet dashboard](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vet/vet-dashboard.controller.ts): `backend/src/vet/vet-dashboard.controller.ts`
- [Farmer details](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vet/farmer-detail.controller.ts): `backend/src/vet/farmer-detail.controller.ts`

### Notifications and reminders

- [Notification endpoints](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/notifications/notifications.controller.ts): `backend/src/notifications/notifications.controller.ts`
- [Notification handling](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/notifications/notifications.service.ts): `backend/src/notifications/notifications.service.ts`
- [Notification records](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/notifications/entities/notification.entity.ts): `backend/src/notifications/entities/notification.entity.ts`
- [Reminder endpoints](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/reminders/reminders.controller.ts): `backend/src/reminders/reminders.controller.ts`
- [Reminder handling](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/reminders/reminders.service.ts): `backend/src/reminders/reminders.service.ts`
- [Reminder scheduler](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/reminders/reminder.scheduler.ts): `backend/src/reminders/reminder.scheduler.ts`

### Reference data

- [Vaccine library endpoints](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccine-library/vaccine-library.controller.ts): `backend/src/vaccine-library/vaccine-library.controller.ts`
- [Vaccine library](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccine-library/vaccine-library.service.ts): `backend/src/vaccine-library/vaccine-library.service.ts`
- [Vaccine endpoints](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccines/vaccines.controller.ts): `backend/src/vaccines/vaccines.controller.ts`
- [Vaccine catalog](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccines/vaccines.service.ts): `backend/src/vaccines/vaccines.service.ts`
- [Vaccine data](https://github.com/sreypy/vactracker_intership/blob/main/backend/src/vaccines/entities/vaccine.entity.ts): `backend/src/vaccines/entities/vaccine.entity.ts`

### Other components

- **Farmers**
- **Veterinarians**

## Connections

- Farmers → Authentication endpoints: request access
- Veterinarians → Authentication endpoints: request access
- Authentication endpoints → OTP and sign-in: delegates (evidence: `backend/src/auth/auth.controller.ts`)
- OTP and sign-in → OTP records: reads and writes (evidence: `backend/src/auth/auth.service.ts`)
- OTP and sign-in → User and connections: looks up users (evidence: `backend/src/auth/auth.service.ts`)
- OTP and sign-in → OTP SMS sender: sends OTP (evidence: `backend/src/auth/auth.service.ts`)
- Farmers → User endpoints: manage profile
- User endpoints → User profiles: delegates (evidence: `backend/src/users/users.controller.ts`)
- User profiles → User and connections: uses user data
- Veterinarians → Vet connection requests: manage requests
- Vet connection requests → Connection decisions: delegates (evidence: `backend/src/vet/vet-connections.controller.ts`)
- Farmers → Flock endpoints: manage flocks
- Flock endpoints → Flock management: delegates (evidence: `backend/src/flocks/flocks.controller.ts`)
- Flock management → Flock records: uses flock data (evidence: `backend/src/flocks/flocks.service.ts`)
- Farmers → Vaccination endpoints: record vaccination
- Vaccination endpoints → Vaccination records: delegates (evidence: `backend/src/vaccinations/vaccinations.controller.ts`)
- Vaccination records → Vaccination data: uses records (evidence: `backend/src/vaccinations/vaccinations.service.ts`)
- Vaccination records → Flock records: uses flock data (evidence: `backend/src/vaccinations/vaccinations.service.ts`)
- Vaccination records → Vaccine data: uses vaccine data (evidence: `backend/src/vaccinations/vaccinations.service.ts`)
- Farmers → Sick report endpoints: report illness
- Veterinarians → Sick report endpoints: review reports
- Sick report endpoints → Sick report handling: delegates (evidence: `backend/src/sick-reports/sick-reports.controller.ts`)
- Sick report handling → Illness reports: uses report data (evidence: `backend/src/sick-reports/sick-reports.service.ts`)
- Sick report handling → Notification handling: creates notifications (evidence: `backend/src/sick-reports/sick-reports.service.ts`)
- Sick report handling → User and connections: uses user data (evidence: `backend/src/sick-reports/sick-reports.service.ts`)
- Sick report handling → Flock records: uses flock data (evidence: `backend/src/sick-reports/sick-reports.service.ts`)
- Sick report handling → User and connections: checks connections (evidence: `backend/src/sick-reports/sick-reports.service.ts`)
- Farmers → Notification endpoints: view notifications
- Veterinarians → Notification endpoints: view notifications
- Notification endpoints → Notification handling: dispatches by role (evidence: `backend/src/notifications/notifications.controller.ts`)
- Notification handling → Notification records: uses notification data (evidence: `backend/src/notifications/notifications.service.ts`)
- Notification handling → Vaccination data: uses vaccination data (evidence: `backend/src/notifications/notifications.service.ts`)
- Farmers → Reminder endpoints: manage reminders
- Reminder endpoints → Reminder handling: delegates (evidence: `backend/src/reminders/reminders.controller.ts`)
- Reminder handling → Reminder scheduler: scheduled integration
- Farmers → Vaccine library endpoints: browse vaccines
- Vaccine library endpoints → Vaccine library: delegates (evidence: `backend/src/vaccine-library/vaccine-library.controller.ts`)
- Farmers → Vaccine endpoints: browse vaccines
- Vaccine endpoints → Vaccine catalog: delegates (evidence: `backend/src/vaccines/vaccines.controller.ts`)
- Vaccine catalog → Vaccine data: uses vaccine data
