# barathon-2i-tech/barathon_admin architecture

> Architecture diagram of the GitHub repository barathon-2i-tech/barathon_admin, 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_admin
- Repository: https://github.com/barathon-2i-tech/barathon_admin

## Overview

Barathon Administration is a React admin console. Administrators sign in through the login page; authentication stores the returned user session and protects the admin routes. From there, they review dashboard validation counts and manage users, establishments, events, and categories, including validation and soft-delete/restore actions. The messaging and profile routes are also present, though their implementation detail is not shown. Resource pages use datagrids and forms, with API calls configured through a shared Axios client. Relationships below are limited to route/import evidence and excerpted API calls; unsampled details are not inferred.

Main entry points: [`src/App.jsx`](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/App.jsx) (Route composition), [`src/utils/axiosUrl.jsx`](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/utils/axiosUrl.jsx) (HTTP API client), [`src/components/User/OwnerValidationForm.jsx`](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/User/OwnerValidationForm.jsx) (Owner validation), [`src/components/Establishment/EstablishmentValidationForm.jsx`](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Establishment/EstablishmentValidationForm.jsx) (Establishment validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and access"]
  node_app["Route composition<br/>[App.jsx]"]
  node_login["Administrator login<br/>[LoginPage.jsx]"]
  node_auth["Session and auth<br/>[useAuth.jsx]"]
  node_guard["Protected admin layout"]
end

subgraph group_review["Review dashboard"]
  node_dashboard["Validation dashboard<br/>[DashboardPage.jsx]"]
  node_validation_banner["Validation summary"]
end

subgraph group_resources["Resource management"]
  node_users_page["User administration<br/>[UsersPage.jsx]"]
  node_users["User records and forms<br/>[UserDatagrid.jsx]"]
  node_owner_review["Owner validation"]
  node_establishments_page["Establishments"]
  node_establishments["Establishment records"]
  node_establishment_review["Establishment validation"]
  node_events_page["Events<br/>[EventsPage.jsx]"]
  node_events["Event records<br/>[EventDatagrid.jsx]"]
  node_event_review["Event validation"]
  node_tags_page["Category management<br/>[TagsPage.jsx]"]
  node_categories["Category records and forms"]
  node_messaging["Messaging route<br/>[MessagingPage.jsx]"]
  node_profile["Profile route<br/>[ProfilePage.jsx]"]
end

subgraph group_shared["Shared services"]
  node_storage["Session storage"]
  node_api_client["HTTP API client<br/>[axiosUrl.jsx]"]
  node_validation_form["Validation form controls<br/>[ValidationForm.jsx]"]
  node_list_field["Validation display fields"]
  node_datagrid_utils["Grid status helpers<br/>[datagridUtils.jsx]"]
end

node_administrator(("Administrator"))
node_backend{{"Barathon API"}}

node_administrator -->|"opens console"| node_app
node_app -->|"routes to"| node_login
node_app -->|"protects routes"| node_guard
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_users_page
node_app -->|"routes to"| node_establishments_page
node_app -->|"routes to"| node_events_page
node_app -->|"routes to"| node_tags_page
node_app -->|"routes to"| node_messaging
node_app -->|"routes to"| node_profile
node_administrator -->|"submits credentials"| node_login
node_login -->|"posts login"| node_api_client
node_api_client -->|"sends request"| node_backend
node_login -->|"passes login data"| node_auth
node_auth -->|"persists user"| node_storage
node_auth -->|"posts logout"| node_api_client
node_guard -->|"checks session"| node_auth
node_dashboard -->|"renders"| node_validation_banner
node_validation_banner -->|"loads counts"| node_api_client
node_users_page -->|"renders"| node_users
node_users -->|"loads user records"| node_api_client
node_users -->|"opens validation"| node_owner_review
node_owner_review -->|"updates validation"| node_api_client
node_establishments_page -->|"renders"| node_establishments
node_establishments -->|"opens validation"| node_establishment_review
node_establishment_review -->|"loads and validates"| node_api_client
node_events_page -->|"renders"| node_events
node_events -->|"loads event records"| node_api_client
node_events -->|"opens validation"| node_event_review
node_event_review -->|"updates validation"| node_api_client
node_tags_page -->|"renders"| node_categories
node_categories -->|"loads categories"| node_api_client
node_establishment_review -->|"renders"| node_validation_form
node_establishment_review -->|"renders details"| node_list_field
node_owner_review -->|"renders"| node_validation_form
node_owner_review -->|"renders details"| node_list_field
node_events -->|"uses status helper"| node_datagrid_utils
node_establishments -->|"uses grid helper"| node_datagrid_utils

click node_app "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/App.jsx"
click node_login "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/authentification/LoginPage.jsx"
click node_auth "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/hooks/useAuth.jsx"
click node_storage "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/hooks/useSessionStorage.jsx"
click node_guard "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/ProtectedLayout.jsx"
click node_dashboard "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/admin/DashboardPage.jsx"
click node_validation_banner "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Dashboard/ValidationBanner.jsx"
click node_users_page "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/admin/UsersPage.jsx"
click node_users "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/User/UserDatagrid.jsx"
click node_owner_review "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/User/OwnerValidationForm.jsx"
click node_establishments_page "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/admin/EstablishmentsPage.jsx"
click node_establishments "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Establishment/EstablishmentDatagrid.jsx"
click node_establishment_review "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Establishment/EstablishmentValidationForm.jsx"
click node_events_page "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/admin/EventsPage.jsx"
click node_events "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Event/EventDatagrid.jsx"
click node_event_review "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Event/EventValidationForm.jsx"
click node_tags_page "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/admin/TagsPage.jsx"
click node_categories "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Category/CategoryDatagrid.jsx"
click node_messaging "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/admin/MessagingPage.jsx"
click node_profile "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/admin/ProfilePage.jsx"
click node_api_client "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/utils/axiosUrl.jsx"
click node_validation_form "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Form/ValidationForm.jsx"
click node_list_field "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Form/ListValidationField.jsx"
click node_datagrid_utils "https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Datagrid/datagridUtils.jsx"

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_app,node_login,node_auth,node_guard toneBlue
class node_dashboard,node_validation_banner toneAmber
class node_users_page,node_users,node_owner_review,node_establishments_page,node_establishments,node_establishment_review,node_events_page,node_events,node_event_review,node_tags_page,node_categories,node_messaging,node_profile,node_backend toneMint
class node_storage,node_api_client,node_validation_form,node_list_field,node_datagrid_utils toneRose
class node_administrator toneIndigo
```

## Components

### App and access

- [Route composition](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/App.jsx): `src/App.jsx`
- [Administrator login](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/authentification/LoginPage.jsx): `src/pages/authentification/LoginPage.jsx`
- [Session and auth](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/hooks/useAuth.jsx): `src/hooks/useAuth.jsx`
- [Protected admin layout](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/ProtectedLayout.jsx): `src/components/ProtectedLayout.jsx`

### Review dashboard

- [Validation dashboard](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/admin/DashboardPage.jsx): `src/pages/admin/DashboardPage.jsx`
- [Validation summary](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Dashboard/ValidationBanner.jsx): `src/components/Dashboard/ValidationBanner.jsx`

### Resource management

- [User administration](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/admin/UsersPage.jsx): `src/pages/admin/UsersPage.jsx`
- [User records and forms](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/User/UserDatagrid.jsx): `src/components/User/UserDatagrid.jsx`
- [Owner validation](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/User/OwnerValidationForm.jsx): `src/components/User/OwnerValidationForm.jsx`
- [Establishments](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/admin/EstablishmentsPage.jsx): `src/pages/admin/EstablishmentsPage.jsx`
- [Establishment records](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Establishment/EstablishmentDatagrid.jsx): `src/components/Establishment/EstablishmentDatagrid.jsx`
- [Establishment validation](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Establishment/EstablishmentValidationForm.jsx): `src/components/Establishment/EstablishmentValidationForm.jsx`
- [Events](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/admin/EventsPage.jsx): `src/pages/admin/EventsPage.jsx`
- [Event records](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Event/EventDatagrid.jsx): `src/components/Event/EventDatagrid.jsx`
- [Event validation](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Event/EventValidationForm.jsx): `src/components/Event/EventValidationForm.jsx`
- [Category management](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/admin/TagsPage.jsx): `src/pages/admin/TagsPage.jsx`
- [Category records and forms](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Category/CategoryDatagrid.jsx): `src/components/Category/CategoryDatagrid.jsx`
- [Messaging route](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/admin/MessagingPage.jsx): `src/pages/admin/MessagingPage.jsx`
- [Profile route](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/pages/admin/ProfilePage.jsx): `src/pages/admin/ProfilePage.jsx`

### Shared services

- [Session storage](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/hooks/useSessionStorage.jsx): `src/hooks/useSessionStorage.jsx`
- [HTTP API client](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/utils/axiosUrl.jsx): `src/utils/axiosUrl.jsx`
- [Validation form controls](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Form/ValidationForm.jsx): `src/components/Form/ValidationForm.jsx`
- [Validation display fields](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Form/ListValidationField.jsx): `src/components/Form/ListValidationField.jsx`
- [Grid status helpers](https://github.com/barathon-2i-tech/barathon_admin/blob/develop/src/components/Datagrid/datagridUtils.jsx): `src/components/Datagrid/datagridUtils.jsx`

### Other components

- **Administrator**
- **Barathon API**

## Connections

- Administrator → Route composition: opens console
- Route composition → Administrator login: routes to (evidence: `src/App.jsx`)
- Route composition → Protected admin layout: protects routes (evidence: `src/App.jsx`)
- Route composition → Validation dashboard: routes to (evidence: `src/App.jsx`)
- Route composition → User administration: routes to (evidence: `src/App.jsx`)
- Route composition → Establishments: routes to (evidence: `src/App.jsx`)
- Route composition → Events: routes to (evidence: `src/App.jsx`)
- Route composition → Category management: routes to (evidence: `src/App.jsx`)
- Route composition → Messaging route: routes to (evidence: `src/App.jsx`)
- Route composition → Profile route: routes to (evidence: `src/App.jsx`)
- Administrator → Administrator login: submits credentials (evidence: `src/pages/authentification/LoginPage.jsx`)
- Administrator login → HTTP API client: posts login (evidence: `src/pages/authentification/LoginPage.jsx`)
- HTTP API client → Barathon API: sends request
- Administrator login → Session and auth: passes login data (evidence: `src/pages/authentification/LoginPage.jsx`)
- Session and auth → Session storage: persists user (evidence: `src/hooks/useAuth.jsx`)
- Session and auth → HTTP API client: posts logout (evidence: `src/hooks/useAuth.jsx`)
- Protected admin layout → Session and auth: checks session (evidence: `src/components/ProtectedLayout.jsx`)
- Validation dashboard → Validation summary: renders (evidence: `src/pages/admin/DashboardPage.jsx`)
- Validation summary → HTTP API client: loads counts (evidence: `src/components/Dashboard/ValidationBanner.jsx`)
- User administration → User records and forms: renders (evidence: `src/pages/admin/UsersPage.jsx`)
- User records and forms → HTTP API client: loads user records (evidence: `src/components/User/UserDatagrid.jsx`)
- User records and forms → Owner validation: opens validation (evidence: `src/components/User/UserDatagrid.jsx`)
- Owner validation → HTTP API client: updates validation (evidence: `src/components/User/OwnerValidationForm.jsx`)
- Establishments → Establishment records: renders (evidence: `src/pages/admin/EstablishmentsPage.jsx`)
- Establishment records → Establishment validation: opens validation (evidence: `src/components/Establishment/EstablishmentDatagrid.jsx`)
- Establishment validation → HTTP API client: loads and validates (evidence: `src/components/Establishment/EstablishmentValidationForm.jsx`)
- Events → Event records: renders (evidence: `src/pages/admin/EventsPage.jsx`)
- Event records → HTTP API client: loads event records (evidence: `src/components/Event/EventDatagrid.jsx`)
- Event records → Event validation: opens validation (evidence: `src/components/Event/EventDatagrid.jsx`)
- Event validation → HTTP API client: updates validation (evidence: `src/components/Event/EventValidationForm.jsx`)
- Category management → Category records and forms: renders (evidence: `src/pages/admin/TagsPage.jsx`)
- Category records and forms → HTTP API client: loads categories (evidence: `src/components/Category/CategoryDatagrid.jsx`)
- Establishment validation → Validation form controls: renders (evidence: `src/components/Establishment/EstablishmentValidationForm.jsx`)
- Establishment validation → Validation display fields: renders details (evidence: `src/components/Establishment/EstablishmentValidationForm.jsx`)
- Owner validation → Validation form controls: renders (evidence: `src/components/User/OwnerValidationForm.jsx`)
- Owner validation → Validation display fields: renders details (evidence: `src/components/User/OwnerValidationForm.jsx`)
- Event records → Grid status helpers: uses status helper (evidence: `src/components/Event/EventDatagrid.jsx`)
- Establishment records → Grid status helpers: uses grid helper (evidence: `src/components/Establishment/EstablishmentDatagrid.jsx`)
