# dominic20-03/pawrescue architecture

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

- Interactive diagram: https://gitdiagram.com/dominic20-03/pawrescue
- Repository: https://github.com/dominic20-03/pawrescue

## Overview

PawRescue is a role-based animal rescue management application. Users authenticate, then work in a dashboard covering rescue reports, pet records, operations, medical care, shelters, adoption applications, and administration. The client’s hash-based app selects the pages; the server mounts API route modules that enforce authentication and use Prisma for persistent data. Source excerpts show the application entry point, authentication, reports, medical and shelter operations, and route registration. Several page-to-API connections are marked unverified because their request implementations were not sampled.

Main entry points: [`client/src/App.tsx`](https://github.com/dominic20-03/pawrescue/blob/main/client/src/App.tsx) (App navigation), [`server/src/index.ts`](https://github.com/dominic20-03/pawrescue/blob/main/server/src/index.ts) (Express API), [`client/src/api.ts`](https://github.com/dominic20-03/pawrescue/blob/main/client/src/api.ts) (API request client), [`server/src/db.ts`](https://github.com/dominic20-03/pawrescue/blob/main/server/src/db.ts) (Prisma client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["App navigation<br/>[App.tsx]"]
  node_layout["Workspace layout<br/>[Layout.tsx]"]
  node_authui["Sign-in / registration<br/>[Auth.tsx]"]
  node_authstate["Client auth state<br/>[AuthContext.tsx]"]
  node_api["API request client<br/>[api.ts]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_reportsui["Rescue reports<br/>[Reports.tsx]"]
  node_petsui["Pet records<br/>[Pets.tsx]"]
  node_operationsui["Operations<br/>[Operations.tsx]"]
  node_medicalui["Medical care<br/>[Medical.tsx]"]
  node_sheltersui["Shelter management<br/>[Shelters.tsx]"]
  node_adoptionsui["Adoption applications<br/>[Applications.tsx]"]
  node_usersui["User management<br/>[UserManagement.tsx]"]
end

subgraph group_server["API services"]
  node_server["Express API<br/>[index.ts]"]
  node_authroute["Authentication routes<br/>[auth.ts]"]
  node_reports["Report workflow<br/>[reports.ts]"]
  node_pets["Pet routes<br/>[pets.ts]"]
  node_operations["Medical / shelters<br/>[operations.ts]"]
  node_adoptions["Adoption routes<br/>[adoptions.ts]"]
  node_assignments["Volunteer assignments<br/>[assignments.ts]"]
  node_dashboardroute["Dashboard data<br/>[dashboard.ts]"]
  node_users["User routes<br/>[users.ts]"]
  node_authmw["Auth / role checks<br/>[auth.ts]"]
end

subgraph group_data["Persistence"]
  node_dbclient["Prisma client<br/>[db.ts]"]
  node_database[("Application database")]
end

node_user(("Rescue staff / public"))

node_user -->|"uses"| node_app
node_app -->|"checks session"| node_authstate
node_app -->|"shows signed-out"| node_authui
node_app -->|"renders workspace"| node_layout
node_app -->|"selects page"| node_dashboard
node_app -->|"selects page"| node_reportsui
node_app -->|"selects page"| node_petsui
node_app -->|"selects page"| node_operationsui
node_app -->|"selects page"| node_medicalui
node_app -->|"selects page"| node_sheltersui
node_app -->|"selects page"| node_adoptionsui
node_app -->|"selects page"| node_usersui
node_authstate -->|"requests session"| node_api
node_authui -.->|"uses auth"| node_authstate
node_adoptionsui -->|"submits decisions"| node_api
node_dashboard -.->|"loads data"| node_api
node_reportsui -.->|"loads reports"| node_api
node_petsui -.->|"loads pets"| node_api
node_operationsui -.->|"loads operations"| node_api
node_medicalui -.->|"loads records"| node_api
node_sheltersui -.->|"loads shelters"| node_api
node_usersui -.->|"loads users"| node_api
node_server -->|"mounts routes"| node_authroute
node_server -->|"mounts routes"| node_reports
node_server -->|"mounts routes"| node_pets
node_server -->|"mounts routes"| node_operations
node_server -->|"mounts routes"| node_adoptions
node_server -->|"mounts routes"| node_assignments
node_server -->|"mounts routes"| node_dashboardroute
node_server -->|"mounts routes"| node_users
node_authroute -->|"reads / writes"| node_dbclient
node_reports -->|"reads / writes"| node_dbclient
node_operations -->|"reads / writes"| node_dbclient
node_pets -->|"reads / writes"| node_dbclient
node_adoptions -->|"reads / writes"| node_dbclient
node_assignments -->|"reads / writes"| node_dbclient
node_dashboardroute -->|"reads data"| node_dbclient
node_users -->|"reads / writes"| node_dbclient
node_authmw -->|"loads user"| node_dbclient
node_authroute -->|"protects session"| node_authmw
node_reports -->|"checks access"| node_authmw
node_operations -->|"checks roles"| node_authmw
node_adoptions -->|"checks access"| node_authmw
node_assignments -->|"checks access"| node_authmw
node_dashboardroute -->|"checks access"| node_authmw
node_users -->|"checks access"| node_authmw
node_dbclient -.->|"persists data"| node_database
node_api -.->|"calls API"| node_server

click node_app "https://github.com/dominic20-03/pawrescue/blob/main/client/src/App.tsx"
click node_layout "https://github.com/dominic20-03/pawrescue/blob/main/client/src/components/Layout.tsx"
click node_authui "https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Auth.tsx"
click node_authstate "https://github.com/dominic20-03/pawrescue/blob/main/client/src/context/AuthContext.tsx"
click node_api "https://github.com/dominic20-03/pawrescue/blob/main/client/src/api.ts"
click node_dashboard "https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Dashboard.tsx"
click node_reportsui "https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Reports.tsx"
click node_petsui "https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Pets.tsx"
click node_operationsui "https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Operations.tsx"
click node_medicalui "https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Medical.tsx"
click node_sheltersui "https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Shelters.tsx"
click node_adoptionsui "https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Applications.tsx"
click node_usersui "https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/UserManagement.tsx"
click node_server "https://github.com/dominic20-03/pawrescue/blob/main/server/src/index.ts"
click node_authroute "https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/auth.ts"
click node_reports "https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/reports.ts"
click node_pets "https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/pets.ts"
click node_operations "https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/operations.ts"
click node_adoptions "https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/adoptions.ts"
click node_assignments "https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/assignments.ts"
click node_dashboardroute "https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/dashboard.ts"
click node_users "https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/users.ts"
click node_authmw "https://github.com/dominic20-03/pawrescue/blob/main/server/src/middleware/auth.ts"
click node_dbclient "https://github.com/dominic20-03/pawrescue/blob/main/server/src/db.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_app,node_layout,node_authui,node_authstate,node_api,node_dashboard,node_reportsui,node_petsui,node_operationsui,node_medicalui,node_sheltersui,node_adoptionsui,node_usersui toneBlue
class node_server,node_authroute,node_reports,node_pets,node_operations,node_adoptions,node_assignments,node_dashboardroute,node_users,node_authmw toneAmber
class node_dbclient,node_database toneMint
class node_user toneIndigo
```

## Components

### Web client

- [App navigation](https://github.com/dominic20-03/pawrescue/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Workspace layout](https://github.com/dominic20-03/pawrescue/blob/main/client/src/components/Layout.tsx): `client/src/components/Layout.tsx`
- [Sign-in / registration](https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Auth.tsx): `client/src/pages/Auth.tsx`
- [Client auth state](https://github.com/dominic20-03/pawrescue/blob/main/client/src/context/AuthContext.tsx): `client/src/context/AuthContext.tsx`
- [API request client](https://github.com/dominic20-03/pawrescue/blob/main/client/src/api.ts): `client/src/api.ts`
- [Dashboard](https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Dashboard.tsx): `client/src/pages/Dashboard.tsx`
- [Rescue reports](https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Reports.tsx): `client/src/pages/Reports.tsx`
- [Pet records](https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Pets.tsx): `client/src/pages/Pets.tsx`
- [Operations](https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Operations.tsx): `client/src/pages/Operations.tsx`
- [Medical care](https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Medical.tsx): `client/src/pages/Medical.tsx`
- [Shelter management](https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Shelters.tsx): `client/src/pages/Shelters.tsx`
- [Adoption applications](https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/Applications.tsx): `client/src/pages/Applications.tsx`
- [User management](https://github.com/dominic20-03/pawrescue/blob/main/client/src/pages/UserManagement.tsx): `client/src/pages/UserManagement.tsx`

### API services

- [Express API](https://github.com/dominic20-03/pawrescue/blob/main/server/src/index.ts): `server/src/index.ts`
- [Authentication routes](https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/auth.ts): `server/src/routes/auth.ts`
- [Report workflow](https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/reports.ts): `server/src/routes/reports.ts`
- [Pet routes](https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/pets.ts): `server/src/routes/pets.ts`
- [Medical / shelters](https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/operations.ts): `server/src/routes/operations.ts`
- [Adoption routes](https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/adoptions.ts): `server/src/routes/adoptions.ts`
- [Volunteer assignments](https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/assignments.ts): `server/src/routes/assignments.ts`
- [Dashboard data](https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/dashboard.ts): `server/src/routes/dashboard.ts`
- [User routes](https://github.com/dominic20-03/pawrescue/blob/main/server/src/routes/users.ts): `server/src/routes/users.ts`
- [Auth / role checks](https://github.com/dominic20-03/pawrescue/blob/main/server/src/middleware/auth.ts): `server/src/middleware/auth.ts`

### Persistence

- [Prisma client](https://github.com/dominic20-03/pawrescue/blob/main/server/src/db.ts): `server/src/db.ts`
- **Application database**

### Other components

- **Rescue staff / public**

## Connections

- Rescue staff / public → App navigation: uses
- App navigation → Client auth state: checks session (evidence: `client/src/App.tsx`)
- App navigation → Sign-in / registration: shows signed-out (evidence: `client/src/App.tsx`)
- App navigation → Workspace layout: renders workspace (evidence: `client/src/App.tsx`)
- App navigation → Dashboard: selects page
- App navigation → Rescue reports: selects page
- App navigation → Pet records: selects page
- App navigation → Operations: selects page
- App navigation → Medical care: selects page
- App navigation → Shelter management: selects page
- App navigation → Adoption applications: selects page
- App navigation → User management: selects page
- Client auth state → API request client: requests session (evidence: `client/src/context/AuthContext.tsx`)
- Sign-in / registration → Client auth state: uses auth
- Adoption applications → API request client: submits decisions (evidence: `client/src/pages/Applications.tsx`)
- Dashboard → API request client: loads data
- Rescue reports → API request client: loads reports
- Pet records → API request client: loads pets
- Operations → API request client: loads operations
- Medical care → API request client: loads records
- Shelter management → API request client: loads shelters
- User management → API request client: loads users
- Express API → Authentication routes: mounts routes (evidence: `server/src/index.ts`)
- Express API → Report workflow: mounts routes (evidence: `server/src/index.ts`)
- Express API → Pet routes: mounts routes (evidence: `server/src/index.ts`)
- Express API → Medical / shelters: mounts routes (evidence: `server/src/index.ts`)
- Express API → Adoption routes: mounts routes (evidence: `server/src/index.ts`)
- Express API → Volunteer assignments: mounts routes (evidence: `server/src/index.ts`)
- Express API → Dashboard data: mounts routes (evidence: `server/src/index.ts`)
- Express API → User routes: mounts routes (evidence: `server/src/index.ts`)
- Authentication routes → Prisma client: reads / writes (evidence: `server/src/routes/auth.ts`)
- Report workflow → Prisma client: reads / writes (evidence: `server/src/routes/reports.ts`)
- Medical / shelters → Prisma client: reads / writes (evidence: `server/src/routes/operations.ts`)
- Pet routes → Prisma client: reads / writes (evidence: `server/src/routes/pets.ts`)
- Adoption routes → Prisma client: reads / writes (evidence: `server/src/routes/adoptions.ts`)
- Volunteer assignments → Prisma client: reads / writes (evidence: `server/src/routes/assignments.ts`)
- Dashboard data → Prisma client: reads data (evidence: `server/src/routes/dashboard.ts`)
- User routes → Prisma client: reads / writes (evidence: `server/src/routes/users.ts`)
- Auth / role checks → Prisma client: loads user (evidence: `server/src/middleware/auth.ts`)
- Authentication routes → Auth / role checks: protects session (evidence: `server/src/routes/auth.ts`)
- Report workflow → Auth / role checks: checks access (evidence: `server/src/routes/reports.ts`)
- Medical / shelters → Auth / role checks: checks roles (evidence: `server/src/routes/operations.ts`)
- Adoption routes → Auth / role checks: checks access (evidence: `server/src/routes/adoptions.ts`)
- Volunteer assignments → Auth / role checks: checks access (evidence: `server/src/routes/assignments.ts`)
- Dashboard data → Auth / role checks: checks access (evidence: `server/src/routes/dashboard.ts`)
- User routes → Auth / role checks: checks access (evidence: `server/src/routes/users.ts`)
- Prisma client → Application database: persists data
- API request client → Express API: calls API
