# kr0gha/petfosterconnect-projetoclock architecture

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

- Interactive diagram: https://gitdiagram.com/kr0gha/petfosterconnect-projetoclock
- Repository: https://github.com/kr0gha/petfosterconnect-projetoclock

## Overview

This is an animal-adoption platform: visitors browse animals and associations, while volunteers and associations authenticate and manage adoption applications. The graph covers the React client, Express API, and database-backed domain services. API routes and controller responsibilities are supported by sampled source and the SOURCE INDEX; client-to-API links are dashed because the relevant request code was not sampled. The README is empty.

Main entry points: [`client/src/App.jsx`](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/App.jsx) (Routes and shell), [`API/routers/animals.router.ts`](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/animals.router.ts) (Animal routes), [`API/routers/association.router.ts`](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/association.router.ts) (Association routes), [`API/routers/router.ts`](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/router.ts) (Route registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_client_entry["Client entry<br/>[main.jsx]"]
  node_app["Routes and shell<br/>[App.jsx]"]
  node_auth_ui["Sign-in and registration"]
  node_auth_state["Client auth state<br/>[AuthContext.jsx]"]
  node_animal_browse["Animal browsing<br/>[AnimalsPage.jsx]"]
  node_animal_detail["Animal detail<br/>[AnimalPage.jsx]"]
  node_association_browse["Association directory"]
  node_association_detail["Association profile"]
  node_offer_ui["Adoption applications<br/>[OfferPage.jsx]"]
  node_volunteer_ui["Volunteer profile<br/>[VolunteerPage.jsx]"]
end

subgraph group_api["API delivery"]
  node_api_entry["API server<br/>[index.ts]"]
  node_api_router["Route registry<br/>[router.ts]"]
  node_auth_router["Authentication routes<br/>[auth.router.ts]"]
  node_animal_router["Animal routes<br/>[animals.router.ts]"]
  node_association_router["Association routes"]
  node_offer_router["Offer routes<br/>[offer.router.ts]"]
  node_volunteer_router["Volunteer routes"]
  node_auth_middleware["Session verification<br/>[auth.middleware.ts]"]
  node_validation["Request validation<br/>[validate.ts]"]
end

subgraph group_domain["Adoption services"]
  node_auth_service["Authentication<br/>[authController.ts]"]
  node_animal_service["Animal management"]
  node_association_service["Association management"]
  node_offer_service["Application decisions<br/>[offerController.ts]"]
  node_volunteer_service["Volunteer management"]
end

subgraph group_infra["Data and integrations"]
  node_image_upload["Image upload"]
  node_database[("Prisma database access<br/>[client.ts]")]
end

node_visitor(("Visitor or member"))
node_imgbb["ImgBB"]

node_visitor -->|"uses"| node_client_entry
node_client_entry -->|"renders"| node_app
node_app -->|"routes to"| node_auth_ui
node_app -->|"routes to"| node_animal_browse
node_app -->|"routes to"| node_animal_detail
node_app -->|"routes to"| node_association_browse
node_app -->|"routes to"| node_association_detail
node_app -->|"routes to"| node_offer_ui
node_app -->|"routes to"| node_volunteer_ui
node_app -->|"reads auth"| node_auth_state
node_auth_ui -->|"updates session"| node_auth_state
node_api_entry -->|"mounts"| node_api_router
node_api_router -->|"registers"| node_auth_router
node_api_router -->|"registers"| node_animal_router
node_api_router -->|"registers"| node_association_router
node_api_router -->|"registers"| node_offer_router
node_api_router -->|"registers"| node_volunteer_router
node_auth_router -->|"dispatches"| node_auth_service
node_animal_router -->|"dispatches"| node_animal_service
node_association_router -->|"dispatches"| node_association_service
node_offer_router -->|"dispatches"| node_offer_service
node_volunteer_router -->|"dispatches"| node_volunteer_service
node_auth_router -->|"protects session lookup"| node_auth_middleware
node_animal_router -->|"protects writes"| node_auth_middleware
node_animal_router -->|"validates input"| node_validation
node_animal_router -->|"uploads images"| node_image_upload
node_association_router -->|"protects changes"| node_auth_middleware
node_association_router -->|"validates input"| node_validation
node_association_router -->|"uploads images"| node_image_upload
node_auth_router -->|"validates registration"| node_validation
node_auth_router -->|"uploads images"| node_image_upload
node_volunteer_router -->|"protects routes"| node_auth_middleware
node_volunteer_router -->|"validates input"| node_validation
node_volunteer_router -->|"uploads images"| node_image_upload
node_animal_service -->|"reads and writes"| node_database
node_association_service -->|"reads and writes"| node_database
node_offer_service -->|"updates applications and animals"| node_database
node_auth_service -->|"reads and writes"| node_database
node_volunteer_service -->|"reads and writes"| node_database
node_image_upload -->|"uploads image"| node_imgbb
node_animal_browse -.->|"requests animal data"| node_animal_router
node_animal_detail -.->|"requests animal data"| node_animal_router
node_association_browse -.->|"requests directory data"| node_association_router
node_association_detail -.->|"requests profile data"| node_association_router
node_auth_ui -.->|"submits credentials"| node_auth_router
node_offer_ui -.->|"manages applications"| node_offer_router
node_volunteer_ui -.->|"requests profile data"| node_volunteer_router

click node_client_entry "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/main.jsx"
click node_app "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/App.jsx"
click node_auth_ui "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/components/pages/ConnexionRegisterPage.jsx"
click node_auth_state "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/contexts/AuthContext.jsx"
click node_animal_browse "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/components/pages/AnimalsPage.jsx"
click node_animal_detail "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/components/pages/AnimalPage.jsx"
click node_association_browse "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/components/pages/AssociationsPage.jsx"
click node_association_detail "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/components/pages/AssociationDetailPage.jsx"
click node_offer_ui "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/components/pages/OfferPage.jsx"
click node_volunteer_ui "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/components/pages/VolunteerPage.jsx"
click node_api_entry "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/index.ts"
click node_api_router "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/router.ts"
click node_auth_router "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/auth.router.ts"
click node_animal_router "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/animals.router.ts"
click node_association_router "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/association.router.ts"
click node_offer_router "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/offer.router.ts"
click node_volunteer_router "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/volunteer.router.ts"
click node_auth_service "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/controllers/authController.ts"
click node_animal_service "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/controllers/animalController.ts"
click node_association_service "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/controllers/associationController.ts"
click node_offer_service "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/controllers/offerController.ts"
click node_volunteer_service "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/controllers/volunteerController.ts"
click node_auth_middleware "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/middleware/auth.middleware.ts"
click node_validation "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/middleware/validate.ts"
click node_image_upload "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/middleware/uploadToImgBB.middleware.ts"
click node_database "https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/prisma/client.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_client_entry,node_app,node_auth_ui,node_auth_state,node_animal_browse,node_animal_detail,node_association_browse,node_association_detail,node_offer_ui,node_volunteer_ui toneBlue
class node_api_entry,node_api_router,node_auth_router,node_animal_router,node_association_router,node_offer_router,node_volunteer_router,node_auth_middleware,node_validation toneAmber
class node_auth_service,node_animal_service,node_association_service,node_offer_service,node_volunteer_service toneMint
class node_image_upload,node_database toneRose
class node_visitor,node_imgbb toneIndigo
```

## Components

### Web client

- [Client entry](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/main.jsx): `client/src/main.jsx`
- [Routes and shell](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Sign-in and registration](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/components/pages/ConnexionRegisterPage.jsx): `client/src/components/pages/ConnexionRegisterPage.jsx`
- [Client auth state](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/contexts/AuthContext.jsx): `client/src/contexts/AuthContext.jsx`
- [Animal browsing](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/components/pages/AnimalsPage.jsx): `client/src/components/pages/AnimalsPage.jsx`
- [Animal detail](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/components/pages/AnimalPage.jsx): `client/src/components/pages/AnimalPage.jsx`
- [Association directory](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/components/pages/AssociationsPage.jsx): `client/src/components/pages/AssociationsPage.jsx`
- [Association profile](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/components/pages/AssociationDetailPage.jsx): `client/src/components/pages/AssociationDetailPage.jsx`
- [Adoption applications](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/components/pages/OfferPage.jsx): `client/src/components/pages/OfferPage.jsx`
- [Volunteer profile](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/client/src/components/pages/VolunteerPage.jsx): `client/src/components/pages/VolunteerPage.jsx`

### API delivery

- [API server](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/index.ts): `API/index.ts`
- [Route registry](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/router.ts): `API/routers/router.ts`
- [Authentication routes](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/auth.router.ts): `API/routers/auth.router.ts`
- [Animal routes](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/animals.router.ts): `API/routers/animals.router.ts`
- [Association routes](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/association.router.ts): `API/routers/association.router.ts`
- [Offer routes](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/offer.router.ts): `API/routers/offer.router.ts`
- [Volunteer routes](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/routers/volunteer.router.ts): `API/routers/volunteer.router.ts`
- [Session verification](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/middleware/auth.middleware.ts): `API/middleware/auth.middleware.ts`
- [Request validation](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/middleware/validate.ts): `API/middleware/validate.ts`

### Adoption services

- [Authentication](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/controllers/authController.ts): `API/controllers/authController.ts`
- [Animal management](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/controllers/animalController.ts): `API/controllers/animalController.ts`
- [Association management](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/controllers/associationController.ts): `API/controllers/associationController.ts`
- [Application decisions](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/controllers/offerController.ts): `API/controllers/offerController.ts`
- [Volunteer management](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/controllers/volunteerController.ts): `API/controllers/volunteerController.ts`

### Data and integrations

- [Image upload](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/middleware/uploadToImgBB.middleware.ts): `API/middleware/uploadToImgBB.middleware.ts`
- [Prisma database access](https://github.com/kr0gha/petfosterconnect-projetoclock/blob/main/API/prisma/client.ts): `API/prisma/client.ts`

### Other components

- **Visitor or member**
- **ImgBB**

## Connections

- Visitor or member → Client entry: uses
- Client entry → Routes and shell: renders (evidence: `client/src/main.jsx`)
- Routes and shell → Sign-in and registration: routes to (evidence: `client/src/App.jsx`)
- Routes and shell → Animal browsing: routes to (evidence: `client/src/App.jsx`)
- Routes and shell → Animal detail: routes to (evidence: `client/src/App.jsx`)
- Routes and shell → Association directory: routes to (evidence: `client/src/App.jsx`)
- Routes and shell → Association profile: routes to (evidence: `client/src/App.jsx`)
- Routes and shell → Adoption applications: routes to (evidence: `client/src/App.jsx`)
- Routes and shell → Volunteer profile: routes to (evidence: `client/src/App.jsx`)
- Routes and shell → Client auth state: reads auth (evidence: `client/src/App.jsx`)
- Sign-in and registration → Client auth state: updates session (evidence: `client/src/components/pages/ConnexionRegisterPage.jsx`)
- API server → Route registry: mounts (evidence: `API/index.ts`)
- Route registry → Authentication routes: registers (evidence: `API/routers/router.ts`)
- Route registry → Animal routes: registers (evidence: `API/routers/router.ts`)
- Route registry → Association routes: registers (evidence: `API/routers/router.ts`)
- Route registry → Offer routes: registers (evidence: `API/routers/router.ts`)
- Route registry → Volunteer routes: registers (evidence: `API/routers/router.ts`)
- Authentication routes → Authentication: dispatches (evidence: `API/routers/auth.router.ts`)
- Animal routes → Animal management: dispatches (evidence: `API/routers/animals.router.ts`)
- Association routes → Association management: dispatches (evidence: `API/routers/association.router.ts`)
- Offer routes → Application decisions: dispatches (evidence: `API/routers/offer.router.ts`)
- Volunteer routes → Volunteer management: dispatches (evidence: `API/routers/volunteer.router.ts`)
- Authentication routes → Session verification: protects session lookup (evidence: `API/routers/auth.router.ts`)
- Animal routes → Session verification: protects writes (evidence: `API/routers/animals.router.ts`)
- Animal routes → Request validation: validates input (evidence: `API/routers/animals.router.ts`)
- Animal routes → Image upload: uploads images (evidence: `API/routers/animals.router.ts`)
- Association routes → Session verification: protects changes (evidence: `API/routers/association.router.ts`)
- Association routes → Request validation: validates input (evidence: `API/routers/association.router.ts`)
- Association routes → Image upload: uploads images (evidence: `API/routers/association.router.ts`)
- Authentication routes → Request validation: validates registration (evidence: `API/routers/auth.router.ts`)
- Authentication routes → Image upload: uploads images (evidence: `API/routers/auth.router.ts`)
- Volunteer routes → Session verification: protects routes (evidence: `API/routers/volunteer.router.ts`)
- Volunteer routes → Request validation: validates input (evidence: `API/routers/volunteer.router.ts`)
- Volunteer routes → Image upload: uploads images (evidence: `API/routers/volunteer.router.ts`)
- Animal management → Prisma database access: reads and writes (evidence: `API/controllers/animalController.ts`)
- Association management → Prisma database access: reads and writes (evidence: `API/controllers/associationController.ts`)
- Application decisions → Prisma database access: updates applications and animals (evidence: `API/controllers/offerController.ts`)
- Authentication → Prisma database access: reads and writes (evidence: `API/controllers/authController.ts`)
- Volunteer management → Prisma database access: reads and writes (evidence: `API/controllers/volunteerController.ts`)
- Image upload → ImgBB: uploads image (evidence: `API/middleware/uploadToImgBB.middleware.ts`)
- Animal browsing → Animal routes: requests animal data
- Animal detail → Animal routes: requests animal data
- Association directory → Association routes: requests directory data
- Association profile → Association routes: requests profile data
- Sign-in and registration → Authentication routes: submits credentials
- Adoption applications → Offer routes: manages applications
- Volunteer profile → Volunteer routes: requests profile data
