# saeed99madi/vet architecture

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

- Interactive diagram: https://gitdiagram.com/saeed99madi/vet
- Repository: https://github.com/saeed99madi/vet

## Overview

Paws is a veterinary community web app: pet owners and veterinarians register or sign in, then use community posts, doctor discovery, appointment booking, and urgent private chat. The React client presents these journeys and calls the Express API; API controllers validate requests and persist domain records through Sequelize to PostgreSQL. Chat, active-user presence, image storage, and notifications use Firebase according to the README and client helpers. Some route and integration wiring is documented but not sampled, so only supported links are shown and unsampled areas use existing directory paths.

Main entry points: [`src/routes/index.ts`](https://github.com/saeed99madi/vet/blob/main/src/routes/index.ts) (API routes), [`src/models`](https://github.com/saeed99madi/vet/tree/main/src/models) (Domain models), [`client/src/App.tsx`](https://github.com/saeed99madi/vet/blob/main/client/src/App.tsx) (React app), [`client/src/services/ApiService.ts`](https://github.com/saeed99madi/vet/blob/main/client/src/services/ApiService.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_react["React app<br/>[App.tsx]"]
  node_authui["Sign-in / signup<br/>[useAuth.tsx]"]
  node_api_client["API client<br/>[ApiService.ts]"]
  node_community_ui["Community posts"]
  node_doctor_ui["Doctor discovery<br/>[Doctors.tsx]"]
  node_appointments_ui["Appointment calendar"]
  node_emergency_ui["Emergency chat"]
  node_notifications_ui["Notifications"]
end

subgraph group_server["API server"]
  node_express["Express app<br/>[app.ts]"]
  node_routes["API routes<br/>[index.ts]"]
end

subgraph group_domain["Domain services"]
  node_auth_controller["Authentication<br/>[AuthController.ts]"]
  node_posts_controller["Posts<br/>[PostsController.ts]"]
  node_social_controllers["Comments and likes"]
  node_doctor_controller["Doctor profiles"]
  node_appointment_controller["Appointments<br/>[Appointment.ts]"]
  node_chat_presence["Chat and presence"]
  node_notifications_service["Notification helpers"]
end

subgraph group_infra["Data and integrations"]
  node_sequelize_models["Domain models"]
  node_postgres[("PostgreSQL<br/>[connection.ts]")]
  node_firebase["Firebase services<br/>[Firebase.config.ts]"]
end

node_owners(("Pet owners"))
node_vets(("Veterinarians"))

node_owners -->|"use"| node_react
node_vets -->|"use"| node_react
node_react -->|"provides auth"| node_authui
node_authui -->|"requests auth"| node_api_client
node_community_ui -->|"requests posts"| node_api_client
node_doctor_ui -->|"requests doctors"| node_api_client
node_appointments_ui -->|"requests bookings"| node_api_client
node_react -->|"renders"| node_emergency_ui
node_react -->|"renders"| node_notifications_ui
node_api_client -->|"sends API requests"| node_express
node_express -->|"dispatches API"| node_routes
node_routes -->|"dispatches auth"| node_auth_controller
node_routes -->|"dispatches posts"| node_posts_controller
node_routes -->|"dispatches interactions"| node_social_controllers
node_routes -->|"dispatches doctor routes"| node_doctor_controller
node_routes -->|"dispatches appointments"| node_appointment_controller
node_posts_controller -->|"reads/writes posts"| node_sequelize_models
node_social_controllers -->|"reads/writes interactions"| node_sequelize_models
node_doctor_controller -->|"reads/writes profiles"| node_sequelize_models
node_appointment_controller -->|"reads/writes bookings"| node_sequelize_models
node_auth_controller -->|"reads/writes users"| node_sequelize_models
node_sequelize_models -->|"persists records"| node_postgres
node_emergency_ui -.->|"uses chat helpers"| node_chat_presence
node_chat_presence -.->|"uses realtime services"| node_firebase
node_notifications_ui -.->|"uses helpers"| node_notifications_service
node_notifications_service -.->|"uses notifications"| node_firebase

click node_react "https://github.com/saeed99madi/vet/blob/main/client/src/App.tsx"
click node_authui "https://github.com/saeed99madi/vet/blob/main/client/src/hooks/useAuth.tsx"
click node_api_client "https://github.com/saeed99madi/vet/blob/main/client/src/services/ApiService.ts"
click node_community_ui "https://github.com/saeed99madi/vet/tree/main/client/src/components/PostCard"
click node_doctor_ui "https://github.com/saeed99madi/vet/blob/main/client/src/pages/Doctors.tsx"
click node_appointments_ui "https://github.com/saeed99madi/vet/tree/main/client/src/components/Profile/Calender"
click node_emergency_ui "https://github.com/saeed99madi/vet/tree/main/client/src/components/Emergency"
click node_notifications_ui "https://github.com/saeed99madi/vet/tree/main/client/src/components/Notification"
click node_express "https://github.com/saeed99madi/vet/blob/main/src/app.ts"
click node_routes "https://github.com/saeed99madi/vet/blob/main/src/routes/index.ts"
click node_auth_controller "https://github.com/saeed99madi/vet/blob/main/src/controllers/AuthController.ts"
click node_posts_controller "https://github.com/saeed99madi/vet/blob/main/src/controllers/PostsController.ts"
click node_social_controllers "https://github.com/saeed99madi/vet/tree/main/src/controllers"
click node_doctor_controller "https://github.com/saeed99madi/vet/blob/main/src/controllers/DoctorController.ts"
click node_appointment_controller "https://github.com/saeed99madi/vet/blob/main/src/controllers/Appointment.ts"
click node_chat_presence "https://github.com/saeed99madi/vet/tree/main/client/src/helpers"
click node_notifications_service "https://github.com/saeed99madi/vet/tree/main/client/src/helpers"
click node_sequelize_models "https://github.com/saeed99madi/vet/tree/main/src/models"
click node_postgres "https://github.com/saeed99madi/vet/blob/main/src/db/connection.ts"
click node_firebase "https://github.com/saeed99madi/vet/blob/main/client/src/helpers/Firebase.config.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_react,node_authui,node_api_client,node_community_ui,node_doctor_ui,node_appointments_ui,node_emergency_ui,node_notifications_ui toneBlue
class node_express,node_routes toneAmber
class node_auth_controller,node_posts_controller,node_social_controllers,node_doctor_controller,node_appointment_controller,node_chat_presence,node_notifications_service toneMint
class node_sequelize_models,node_postgres,node_firebase toneRose
class node_owners,node_vets toneIndigo
```

## Components

### Web client

- [React app](https://github.com/saeed99madi/vet/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Sign-in / signup](https://github.com/saeed99madi/vet/blob/main/client/src/hooks/useAuth.tsx): `client/src/hooks/useAuth.tsx`
- [API client](https://github.com/saeed99madi/vet/blob/main/client/src/services/ApiService.ts): `client/src/services/ApiService.ts`
- [Community posts](https://github.com/saeed99madi/vet/tree/main/client/src/components/PostCard): `client/src/components/PostCard`
- [Doctor discovery](https://github.com/saeed99madi/vet/blob/main/client/src/pages/Doctors.tsx): `client/src/pages/Doctors.tsx`
- [Appointment calendar](https://github.com/saeed99madi/vet/tree/main/client/src/components/Profile/Calender): `client/src/components/Profile/Calender`
- [Emergency chat](https://github.com/saeed99madi/vet/tree/main/client/src/components/Emergency): `client/src/components/Emergency`
- [Notifications](https://github.com/saeed99madi/vet/tree/main/client/src/components/Notification): `client/src/components/Notification`

### API server

- [Express app](https://github.com/saeed99madi/vet/blob/main/src/app.ts): `src/app.ts`
- [API routes](https://github.com/saeed99madi/vet/blob/main/src/routes/index.ts): `src/routes/index.ts`

### Domain services

- [Authentication](https://github.com/saeed99madi/vet/blob/main/src/controllers/AuthController.ts): `src/controllers/AuthController.ts`
- [Posts](https://github.com/saeed99madi/vet/blob/main/src/controllers/PostsController.ts): `src/controllers/PostsController.ts`
- [Comments and likes](https://github.com/saeed99madi/vet/tree/main/src/controllers): `src/controllers`
- [Doctor profiles](https://github.com/saeed99madi/vet/blob/main/src/controllers/DoctorController.ts): `src/controllers/DoctorController.ts`
- [Appointments](https://github.com/saeed99madi/vet/blob/main/src/controllers/Appointment.ts): `src/controllers/Appointment.ts`
- [Chat and presence](https://github.com/saeed99madi/vet/tree/main/client/src/helpers): `client/src/helpers`
- [Notification helpers](https://github.com/saeed99madi/vet/tree/main/client/src/helpers): `client/src/helpers`

### Data and integrations

- [Domain models](https://github.com/saeed99madi/vet/tree/main/src/models): `src/models`
- [PostgreSQL](https://github.com/saeed99madi/vet/blob/main/src/db/connection.ts): `src/db/connection.ts`
- [Firebase services](https://github.com/saeed99madi/vet/blob/main/client/src/helpers/Firebase.config.ts): `client/src/helpers/Firebase.config.ts`

### Other components

- **Pet owners**
- **Veterinarians**

## Connections

- Pet owners → React app: use
- Veterinarians → React app: use
- React app → Sign-in / signup: provides auth
- Sign-in / signup → API client: requests auth
- Community posts → API client: requests posts
- Doctor discovery → API client: requests doctors
- Appointment calendar → API client: requests bookings
- React app → Emergency chat: renders
- React app → Notifications: renders
- API client → Express app: sends API requests
- Express app → API routes: dispatches API
- API routes → Authentication: dispatches auth
- API routes → Posts: dispatches posts
- API routes → Comments and likes: dispatches interactions
- API routes → Doctor profiles: dispatches doctor routes
- API routes → Appointments: dispatches appointments
- Posts → Domain models: reads/writes posts
- Comments and likes → Domain models: reads/writes interactions
- Doctor profiles → Domain models: reads/writes profiles
- Appointments → Domain models: reads/writes bookings
- Authentication → Domain models: reads/writes users
- Domain models → PostgreSQL: persists records
- Emergency chat → Chat and presence: uses chat helpers
- Chat and presence → Firebase services: uses realtime services
- Notifications → Notification helpers: uses helpers
- Notification helpers → Firebase services: uses notifications
