# agrinyoteam/agrinyo architecture

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

- Interactive diagram: https://gitdiagram.com/agrinyoteam/agrinyo
- Repository: https://github.com/agrinyoteam/agrinyo

## Overview

AgriLink is a marketplace for renting agricultural machines in Togo. A visitor or signed-in user navigates the web app, discovers machines and offers, and can manage a listing or submit a reservation; reservation management includes owner decisions and messaging. The frontend also supports accounts, profile changes, and password recovery. The backend is divided into accounts, machines, offers, and reservations. Source excerpts establish frontend routing, session handling, API requests, and selected listing actions; most backend views and several frontend pages were not sampled, so some cross-layer links remain unverified.

Main entry points: [`frontend/src/App.jsx`](https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/App.jsx) (App and routing), [`frontend/src/api.js`](https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/api.js) (API client), [`backend/comptes/views.py`](https://github.com/agrinyoteam/agrinyo/blob/master/backend/comptes/views.py) (Account endpoints), [`backend/machines/models.py`](https://github.com/agrinyoteam/agrinyo/blob/master/backend/machines/models.py) (Machines and reviews)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["App and routing<br/>[App.jsx]"]
  node_session["Session state<br/>[session.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_account_pages["Sign-in and profile pages"]
  node_machine_discovery["Machine discovery<br/>[Machines.jsx]"]
  node_owner_machines["Owner machine listings<br/>[MesMachines.jsx]"]
  node_machine_form["Machine editor"]
  node_offer_pages["Offer browsing and forms<br/>[Offres.jsx]"]
  node_reservation_pages["Reservations and requests"]
  node_conversation_page["Reservation conversation<br/>[Conversation.jsx]"]
end

subgraph group_account["Accounts and identity"]
  node_accounts_api["Account endpoints<br/>[views.py]"]
  node_account_services["Account services"]
  node_user_model[("User records<br/>[models.py]")]
end

subgraph group_marketplace["Marketplace listings"]
  node_machine_api["Machine endpoints<br/>[views.py]"]
  node_machine_model[("Machines and reviews<br/>[models.py]")]
  node_offer_api["Offer endpoints<br/>[views.py]"]
  node_offer_model[("Offer records<br/>[models.py]")]
end

subgraph group_booking["Reservations and messaging"]
  node_reservation_api["Reservation endpoints<br/>[views.py]"]
  node_reservation_model[("Reservations and messages<br/>[models.py]")]
end

node_visitor(("Visitor or user"))

node_visitor -->|"uses"| node_app
node_app -->|"checks"| node_session
node_app -->|"renders"| node_account_pages
node_app -->|"routes"| node_machine_discovery
node_app -->|"routes"| node_owner_machines
node_app -->|"routes"| node_machine_form
node_app -->|"routes"| node_offer_pages
node_app -.->|"routes"| node_reservation_pages
node_app -->|"routes"| node_conversation_page
node_session -->|"calls"| node_api_client
node_machine_form -->|"creates or edits"| node_api_client
node_owner_machines -->|"loads and updates"| node_api_client
node_conversation_page -->|"uses"| node_api_client
node_api_client -.->|"requests"| node_machine_api
node_api_client -.->|"requests"| node_accounts_api
node_api_client -.->|"requests"| node_offer_api
node_api_client -.->|"requests"| node_reservation_api
node_accounts_api -.->|"reads and writes"| node_user_model
node_accounts_api -.->|"uses"| node_account_services
node_machine_api -.->|"reads and writes"| node_machine_model
node_offer_api -.->|"reads and writes"| node_offer_model
node_reservation_api -->|"reads and writes"| node_reservation_model
node_reservation_model -->|"references machine"| node_machine_model
node_offer_model -->|"references machine"| node_machine_model

click node_app "https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/App.jsx"
click node_session "https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/session.jsx"
click node_api_client "https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/api.js"
click node_account_pages "https://github.com/agrinyoteam/agrinyo/tree/master/frontend/src/pages"
click node_machine_discovery "https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/pages/Machines.jsx"
click node_owner_machines "https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/pages/MesMachines.jsx"
click node_machine_form "https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/pages/FormulaireMachine.jsx"
click node_offer_pages "https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/pages/Offres.jsx"
click node_reservation_pages "https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/pages/MesReservations.jsx"
click node_conversation_page "https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/pages/Conversation.jsx"
click node_accounts_api "https://github.com/agrinyoteam/agrinyo/blob/master/backend/comptes/views.py"
click node_account_services "https://github.com/agrinyoteam/agrinyo/tree/master/backend/comptes"
click node_user_model "https://github.com/agrinyoteam/agrinyo/blob/master/backend/comptes/models.py"
click node_machine_api "https://github.com/agrinyoteam/agrinyo/blob/master/backend/machines/views.py"
click node_machine_model "https://github.com/agrinyoteam/agrinyo/blob/master/backend/machines/models.py"
click node_offer_api "https://github.com/agrinyoteam/agrinyo/blob/master/backend/offres/views.py"
click node_offer_model "https://github.com/agrinyoteam/agrinyo/blob/master/backend/offres/models.py"
click node_reservation_api "https://github.com/agrinyoteam/agrinyo/blob/master/backend/reservations/views.py"
click node_reservation_model "https://github.com/agrinyoteam/agrinyo/blob/master/backend/reservations/models.py"

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_session,node_api_client,node_account_pages,node_machine_discovery,node_owner_machines,node_machine_form,node_offer_pages,node_reservation_pages,node_conversation_page,node_visitor toneBlue
class node_accounts_api,node_account_services,node_user_model toneAmber
class node_machine_api,node_machine_model,node_offer_api,node_offer_model toneMint
class node_reservation_api,node_reservation_model toneRose
```

## Components

### Web application

- [App and routing](https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Session state](https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/session.jsx): `frontend/src/session.jsx`
- [API client](https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/api.js): `frontend/src/api.js`
- [Sign-in and profile pages](https://github.com/agrinyoteam/agrinyo/tree/master/frontend/src/pages): `frontend/src/pages`
- [Machine discovery](https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/pages/Machines.jsx): `frontend/src/pages/Machines.jsx`
- [Owner machine listings](https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/pages/MesMachines.jsx): `frontend/src/pages/MesMachines.jsx`
- [Machine editor](https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/pages/FormulaireMachine.jsx): `frontend/src/pages/FormulaireMachine.jsx`
- [Offer browsing and forms](https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/pages/Offres.jsx): `frontend/src/pages/Offres.jsx`
- [Reservations and requests](https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/pages/MesReservations.jsx): `frontend/src/pages/MesReservations.jsx`
- [Reservation conversation](https://github.com/agrinyoteam/agrinyo/blob/master/frontend/src/pages/Conversation.jsx): `frontend/src/pages/Conversation.jsx`

### Accounts and identity

- [Account endpoints](https://github.com/agrinyoteam/agrinyo/blob/master/backend/comptes/views.py): `backend/comptes/views.py`
- [Account services](https://github.com/agrinyoteam/agrinyo/tree/master/backend/comptes): `backend/comptes`
- [User records](https://github.com/agrinyoteam/agrinyo/blob/master/backend/comptes/models.py): `backend/comptes/models.py`

### Marketplace listings

- [Machine endpoints](https://github.com/agrinyoteam/agrinyo/blob/master/backend/machines/views.py): `backend/machines/views.py`
- [Machines and reviews](https://github.com/agrinyoteam/agrinyo/blob/master/backend/machines/models.py): `backend/machines/models.py`
- [Offer endpoints](https://github.com/agrinyoteam/agrinyo/blob/master/backend/offres/views.py): `backend/offres/views.py`
- [Offer records](https://github.com/agrinyoteam/agrinyo/blob/master/backend/offres/models.py): `backend/offres/models.py`

### Reservations and messaging

- [Reservation endpoints](https://github.com/agrinyoteam/agrinyo/blob/master/backend/reservations/views.py): `backend/reservations/views.py`
- [Reservations and messages](https://github.com/agrinyoteam/agrinyo/blob/master/backend/reservations/models.py): `backend/reservations/models.py`

### Other components

- **Visitor or user**

## Connections

- Visitor or user → App and routing: uses
- App and routing → Session state: checks (evidence: `frontend/src/App.jsx`)
- App and routing → Sign-in and profile pages: renders (evidence: `frontend/src/App.jsx`)
- App and routing → Machine discovery: routes (evidence: `frontend/src/App.jsx`)
- App and routing → Owner machine listings: routes (evidence: `frontend/src/App.jsx`)
- App and routing → Machine editor: routes (evidence: `frontend/src/App.jsx`)
- App and routing → Offer browsing and forms: routes (evidence: `frontend/src/App.jsx`)
- App and routing → Reservations and requests: routes (evidence: `frontend/src/App.jsx`)
- App and routing → Reservation conversation: routes (evidence: `frontend/src/App.jsx`)
- Session state → API client: calls (evidence: `frontend/src/session.jsx`)
- Machine editor → API client: creates or edits (evidence: `frontend/src/pages/FormulaireMachine.jsx`)
- Owner machine listings → API client: loads and updates (evidence: `frontend/src/pages/MesMachines.jsx`)
- Reservation conversation → API client: uses (evidence: `frontend/src/pages/Conversation.jsx`)
- API client → Machine endpoints: requests
- API client → Account endpoints: requests
- API client → Offer endpoints: requests
- API client → Reservation endpoints: requests
- Account endpoints → User records: reads and writes
- Account endpoints → Account services: uses
- Machine endpoints → Machines and reviews: reads and writes
- Offer endpoints → Offer records: reads and writes
- Reservation endpoints → Reservations and messages: reads and writes (evidence: `backend/reservations/views.py`)
- Reservations and messages → Machines and reviews: references machine (evidence: `backend/reservations/models.py`)
- Offer records → Machines and reviews: references machine (evidence: `backend/offres/models.py`)
