# rowannnk/foodshare architecture

> Architecture diagram of the GitHub repository rowannnk/foodshare, 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/rowannnk/foodshare
- Repository: https://github.com/rowannnk/foodshare

## Overview

FoodLoop is a Laravel surplus-food donation and reservation application. Donors publish surplus food; recipients browse listings, reserve quantities, and coordinate collection, while visitors browse public pages and admins manage platform data. The graph preserves these documented stages and the authentication/profile workflow, plus the model-backed data layer. The tree and excerpts do not include implementation for several documented domain areas, so those are represented at their enclosing controller directory; their links rely on README statements rather than inspected controller code.

Main entry points: [`routes/web.php`](https://github.com/rowannnk/foodshare/blob/main/routes/web.php) (Web routes), [`app/Http/Controllers`](https://github.com/rowannnk/foodshare/tree/main/app/Http/Controllers) (Admin management), [`app/Models/FoodListing.php`](https://github.com/rowannnk/foodshare/blob/main/app/Models/FoodListing.php) (Food listing), [`routes/auth.php`](https://github.com/rowannnk/foodshare/blob/main/routes/auth.php) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_welcome["Public pages<br/>[welcome.blade.php]"]
  node_welcome_controller["Welcome handler"]
end

subgraph group_identity["Identity and profile"]
  node_auth_routes["Auth routes<br/>[auth.php]"]
  node_auth_sessions["Login and registration"]
  node_registration["Registration"]
  node_login_validation["Login validation<br/>[LoginRequest.php]"]
  node_verification["Email verification"]
  node_profile["Profile management"]
  node_profile_validation["Profile validation"]
end

subgraph group_food["Food exchange"]
  node_org_management["Organizations"]
  node_listing_management["Food listings"]
  node_reservation_management["Reservations"]
  node_pickup_management["Pickup confirmation"]
  node_admin_management["Admin management"]
end

subgraph group_data["Domain data"]
  node_domain_models["Domain models"]
  node_user_model["User<br/>[User.php]"]
  node_org_model["Organization<br/>[Organization.php]"]
  node_listing_model["Food listing<br/>[FoodListing.php]"]
  node_category_model["Food category<br/>[FoodCategory.php]"]
  node_reservation_model["Reservation<br/>[Reservation.php]"]
  node_pickup_model["Pickup<br/>[Pickup.php]"]
  node_database[("SQLite database")]
end

node_visitor(("Visitor"))
node_donor(("Donor"))
node_recipient(("Recipient"))
node_admin(("Admin"))

node_visitor -->|"requests pages"| node_web_routes
node_donor -->|"uses platform"| node_web_routes
node_recipient -->|"uses platform"| node_web_routes
node_admin -->|"uses platform"| node_web_routes
node_web_routes -->|"routes home"| node_welcome_controller
node_welcome_controller -.->|"renders"| node_welcome
node_web_routes -->|"loads auth routes"| node_auth_routes
node_auth_routes -->|"dispatches login"| node_auth_sessions
node_auth_routes -->|"dispatches registration"| node_registration
node_auth_routes -->|"dispatches verification"| node_verification
node_auth_sessions -->|"authenticates with"| node_login_validation
node_registration -->|"creates account"| node_user_model
node_web_routes -->|"routes profile"| node_profile
node_profile -->|"validates updates"| node_profile_validation
node_donor -->|"manages organizations"| node_org_management
node_donor -->|"publishes listings"| node_listing_management
node_recipient -->|"browses listings"| node_listing_management
node_recipient -->|"reserves quantity"| node_reservation_management
node_donor -->|"confirms collection"| node_pickup_management
node_admin -->|"manages platform"| node_admin_management
node_org_management -.->|"manages records"| node_org_model
node_listing_management -.->|"manages records"| node_listing_model
node_listing_management -->|"uses categories"| node_category_model
node_reservation_management -.->|"manages records"| node_reservation_model
node_pickup_management -.->|"records collection"| node_pickup_model
node_admin_management -->|"manages users"| node_user_model
node_admin_management -->|"manages organizations"| node_org_model
node_admin_management -->|"manages categories"| node_category_model
node_admin_management -->|"manages listings"| node_listing_model
node_user_model -->|"has organizations"| node_org_model
node_org_model -->|"has listings"| node_listing_model
node_listing_model -->|"belongs to category"| node_category_model
node_listing_model -->|"has reservations"| node_reservation_model
node_reservation_model -->|"has pickup"| node_pickup_model
node_domain_models -.->|"persists records"| node_database

click node_web_routes "https://github.com/rowannnk/foodshare/blob/main/routes/web.php"
click node_welcome "https://github.com/rowannnk/foodshare/blob/main/resources/views/welcome.blade.php"
click node_welcome_controller "https://github.com/rowannnk/foodshare/blob/main/app/Http/Controllers/WelcomeController.php"
click node_auth_routes "https://github.com/rowannnk/foodshare/blob/main/routes/auth.php"
click node_auth_sessions "https://github.com/rowannnk/foodshare/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
click node_registration "https://github.com/rowannnk/foodshare/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php"
click node_login_validation "https://github.com/rowannnk/foodshare/blob/main/app/Http/Requests/Auth/LoginRequest.php"
click node_verification "https://github.com/rowannnk/foodshare/blob/main/app/Http/Controllers/Auth/VerifyEmailController.php"
click node_profile "https://github.com/rowannnk/foodshare/blob/main/app/Http/Controllers/Userzone/ProfileController.php"
click node_profile_validation "https://github.com/rowannnk/foodshare/blob/main/app/Http/Requests/ProfileUpdateRequest.php"
click node_org_management "https://github.com/rowannnk/foodshare/tree/main/app/Http/Controllers"
click node_listing_management "https://github.com/rowannnk/foodshare/tree/main/app/Http/Controllers"
click node_reservation_management "https://github.com/rowannnk/foodshare/tree/main/app/Http/Controllers"
click node_pickup_management "https://github.com/rowannnk/foodshare/tree/main/app/Http/Controllers"
click node_admin_management "https://github.com/rowannnk/foodshare/tree/main/app/Http/Controllers"
click node_domain_models "https://github.com/rowannnk/foodshare/tree/main/app/Models"
click node_user_model "https://github.com/rowannnk/foodshare/blob/main/app/Models/User.php"
click node_org_model "https://github.com/rowannnk/foodshare/blob/main/app/Models/Organization.php"
click node_listing_model "https://github.com/rowannnk/foodshare/blob/main/app/Models/FoodListing.php"
click node_category_model "https://github.com/rowannnk/foodshare/blob/main/app/Models/FoodCategory.php"
click node_reservation_model "https://github.com/rowannnk/foodshare/blob/main/app/Models/Reservation.php"
click node_pickup_model "https://github.com/rowannnk/foodshare/blob/main/app/Models/Pickup.php"

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_web_routes,node_welcome,node_welcome_controller toneBlue
class node_auth_routes,node_auth_sessions,node_registration,node_login_validation,node_verification,node_profile,node_profile_validation toneAmber
class node_org_management,node_listing_management,node_reservation_management,node_pickup_management,node_admin_management toneMint
class node_domain_models,node_user_model,node_org_model,node_listing_model,node_category_model,node_reservation_model,node_pickup_model,node_database toneRose
class node_visitor,node_donor,node_recipient,node_admin toneIndigo
```

## Components

### Web entry

- [Web routes](https://github.com/rowannnk/foodshare/blob/main/routes/web.php): `routes/web.php`
- [Public pages](https://github.com/rowannnk/foodshare/blob/main/resources/views/welcome.blade.php): `resources/views/welcome.blade.php`
- [Welcome handler](https://github.com/rowannnk/foodshare/blob/main/app/Http/Controllers/WelcomeController.php): `app/Http/Controllers/WelcomeController.php`

### Identity and profile

- [Auth routes](https://github.com/rowannnk/foodshare/blob/main/routes/auth.php): `routes/auth.php`
- [Login and registration](https://github.com/rowannnk/foodshare/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php): `app/Http/Controllers/Auth/AuthenticatedSessionController.php`
- [Registration](https://github.com/rowannnk/foodshare/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php): `app/Http/Controllers/Auth/RegisteredUserController.php`
- [Login validation](https://github.com/rowannnk/foodshare/blob/main/app/Http/Requests/Auth/LoginRequest.php): `app/Http/Requests/Auth/LoginRequest.php`
- [Email verification](https://github.com/rowannnk/foodshare/blob/main/app/Http/Controllers/Auth/VerifyEmailController.php): `app/Http/Controllers/Auth/VerifyEmailController.php`
- [Profile management](https://github.com/rowannnk/foodshare/blob/main/app/Http/Controllers/Userzone/ProfileController.php): `app/Http/Controllers/Userzone/ProfileController.php`
- [Profile validation](https://github.com/rowannnk/foodshare/blob/main/app/Http/Requests/ProfileUpdateRequest.php): `app/Http/Requests/ProfileUpdateRequest.php`

### Food exchange

- [Organizations](https://github.com/rowannnk/foodshare/tree/main/app/Http/Controllers): `app/Http/Controllers`
- [Food listings](https://github.com/rowannnk/foodshare/tree/main/app/Http/Controllers): `app/Http/Controllers`
- [Reservations](https://github.com/rowannnk/foodshare/tree/main/app/Http/Controllers): `app/Http/Controllers`
- [Pickup confirmation](https://github.com/rowannnk/foodshare/tree/main/app/Http/Controllers): `app/Http/Controllers`
- [Admin management](https://github.com/rowannnk/foodshare/tree/main/app/Http/Controllers): `app/Http/Controllers`

### Domain data

- [Domain models](https://github.com/rowannnk/foodshare/tree/main/app/Models): `app/Models`
- [User](https://github.com/rowannnk/foodshare/blob/main/app/Models/User.php): `app/Models/User.php`
- [Organization](https://github.com/rowannnk/foodshare/blob/main/app/Models/Organization.php): `app/Models/Organization.php`
- [Food listing](https://github.com/rowannnk/foodshare/blob/main/app/Models/FoodListing.php): `app/Models/FoodListing.php`
- [Food category](https://github.com/rowannnk/foodshare/blob/main/app/Models/FoodCategory.php): `app/Models/FoodCategory.php`
- [Reservation](https://github.com/rowannnk/foodshare/blob/main/app/Models/Reservation.php): `app/Models/Reservation.php`
- [Pickup](https://github.com/rowannnk/foodshare/blob/main/app/Models/Pickup.php): `app/Models/Pickup.php`
- **SQLite database**

### Other components

- **Visitor**
- **Donor**
- **Recipient**
- **Admin**

## Connections

- Visitor → Web routes: requests pages (evidence: `README.md`)
- Donor → Web routes: uses platform (evidence: `README.md`)
- Recipient → Web routes: uses platform (evidence: `README.md`)
- Admin → Web routes: uses platform (evidence: `README.md`)
- Web routes → Welcome handler: routes home (evidence: `routes/web.php`)
- Welcome handler → Public pages: renders
- Web routes → Auth routes: loads auth routes (evidence: `routes/web.php`)
- Auth routes → Login and registration: dispatches login (evidence: `routes/auth.php`)
- Auth routes → Registration: dispatches registration (evidence: `routes/auth.php`)
- Auth routes → Email verification: dispatches verification (evidence: `routes/auth.php`)
- Login and registration → Login validation: authenticates with (evidence: `app/Http/Controllers/Auth/AuthenticatedSessionController.php`)
- Registration → User: creates account (evidence: `app/Http/Controllers/Auth/RegisteredUserController.php`)
- Web routes → Profile management: routes profile (evidence: `routes/web.php`)
- Profile management → Profile validation: validates updates (evidence: `app/Http/Controllers/Userzone/ProfileController.php`)
- Donor → Organizations: manages organizations (evidence: `README.md`)
- Donor → Food listings: publishes listings (evidence: `README.md`)
- Recipient → Food listings: browses listings (evidence: `README.md`)
- Recipient → Reservations: reserves quantity (evidence: `README.md`)
- Donor → Pickup confirmation: confirms collection (evidence: `README.md`)
- Admin → Admin management: manages platform (evidence: `README.md`)
- Organizations → Organization: manages records
- Food listings → Food listing: manages records
- Food listings → Food category: uses categories (evidence: `README.md`)
- Reservations → Reservation: manages records
- Pickup confirmation → Pickup: records collection
- Admin management → User: manages users (evidence: `README.md`)
- Admin management → Organization: manages organizations (evidence: `README.md`)
- Admin management → Food category: manages categories (evidence: `README.md`)
- Admin management → Food listing: manages listings (evidence: `README.md`)
- User → Organization: has organizations (evidence: `app/Models/User.php`)
- Organization → Food listing: has listings (evidence: `app/Models/Organization.php`)
- Food listing → Food category: belongs to category (evidence: `app/Models/FoodListing.php`)
- Food listing → Reservation: has reservations (evidence: `app/Models/FoodListing.php`)
- Reservation → Pickup: has pickup (evidence: `app/Models/Reservation.php`)
- Domain models → SQLite database: persists records
