# barathon-2i-tech/barathon_api architecture

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

- Interactive diagram: https://gitdiagram.com/barathon-2i-tech/barathon_api
- Repository: https://github.com/barathon-2i-tech/barathon_api

## Overview

This Laravel application exposes an API for a bar-and-event platform. Users authenticate and manage customer or professional profiles; owners manage establishments and events, customers can book events, and administrators handle validation and oversight. The graph groups the major domain stages and shared persistence/response layers. Route-to-controller mappings are supported by the API route index; some controller behavior is unsampled, so those capabilities are represented without speculative internal call chains.

Main entry points: [`routes/api.php`](https://github.com/barathon-2i-tech/barathon_api/blob/develop/routes/api.php) (API routes), [`app/Http/Controllers/EventController.php`](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/EventController.php) (Event management), [`app/Http/Controllers/EstablishmentController.php`](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/EstablishmentController.php) (Establishment management), [`app/Http/Controllers/BookingController.php`](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/BookingController.php) (Event bookings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["API access"]
  node_api_routes["API routes<br/>[api.php]"]
end

subgraph group_accounts["Accounts and administration"]
  node_auth["Authentication"]
  node_users[("User accounts<br/>[User.php]")]
  node_barathonien["Customer profiles"]
  node_owners["Owner profiles"]
  node_employees["Employee management"]
  node_administration["Administration"]
  node_mail["Mail delivery<br/>[MailController.php]"]
end

subgraph group_venues["Venues and discovery"]
  node_establishment["Establishment management"]
  node_categories["Category management"]
  node_category_links["Category assignments"]
  node_category_events["Event categories"]
  node_insee["Company lookup"]
end

subgraph group_events["Events and bookings"]
  node_events["Event management"]
  node_bookings["Event bookings"]
end

subgraph group_shared["Shared domain layer"]
  node_address[("Address records<br/>[Address.php]")]
  node_statuses[("Approval statuses<br/>[Status.php]")]
  node_responses["JSON responses<br/>[HttpResponses.php]"]
  node_event_model[("Event records<br/>[Event.php]")]
  node_establishment_model[("Establishment records<br/>[Establishment.php]")]
  node_category_model[("Category records<br/>[Category.php]")]
  node_booking_model[("Booking records<br/>[Booking.php]")]
end

node_client(("API client"))
node_insee_service{{"INSEE Sirene"}}

node_client -->|"sends requests"| node_api_routes
node_api_routes -->|"routes to"| node_auth
node_api_routes -->|"routes to"| node_barathonien
node_api_routes -->|"routes to"| node_owners
node_api_routes -->|"routes to"| node_employees
node_api_routes -->|"routes to"| node_administration
node_api_routes -->|"routes to"| node_establishment
node_api_routes -->|"routes to"| node_categories
node_api_routes -->|"routes to"| node_category_links
node_api_routes -->|"routes to"| node_category_events
node_api_routes -->|"routes to"| node_events
node_api_routes -->|"routes to"| node_bookings
node_api_routes -->|"routes to"| node_insee
node_api_routes -->|"routes to"| node_mail
node_auth -->|"authenticates users"| node_users
node_barathonien -->|"manages accounts"| node_users
node_owners -->|"manages accounts"| node_users
node_establishment -->|"reads and writes"| node_establishment_model
node_establishment -->|"updates address"| node_address
node_establishment -->|"sets approval status"| node_statuses
node_events -->|"reads and writes"| node_event_model
node_events -->|"loads venues"| node_establishment_model
node_events -->|"loads location"| node_address
node_events -->|"sets approval status"| node_statuses
node_events -->|"loads bookings"| node_booking_model
node_bookings -->|"reads and writes"| node_booking_model
node_bookings -->|"loads event"| node_event_model
node_categories -->|"manages categories"| node_category_model
node_category_links -->|"assigns categories"| node_establishment_model
node_category_events -.->|"assigns categories"| node_category_model
node_insee -->|"queries company data"| node_insee_service
node_administration -.->|"manages approval"| node_statuses
node_establishment -.->|"formats results"| node_responses
node_events -->|"formats results"| node_responses
node_bookings -.->|"formats results"| node_responses

click node_api_routes "https://github.com/barathon-2i-tech/barathon_api/blob/develop/routes/api.php"
click node_auth "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/ApiAuthController.php"
click node_users "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Models/User.php"
click node_barathonien "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/BarathonienController.php"
click node_owners "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/OwnerController.php"
click node_employees "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/EmployeeController.php"
click node_administration "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/AdministratorController.php"
click node_establishment "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/EstablishmentController.php"
click node_address "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Models/Address.php"
click node_categories "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/CategoryController.php"
click node_category_links "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/CategoryEstablishmentController.php"
click node_category_events "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/CategoryEventController.php"
click node_events "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/EventController.php"
click node_bookings "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/BookingController.php"
click node_statuses "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Models/Status.php"
click node_insee "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/InseeController.php"
click node_mail "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/MailController.php"
click node_responses "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Traits/HttpResponses.php"
click node_event_model "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Models/Event.php"
click node_establishment_model "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Models/Establishment.php"
click node_category_model "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Models/Category.php"
click node_booking_model "https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Models/Booking.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_api_routes,node_client toneBlue
class node_auth,node_users,node_barathonien,node_owners,node_employees,node_administration,node_mail toneAmber
class node_establishment,node_categories,node_category_links,node_category_events,node_insee toneMint
class node_events,node_bookings toneRose
class node_address,node_statuses,node_responses,node_event_model,node_establishment_model,node_category_model,node_booking_model,node_insee_service toneIndigo
```

## Components

### API access

- [API routes](https://github.com/barathon-2i-tech/barathon_api/blob/develop/routes/api.php): `routes/api.php`

### Accounts and administration

- [Authentication](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/ApiAuthController.php): `app/Http/Controllers/ApiAuthController.php`
- [User accounts](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Models/User.php): `app/Models/User.php`
- [Customer profiles](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/BarathonienController.php): `app/Http/Controllers/BarathonienController.php`
- [Owner profiles](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/OwnerController.php): `app/Http/Controllers/OwnerController.php`
- [Employee management](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/EmployeeController.php): `app/Http/Controllers/EmployeeController.php`
- [Administration](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/AdministratorController.php): `app/Http/Controllers/AdministratorController.php`
- [Mail delivery](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/MailController.php): `app/Http/Controllers/MailController.php`

### Venues and discovery

- [Establishment management](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/EstablishmentController.php): `app/Http/Controllers/EstablishmentController.php`
- [Category management](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/CategoryController.php): `app/Http/Controllers/CategoryController.php`
- [Category assignments](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/CategoryEstablishmentController.php): `app/Http/Controllers/CategoryEstablishmentController.php`
- [Event categories](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/CategoryEventController.php): `app/Http/Controllers/CategoryEventController.php`
- [Company lookup](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/InseeController.php): `app/Http/Controllers/InseeController.php`

### Events and bookings

- [Event management](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/EventController.php): `app/Http/Controllers/EventController.php`
- [Event bookings](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Http/Controllers/BookingController.php): `app/Http/Controllers/BookingController.php`

### Shared domain layer

- [Address records](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Models/Address.php): `app/Models/Address.php`
- [Approval statuses](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Models/Status.php): `app/Models/Status.php`
- [JSON responses](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Traits/HttpResponses.php): `app/Traits/HttpResponses.php`
- [Event records](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Models/Event.php): `app/Models/Event.php`
- [Establishment records](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Models/Establishment.php): `app/Models/Establishment.php`
- [Category records](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Models/Category.php): `app/Models/Category.php`
- [Booking records](https://github.com/barathon-2i-tech/barathon_api/blob/develop/app/Models/Booking.php): `app/Models/Booking.php`

### Other components

- **API client**
- **INSEE Sirene**

## Connections

- API client → API routes: sends requests (evidence: `routes/api.php`)
- API routes → Authentication: routes to (evidence: `routes/api.php`)
- API routes → Customer profiles: routes to (evidence: `routes/api.php`)
- API routes → Owner profiles: routes to (evidence: `routes/api.php`)
- API routes → Employee management: routes to (evidence: `routes/api.php`)
- API routes → Administration: routes to (evidence: `routes/api.php`)
- API routes → Establishment management: routes to (evidence: `routes/api.php`)
- API routes → Category management: routes to (evidence: `routes/api.php`)
- API routes → Category assignments: routes to (evidence: `routes/api.php`)
- API routes → Event categories: routes to (evidence: `routes/api.php`)
- API routes → Event management: routes to (evidence: `routes/api.php`)
- API routes → Event bookings: routes to (evidence: `routes/api.php`)
- API routes → Company lookup: routes to (evidence: `routes/api.php`)
- API routes → Mail delivery: routes to (evidence: `routes/api.php`)
- Authentication → User accounts: authenticates users (evidence: `app/Http/Controllers/ApiAuthController.php`)
- Customer profiles → User accounts: manages accounts (evidence: `app/Http/Controllers/BarathonienController.php`)
- Owner profiles → User accounts: manages accounts (evidence: `app/Http/Controllers/OwnerController.php`)
- Establishment management → Establishment records: reads and writes (evidence: `app/Http/Controllers/EstablishmentController.php`)
- Establishment management → Address records: updates address (evidence: `app/Http/Controllers/EstablishmentController.php`)
- Establishment management → Approval statuses: sets approval status (evidence: `app/Http/Controllers/EstablishmentController.php`)
- Event management → Event records: reads and writes (evidence: `app/Http/Controllers/EventController.php`)
- Event management → Establishment records: loads venues (evidence: `app/Http/Controllers/EventController.php`)
- Event management → Address records: loads location (evidence: `app/Http/Controllers/EventController.php`)
- Event management → Approval statuses: sets approval status (evidence: `app/Http/Controllers/EventController.php`)
- Event management → Booking records: loads bookings (evidence: `app/Http/Controllers/EventController.php`)
- Event bookings → Booking records: reads and writes (evidence: `app/Http/Controllers/BookingController.php`)
- Event bookings → Event records: loads event (evidence: `app/Http/Controllers/BookingController.php`)
- Category management → Category records: manages categories (evidence: `app/Http/Controllers/CategoryController.php`)
- Category assignments → Establishment records: assigns categories (evidence: `app/Http/Controllers/CategoryEstablishmentController.php`)
- Event categories → Category records: assigns categories
- Company lookup → INSEE Sirene: queries company data (evidence: `app/Http/Controllers/InseeController.php`)
- Administration → Approval statuses: manages approval
- Establishment management → JSON responses: formats results (evidence: `app/Http/Controllers/EstablishmentController.php`)
- Event management → JSON responses: formats results (evidence: `app/Http/Controllers/EventController.php`)
- Event bookings → JSON responses: formats results (evidence: `app/Http/Controllers/BookingController.php`)
