# cenx-bash/pawssible architecture

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

- Interactive diagram: https://gitdiagram.com/cenx-bash/pawssible
- Repository: https://github.com/cenx-bash/pawssible

## Overview

Pawssible is a web-based pet-care and stray-animal assistance platform. The documented user journey is account access followed by managing pet information and using care services, including appointments; the server serves the frontend and mounts the API routes. The sampled implementation confirms authentication, pet and profile database operations, but several rescue, shelter, and review routes are placeholders. Other documented features are retained as capability nodes where the tree provides a plausible frontend or route location; their implementation details were not sampled.

Main entry points: [`backend/server.js`](https://github.com/cenx-bash/pawssible/blob/main/backend/server.js) (Web and API server), [`backend/routes/profile.routes.js`](https://github.com/cenx-bash/pawssible/blob/main/backend/routes/profile.routes.js) (Profile routes), [`frontend/js/main.js`](https://github.com/cenx-bash/pawssible/blob/main/frontend/js/main.js) (Care dashboard), [`backend/routes/animals.routes.js`](https://github.com/cenx-bash/pawssible/blob/main/backend/routes/animals.routes.js) (Animal routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_frontend_auth["Sign-in interface<br/>[auth.js]"]
  node_frontend_main["Care dashboard<br/>[main.js]"]
  node_frontend_profile["Profile interface<br/>[profile.js]"]
end

subgraph group_api["API and access"]
  node_server["Web and API server<br/>[server.js]"]
  node_api_entry["API entry<br/>[index.js]"]
  node_admin["Administration<br/>[admin.routes.js]"]
end

subgraph group_care["Pet care"]
  node_animal_routes["Animal routes<br/>[animals.routes.js]"]
  node_animals["Pet profiles"]
  node_medical["Medical records<br/>[animals.js]"]
  node_appointments["Appointments"]
end

subgraph group_community["Rescue and services"]
  node_rescue["Rescue operations<br/>[rescue.routes.js]"]
  node_shelters["Shelter services<br/>[shelters.routes.js]"]
  node_resources["Care resources"]
  node_reviews["Reviews and ratings<br/>[reviews.routes.js]"]
end

subgraph group_identity["Identity and data"]
  node_auth_routes["Authentication routes<br/>[auth.routes.js]"]
  node_auth["Account and recovery<br/>[auth.controller.js]"]
  node_auth_mw["Token verification<br/>[auth.middleware.js]"]
  node_roles["Role permissions<br/>[role.middleware.js]"]
  node_users["User routes<br/>[users.routes.js]"]
  node_profile_routes["Profile routes<br/>[profile.routes.js]"]
  node_profile["Profile and preferences"]
  node_db[("MySQL pool<br/>[database.js]")]
  node_email_utils["Email helpers<br/>[email.js]"]
  node_email_service["Email delivery<br/>[email.service.js]"]
end

node_owner(("Pet owner"))

node_owner -->|"uses"| node_frontend_auth
node_frontend_auth -.->|"requests authentication"| node_auth_routes
node_api_entry -->|"delegates to"| node_server
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_animal_routes
node_server -->|"mounts"| node_profile_routes
node_server -->|"mounts"| node_rescue
node_server -->|"mounts"| node_shelters
node_server -->|"mounts"| node_reviews
node_server -->|"mounts"| node_admin
node_server -->|"mounts"| node_users
node_auth_routes -->|"dispatches to"| node_auth
node_animal_routes -->|"dispatches to"| node_animals
node_animal_routes -->|"authenticates with"| node_auth_mw
node_profile_routes -->|"dispatches to"| node_profile
node_profile_routes -->|"authenticates with"| node_auth_mw
node_auth -->|"queries"| node_db
node_auth -->|"uses"| node_email_utils
node_animals -->|"queries"| node_db
node_profile -->|"reads and writes"| node_db
node_frontend_profile -.->|"requests profile"| node_profile_routes
node_frontend_main -.->|"schedules"| node_appointments
node_frontend_main -.->|"browses"| node_resources
node_frontend_main -.->|"manages records"| node_medical

click node_server "https://github.com/cenx-bash/pawssible/blob/main/backend/server.js"
click node_api_entry "https://github.com/cenx-bash/pawssible/blob/main/api/index.js"
click node_auth_routes "https://github.com/cenx-bash/pawssible/blob/main/backend/routes/auth.routes.js"
click node_auth "https://github.com/cenx-bash/pawssible/blob/main/backend/controllers/auth.controller.js"
click node_auth_mw "https://github.com/cenx-bash/pawssible/blob/main/backend/middleware/auth.middleware.js"
click node_roles "https://github.com/cenx-bash/pawssible/blob/main/backend/middleware/role.middleware.js"
click node_users "https://github.com/cenx-bash/pawssible/blob/main/backend/routes/users.routes.js"
click node_profile_routes "https://github.com/cenx-bash/pawssible/blob/main/backend/routes/profile.routes.js"
click node_profile "https://github.com/cenx-bash/pawssible/blob/main/backend/controllers/profile.controller.js"
click node_db "https://github.com/cenx-bash/pawssible/blob/main/backend/config/database.js"
click node_email_utils "https://github.com/cenx-bash/pawssible/blob/main/backend/utils/email.js"
click node_email_service "https://github.com/cenx-bash/pawssible/blob/main/backend/services/email.service.js"
click node_animal_routes "https://github.com/cenx-bash/pawssible/blob/main/backend/routes/animals.routes.js"
click node_animals "https://github.com/cenx-bash/pawssible/blob/main/backend/controllers/animal.controller.js"
click node_medical "https://github.com/cenx-bash/pawssible/blob/main/frontend/js/animals.js"
click node_appointments "https://github.com/cenx-bash/pawssible/blob/main/backend/routes/appointments.routes.js"
click node_rescue "https://github.com/cenx-bash/pawssible/blob/main/backend/routes/rescue.routes.js"
click node_shelters "https://github.com/cenx-bash/pawssible/blob/main/backend/routes/shelters.routes.js"
click node_resources "https://github.com/cenx-bash/pawssible/blob/main/frontend/js/rescource-library.js"
click node_reviews "https://github.com/cenx-bash/pawssible/blob/main/backend/routes/reviews.routes.js"
click node_admin "https://github.com/cenx-bash/pawssible/blob/main/backend/routes/admin.routes.js"
click node_frontend_auth "https://github.com/cenx-bash/pawssible/blob/main/frontend/js/auth.js"
click node_frontend_main "https://github.com/cenx-bash/pawssible/blob/main/frontend/js/main.js"
click node_frontend_profile "https://github.com/cenx-bash/pawssible/blob/main/frontend/js/profile.js"

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_frontend_auth,node_frontend_main,node_frontend_profile toneBlue
class node_server,node_api_entry,node_admin toneAmber
class node_animal_routes,node_animals,node_medical,node_appointments toneMint
class node_rescue,node_shelters,node_resources,node_reviews toneRose
class node_auth_routes,node_auth,node_auth_mw,node_roles,node_users,node_profile_routes,node_profile,node_db,node_email_utils,node_email_service,node_owner toneIndigo
```

## Components

### Web experience

- [Sign-in interface](https://github.com/cenx-bash/pawssible/blob/main/frontend/js/auth.js): `frontend/js/auth.js`
- [Care dashboard](https://github.com/cenx-bash/pawssible/blob/main/frontend/js/main.js): `frontend/js/main.js`
- [Profile interface](https://github.com/cenx-bash/pawssible/blob/main/frontend/js/profile.js): `frontend/js/profile.js`

### API and access

- [Web and API server](https://github.com/cenx-bash/pawssible/blob/main/backend/server.js): `backend/server.js`
- [API entry](https://github.com/cenx-bash/pawssible/blob/main/api/index.js): `api/index.js`
- [Administration](https://github.com/cenx-bash/pawssible/blob/main/backend/routes/admin.routes.js): `backend/routes/admin.routes.js`

### Pet care

- [Animal routes](https://github.com/cenx-bash/pawssible/blob/main/backend/routes/animals.routes.js): `backend/routes/animals.routes.js`
- [Pet profiles](https://github.com/cenx-bash/pawssible/blob/main/backend/controllers/animal.controller.js): `backend/controllers/animal.controller.js`
- [Medical records](https://github.com/cenx-bash/pawssible/blob/main/frontend/js/animals.js): `frontend/js/animals.js`
- [Appointments](https://github.com/cenx-bash/pawssible/blob/main/backend/routes/appointments.routes.js): `backend/routes/appointments.routes.js`

### Rescue and services

- [Rescue operations](https://github.com/cenx-bash/pawssible/blob/main/backend/routes/rescue.routes.js): `backend/routes/rescue.routes.js`
- [Shelter services](https://github.com/cenx-bash/pawssible/blob/main/backend/routes/shelters.routes.js): `backend/routes/shelters.routes.js`
- [Care resources](https://github.com/cenx-bash/pawssible/blob/main/frontend/js/rescource-library.js): `frontend/js/rescource-library.js`
- [Reviews and ratings](https://github.com/cenx-bash/pawssible/blob/main/backend/routes/reviews.routes.js): `backend/routes/reviews.routes.js`

### Identity and data

- [Authentication routes](https://github.com/cenx-bash/pawssible/blob/main/backend/routes/auth.routes.js): `backend/routes/auth.routes.js`
- [Account and recovery](https://github.com/cenx-bash/pawssible/blob/main/backend/controllers/auth.controller.js): `backend/controllers/auth.controller.js`
- [Token verification](https://github.com/cenx-bash/pawssible/blob/main/backend/middleware/auth.middleware.js): `backend/middleware/auth.middleware.js`
- [Role permissions](https://github.com/cenx-bash/pawssible/blob/main/backend/middleware/role.middleware.js): `backend/middleware/role.middleware.js`
- [User routes](https://github.com/cenx-bash/pawssible/blob/main/backend/routes/users.routes.js): `backend/routes/users.routes.js`
- [Profile routes](https://github.com/cenx-bash/pawssible/blob/main/backend/routes/profile.routes.js): `backend/routes/profile.routes.js`
- [Profile and preferences](https://github.com/cenx-bash/pawssible/blob/main/backend/controllers/profile.controller.js): `backend/controllers/profile.controller.js`
- [MySQL pool](https://github.com/cenx-bash/pawssible/blob/main/backend/config/database.js): `backend/config/database.js`
- [Email helpers](https://github.com/cenx-bash/pawssible/blob/main/backend/utils/email.js): `backend/utils/email.js`
- [Email delivery](https://github.com/cenx-bash/pawssible/blob/main/backend/services/email.service.js): `backend/services/email.service.js`

### Other components

- **Pet owner**

## Connections

- Pet owner → Sign-in interface: uses (evidence: `README.md`)
- Sign-in interface → Authentication routes: requests authentication
- API entry → Web and API server: delegates to (evidence: `api/index.js`)
- Web and API server → Authentication routes: mounts (evidence: `backend/server.js`)
- Web and API server → Animal routes: mounts (evidence: `backend/server.js`)
- Web and API server → Profile routes: mounts (evidence: `backend/server.js`)
- Web and API server → Rescue operations: mounts (evidence: `backend/server.js`)
- Web and API server → Shelter services: mounts (evidence: `backend/server.js`)
- Web and API server → Reviews and ratings: mounts (evidence: `backend/server.js`)
- Web and API server → Administration: mounts (evidence: `backend/server.js`)
- Web and API server → User routes: mounts (evidence: `backend/server.js`)
- Authentication routes → Account and recovery: dispatches to (evidence: `backend/routes/auth.routes.js`)
- Animal routes → Pet profiles: dispatches to (evidence: `backend/routes/animals.routes.js`)
- Animal routes → Token verification: authenticates with (evidence: `backend/routes/animals.routes.js`)
- Profile routes → Profile and preferences: dispatches to (evidence: `backend/routes/profile.routes.js`)
- Profile routes → Token verification: authenticates with (evidence: `backend/routes/profile.routes.js`)
- Account and recovery → MySQL pool: queries (evidence: `backend/controllers/auth.controller.js`)
- Account and recovery → Email helpers: uses (evidence: `backend/controllers/auth.controller.js`)
- Pet profiles → MySQL pool: queries (evidence: `backend/controllers/animal.controller.js`)
- Profile and preferences → MySQL pool: reads and writes (evidence: `backend/controllers/profile.controller.js`)
- Profile interface → Profile routes: requests profile
- Care dashboard → Appointments: schedules
- Care dashboard → Care resources: browses
- Care dashboard → Medical records: manages records
