# agrotech-t/agrotech-t-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/agrotech-t/agrotech-t-frontend
- Repository: https://github.com/agrotech-t/agrotech-t-frontend

## Overview

AGROTECH-T is a React frontend for agricultural management, with a REST backend responsible for persistence and business rules. The user enters through the published authentication route; after sign-in, the authenticated home screen exposes farm, poultry-house, inventory, configuration, and profile areas. Inventory manages farm inventories, products, movements, loans, and reports; the galpon area supports houses, lots, and events. The README describes several other domains as reserved, so they are represented as capability placeholders rather than active workflow stages. Evidence is limited to the README and indexed or excerpted files.

Main entry points: [`src/features/home/components/HomeScreen.tsx`](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/home/components/HomeScreen.tsx) (Authenticated home), [`src/features/auth/components/AuthScreen.tsx`](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/auth/components/AuthScreen.tsx) (Account screen), [`src/app/main.tsx`](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/app/main.tsx) (React bootstrap), [`src/app/App.tsx`](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/app/App.tsx) (App routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_main["React bootstrap<br/>[main.tsx]"]
  node_app["App routes<br/>[App.tsx]"]
  node_routes["Active routes<br/>[index.tsx]"]
end

subgraph group_accounts["Accounts"]
  node_authpage["Auth page<br/>[AuthPage.tsx]"]
  node_authscreen["Account screen<br/>[AuthScreen.tsx]"]
  node_authforms["Sign-in and recovery<br/>[SignInForm.tsx]"]
  node_signup["Registration form<br/>[SignUpForm.tsx]"]
  node_accountservice["Account operations<br/>[account.ts]"]
  node_session[("Browser session<br/>[session.ts]")]
end

subgraph group_workspace["Farm workspace"]
  node_home["Authenticated home<br/>[HomeScreen.tsx]"]
  node_layout["Workspace navigation<br/>[AppShell.tsx]"]
  node_farms["Farm management<br/>[FarmsScreen.tsx]"]
end

subgraph group_operations["Operational domains"]
  node_inventory["Farm inventories"]
  node_galpon["Poultry-house operations<br/>[GalponPanel.tsx]"]
  node_configuration["Roles and permissions"]
  node_profile["Profile management<br/>[ProfileScreen.tsx]"]
  node_alerts["Alerts"]
  node_reserved["Reserved domains"]
end

subgraph group_transport["API transport"]
  node_inventoryapi["Inventory API operations<br/>[inventoryApi.ts]"]
  node_client["Shared HTTP client<br/>[client.ts]"]
end

node_user(("User"))
node_backend["REST backend"]

node_user -->|"opens"| node_main
node_main -->|"mounts"| node_app
node_app -->|"renders"| node_routes
node_routes -->|"routes to"| node_authpage
node_authpage -->|"renders"| node_authscreen
node_authscreen -->|"renders"| node_authforms
node_authscreen -->|"renders"| node_signup
node_authscreen -->|"logs out through"| node_accountservice
node_authscreen -->|"reads and clears"| node_session
node_authscreen -->|"shows after sign-in"| node_home
node_home -->|"uses"| node_layout
node_home -->|"imports"| node_farms
node_home -->|"renders"| node_galpon
node_home -->|"imports"| node_inventory
node_home -->|"imports"| node_configuration
node_home -->|"imports"| node_profile
node_home -->|"offers notifications"| node_alerts
node_inventory -->|"uses farm types"| node_farms
node_inventoryapi -->|"sends requests through"| node_client
node_client -->|"sends JSON over HTTP"| node_backend
node_user -.->|"future capabilities"| node_reserved

click node_main "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/app/main.tsx"
click node_app "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/app/App.tsx"
click node_routes "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/app/routes/index.tsx"
click node_authpage "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/auth/pages/AuthPage.tsx"
click node_authscreen "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/auth/components/AuthScreen.tsx"
click node_authforms "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/auth/components/SignInForm.tsx"
click node_signup "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/auth/components/SignUpForm.tsx"
click node_accountservice "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/auth/services/account.ts"
click node_session "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/auth/services/session.ts"
click node_home "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/home/components/HomeScreen.tsx"
click node_layout "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/components/layout/AppShell.tsx"
click node_farms "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/farms/components/FarmsScreen.tsx"
click node_inventory "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/inventario/components/InventoryManager.tsx"
click node_inventoryapi "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/inventario/services/inventoryApi.ts"
click node_galpon "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/galpon/components/GalponPanel.tsx"
click node_configuration "https://github.com/agrotech-t/agrotech-t-frontend/tree/main/src/features/configuracion/components"
click node_profile "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/profile/components/ProfileScreen.tsx"
click node_alerts "https://github.com/agrotech-t/agrotech-t-frontend/tree/main/src/features/alertas"
click node_reserved "https://github.com/agrotech-t/agrotech-t-frontend/tree/main/src/features/production"
click node_client "https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/services/api/client.ts"

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_main,node_app,node_routes,node_user toneBlue
class node_authpage,node_authscreen,node_authforms,node_signup,node_accountservice,node_session toneAmber
class node_home,node_layout,node_farms toneMint
class node_inventory,node_galpon,node_configuration,node_profile,node_alerts,node_reserved toneRose
class node_inventoryapi,node_client,node_backend toneIndigo
```

## Components

### Application entry

- [React bootstrap](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/app/main.tsx): `src/app/main.tsx`
- [App routes](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Active routes](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/app/routes/index.tsx): `src/app/routes/index.tsx`

### Accounts

- [Auth page](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/auth/pages/AuthPage.tsx): `src/features/auth/pages/AuthPage.tsx`
- [Account screen](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/auth/components/AuthScreen.tsx): `src/features/auth/components/AuthScreen.tsx`
- [Sign-in and recovery](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/auth/components/SignInForm.tsx): `src/features/auth/components/SignInForm.tsx`
- [Registration form](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/auth/components/SignUpForm.tsx): `src/features/auth/components/SignUpForm.tsx`
- [Account operations](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/auth/services/account.ts): `src/features/auth/services/account.ts`
- [Browser session](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/auth/services/session.ts): `src/features/auth/services/session.ts`

### Farm workspace

- [Authenticated home](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/home/components/HomeScreen.tsx): `src/features/home/components/HomeScreen.tsx`
- [Workspace navigation](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/components/layout/AppShell.tsx): `src/components/layout/AppShell.tsx`
- [Farm management](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/farms/components/FarmsScreen.tsx): `src/features/farms/components/FarmsScreen.tsx`

### Operational domains

- [Farm inventories](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/inventario/components/InventoryManager.tsx): `src/features/inventario/components/InventoryManager.tsx`
- [Poultry-house operations](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/galpon/components/GalponPanel.tsx): `src/features/galpon/components/GalponPanel.tsx`
- [Roles and permissions](https://github.com/agrotech-t/agrotech-t-frontend/tree/main/src/features/configuracion/components): `src/features/configuracion/components`
- [Profile management](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/profile/components/ProfileScreen.tsx): `src/features/profile/components/ProfileScreen.tsx`
- [Alerts](https://github.com/agrotech-t/agrotech-t-frontend/tree/main/src/features/alertas): `src/features/alertas`
- [Reserved domains](https://github.com/agrotech-t/agrotech-t-frontend/tree/main/src/features/production): `src/features/production`

### API transport

- [Inventory API operations](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/features/inventario/services/inventoryApi.ts): `src/features/inventario/services/inventoryApi.ts`
- [Shared HTTP client](https://github.com/agrotech-t/agrotech-t-frontend/blob/main/src/services/api/client.ts): `src/services/api/client.ts`

### Other components

- **User**
- **REST backend**

## Connections

- User → React bootstrap: opens (evidence: `README.md`)
- React bootstrap → App routes: mounts (evidence: `src/app/main.tsx`)
- App routes → Active routes: renders (evidence: `src/app/App.tsx`)
- Active routes → Auth page: routes to (evidence: `src/app/routes/index.tsx`)
- Auth page → Account screen: renders (evidence: `src/features/auth/pages/AuthPage.tsx`)
- Account screen → Sign-in and recovery: renders (evidence: `src/features/auth/components/AuthScreen.tsx`)
- Account screen → Registration form: renders (evidence: `src/features/auth/components/AuthScreen.tsx`)
- Account screen → Account operations: logs out through (evidence: `src/features/auth/components/AuthScreen.tsx`)
- Account screen → Browser session: reads and clears (evidence: `src/features/auth/components/AuthScreen.tsx`)
- Account screen → Authenticated home: shows after sign-in (evidence: `src/features/auth/components/AuthScreen.tsx`)
- Authenticated home → Workspace navigation: uses (evidence: `src/features/home/components/HomeScreen.tsx`)
- Authenticated home → Farm management: imports (evidence: `src/features/home/components/HomeScreen.tsx`)
- Authenticated home → Poultry-house operations: renders (evidence: `src/features/home/components/HomeScreen.tsx`)
- Authenticated home → Farm inventories: imports (evidence: `src/features/home/components/HomeScreen.tsx`)
- Authenticated home → Roles and permissions: imports (evidence: `src/features/home/components/HomeScreen.tsx`)
- Authenticated home → Profile management: imports (evidence: `src/features/home/components/HomeScreen.tsx`)
- Authenticated home → Alerts: offers notifications
- Farm inventories → Farm management: uses farm types (evidence: `src/features/inventario/components/InventoryManager.tsx`)
- Inventory API operations → Shared HTTP client: sends requests through (evidence: `src/features/inventario/services/inventoryApi.ts`)
- Shared HTTP client → REST backend: sends JSON over HTTP (evidence: `README.md`)
- User → Reserved domains: future capabilities (evidence: `README.md`)
