# dcdiegocortes/sprint05_api_lv01_groncho architecture

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

- Interactive diagram: https://gitdiagram.com/dcdiegocortes/sprint05_api_lv01_groncho
- Repository: https://github.com/dcdiegocortes/sprint05_api_lv01_groncho

## Overview

Grôncho is a Laravel REST API for money-free clothing swaps. A user registers or logs in, then manages a profile and clothing/aesthetic listings; swipes can produce mutual matches, which participants use to request, accept, and finish exchanges. Finishing an exchange transfers item ownership, while rankings summarize activity. The map includes documented authorization and image-management capabilities. Relationships are limited to routes, calls, or capabilities evidenced by the excerpts, SOURCE INDEX, or README; unsampled subsystems are represented at their supported directory paths.

Main entry points: [`routes/api.php`](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/routes/api.php) (API routes), [`app/Models`](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/tree/develop/app/Models) (Domain records), [`app/Http/Controllers/RankingController.php`](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/RankingController.php) (Rankings), [`app/Http/Controllers/ExchangeController.php`](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/ExchangeController.php) (Exchange requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API and identity"]
  node_api["API routes<br/>[api.php]"]
  node_auth["Token authentication<br/>[AuthController.php]"]
end

subgraph group_community["Profiles and discovery"]
  node_profile["Profile management"]
  node_users["User administration<br/>[UserController.php]"]
  node_universe["Aesthetic profiles"]
  node_universe_images["Profile images"]
  node_swipes["Swiping"]
  node_rankings["Rankings"]
  node_ranking_logic["Ranking calculations<br/>[RankingService.php]"]
end

subgraph group_catalog["Swap catalog"]
  node_items["Garment listings<br/>[ItemController.php]"]
  node_item_images["Garment images"]
end

subgraph group_exchange["Matching and exchange"]
  node_matches["Mutual matches"]
  node_match_logic["Match generation<br/>[MatchService.php]"]
  node_exchanges["Exchange requests"]
  node_exchange_logic["Exchange lifecycle"]
end

subgraph group_access["Access and persistence"]
  node_authorization["Resource policies"]
  node_admin_guard["Admin guard"]
  node_records["Domain records"]
end

node_client(("API client"))
node_mysql[("MySQL database")]

node_client -->|"sends requests"| node_api
node_api -->|"routes auth"| node_auth
node_api -->|"routes profile"| node_profile
node_api -->|"routes users"| node_users
node_api -->|"routes profiles"| node_universe
node_api -->|"routes images"| node_universe_images
node_api -->|"routes swipes"| node_swipes
node_api -->|"routes matches"| node_matches
node_api -->|"routes items"| node_items
node_api -->|"routes images"| node_item_images
node_api -->|"routes rankings"| node_rankings
node_api -->|"routes exchanges"| node_exchanges
node_auth -->|"creates users"| node_records
node_swipes -->|"delegates matching"| node_match_logic
node_rankings -->|"requests rankings"| node_ranking_logic
node_exchanges -->|"applies lifecycle"| node_exchange_logic
node_exchanges -->|"creates exchanges"| node_records
node_items -->|"manages items"| node_records
node_exchange_logic -->|"updates items"| node_records
node_exchange_logic -->|"updates exchanges"| node_records
node_rankings -.->|"enforces permissions"| node_authorization
node_api -.->|"guards admin routes"| node_admin_guard
node_records -->|"persists records"| node_mysql

click node_api "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/routes/api.php"
click node_auth "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/AuthController.php"
click node_profile "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/ProfileController.php"
click node_users "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/UserController.php"
click node_universe "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/UniverseController.php"
click node_universe_images "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/UniverseImageController.php"
click node_swipes "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/SwipeController.php"
click node_matches "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/MatchController.php"
click node_match_logic "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Services/MatchService.php"
click node_items "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/ItemController.php"
click node_item_images "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/ItemImageController.php"
click node_rankings "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/RankingController.php"
click node_ranking_logic "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Services/RankingService.php"
click node_exchanges "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/ExchangeController.php"
click node_exchange_logic "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Services/ExchangeService.php"
click node_authorization "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/tree/develop/app/Policies"
click node_admin_guard "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Middleware/EnsureUserIsAdmin.php"
click node_records "https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/tree/develop/app/Models"

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_api,node_auth,node_client toneBlue
class node_profile,node_users,node_universe,node_universe_images,node_swipes,node_rankings,node_ranking_logic,node_mysql toneAmber
class node_items,node_item_images toneMint
class node_matches,node_match_logic,node_exchanges,node_exchange_logic toneRose
class node_authorization,node_admin_guard,node_records toneIndigo
```

## Components

### API and identity

- [API routes](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/routes/api.php): `routes/api.php`
- [Token authentication](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/AuthController.php): `app/Http/Controllers/AuthController.php`

### Profiles and discovery

- [Profile management](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/ProfileController.php): `app/Http/Controllers/ProfileController.php`
- [User administration](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/UserController.php): `app/Http/Controllers/UserController.php`
- [Aesthetic profiles](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/UniverseController.php): `app/Http/Controllers/UniverseController.php`
- [Profile images](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/UniverseImageController.php): `app/Http/Controllers/UniverseImageController.php`
- [Swiping](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/SwipeController.php): `app/Http/Controllers/SwipeController.php`
- [Rankings](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/RankingController.php): `app/Http/Controllers/RankingController.php`
- [Ranking calculations](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Services/RankingService.php): `app/Services/RankingService.php`

### Swap catalog

- [Garment listings](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/ItemController.php): `app/Http/Controllers/ItemController.php`
- [Garment images](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/ItemImageController.php): `app/Http/Controllers/ItemImageController.php`

### Matching and exchange

- [Mutual matches](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/MatchController.php): `app/Http/Controllers/MatchController.php`
- [Match generation](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Services/MatchService.php): `app/Services/MatchService.php`
- [Exchange requests](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Controllers/ExchangeController.php): `app/Http/Controllers/ExchangeController.php`
- [Exchange lifecycle](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Services/ExchangeService.php): `app/Services/ExchangeService.php`

### Access and persistence

- [Resource policies](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/tree/develop/app/Policies): `app/Policies`
- [Admin guard](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/blob/develop/app/Http/Middleware/EnsureUserIsAdmin.php): `app/Http/Middleware/EnsureUserIsAdmin.php`
- [Domain records](https://github.com/dcdiegocortes/sprint05_api_lv01_groncho/tree/develop/app/Models): `app/Models`

### Other components

- **API client**
- **MySQL database**

## Connections

- API client → API routes: sends requests
- API routes → Token authentication: routes auth (evidence: `routes/api.php`)
- API routes → Profile management: routes profile (evidence: `routes/api.php`)
- API routes → User administration: routes users (evidence: `routes/api.php`)
- API routes → Aesthetic profiles: routes profiles (evidence: `routes/api.php`)
- API routes → Profile images: routes images (evidence: `routes/api.php`)
- API routes → Swiping: routes swipes (evidence: `routes/api.php`)
- API routes → Mutual matches: routes matches (evidence: `routes/api.php`)
- API routes → Garment listings: routes items (evidence: `routes/api.php`)
- API routes → Garment images: routes images (evidence: `routes/api.php`)
- API routes → Rankings: routes rankings (evidence: `routes/api.php`)
- API routes → Exchange requests: routes exchanges (evidence: `routes/api.php`)
- Token authentication → Domain records: creates users (evidence: `app/Http/Controllers/AuthController.php`)
- Swiping → Match generation: delegates matching (evidence: `app/Http/Controllers/SwipeController.php`)
- Rankings → Ranking calculations: requests rankings (evidence: `app/Http/Controllers/RankingController.php`)
- Exchange requests → Exchange lifecycle: applies lifecycle (evidence: `app/Http/Controllers/ExchangeController.php`)
- Exchange requests → Domain records: creates exchanges (evidence: `app/Http/Controllers/ExchangeController.php`)
- Garment listings → Domain records: manages items (evidence: `app/Http/Controllers/ItemController.php`)
- Exchange lifecycle → Domain records: updates items (evidence: `app/Services/ExchangeService.php`)
- Exchange lifecycle → Domain records: updates exchanges (evidence: `app/Services/ExchangeService.php`)
- Rankings → Resource policies: enforces permissions
- API routes → Admin guard: guards admin routes
- Domain records → MySQL database: persists records
