# misbahh2006/dairy_system architecture

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

- Interactive diagram: https://gitdiagram.com/misbahh2006/dairy_system
- Repository: https://github.com/misbahh2006/dairy_system

## Overview

Dairy System is a small React/FastAPI application: its visible frontend presents a landing page and requests a backend welcome message, while the backend also exposes project creation and listing backed by SQLite. The project API workflow runs from an API client through the FastAPI router, CRUD operations and SQLAlchemy model to storage; the supplied frontend does not expose that workflow. The graph preserves the documented and indexed UI modules. Edges reflect shown imports, calls and configuration; project API requests are not shown originating in the UI.

Main entry points: [`frontend/src/App.jsx`](https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/App.jsx) (App shell), [`backend/app/routes/project_routes.py`](https://github.com/misbahh2006/dairy_system/blob/main/backend/app/routes/project_routes.py) (Project routes), [`backend/app/crud.py`](https://github.com/misbahh2006/dairy_system/blob/main/backend/app/crud.py) (Project CRUD), [`backend/app/database.py`](https://github.com/misbahh2006/dairy_system/blob/main/backend/app/database.py) (Database sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_frontend_entry["React entry<br/>[main.jsx]"]
  node_app["App shell<br/>[App.jsx]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
  node_hero["Hero section<br/>[Hero.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
  node_scroll_hook["Smooth scrolling<br/>[useLenis.js]"]
  node_theme["Theme settings<br/>[theme.js]"]
end

subgraph group_api["Backend API"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_project_routes["Project routes<br/>[project_routes.py]"]
end

subgraph group_data["Project Data"]
  node_schemas["Project schemas<br/>[schemas.py]"]
  node_crud["Project CRUD<br/>[crud.py]"]
  node_models["Project model<br/>[models.py]"]
  node_database["Database sessions<br/>[database.py]"]
end

node_visitor(("Browser visitor"))
node_api_client(("API client"))
node_sqlite[("SQLite database")]

node_visitor -->|"opens app"| node_frontend_entry
node_frontend_entry -->|"renders"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_hero
node_app -->|"renders"| node_footer
node_app -->|"calls"| node_scroll_hook
node_app -->|"configures"| node_theme
node_app -->|"fetches welcome"| node_api_app
node_api_client -.->|"requests projects"| node_project_routes
node_api_app -->|"registers routes"| node_project_routes
node_project_routes -->|"validates responses"| node_schemas
node_project_routes -->|"calls"| node_crud
node_project_routes -->|"depends on session"| node_database
node_crud -->|"creates and queries"| node_models
node_crud -.->|"reads and writes"| node_sqlite
node_models -->|"uses base"| node_database
node_database -->|"configures engine"| node_sqlite

click node_frontend_entry "https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/main.jsx"
click node_app "https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/App.jsx"
click node_navbar "https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/components/Navbar.jsx"
click node_hero "https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/components/Hero.jsx"
click node_footer "https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/components/Footer.jsx"
click node_scroll_hook "https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/hooks/useLenis.js"
click node_theme "https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/styles/theme.js"
click node_api_app "https://github.com/misbahh2006/dairy_system/blob/main/backend/app/main.py"
click node_project_routes "https://github.com/misbahh2006/dairy_system/blob/main/backend/app/routes/project_routes.py"
click node_schemas "https://github.com/misbahh2006/dairy_system/blob/main/backend/app/schemas.py"
click node_crud "https://github.com/misbahh2006/dairy_system/blob/main/backend/app/crud.py"
click node_models "https://github.com/misbahh2006/dairy_system/blob/main/backend/app/models.py"
click node_database "https://github.com/misbahh2006/dairy_system/blob/main/backend/app/database.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_frontend_entry,node_app,node_navbar,node_hero,node_footer,node_scroll_hook,node_theme,node_visitor,node_api_client toneBlue
class node_api_app,node_project_routes,node_sqlite toneAmber
class node_schemas,node_crud,node_models,node_database toneMint
```

## Components

### Frontend

- [React entry](https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [App shell](https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Navigation bar](https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [Hero section](https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/components/Hero.jsx): `frontend/src/components/Hero.jsx`
- [Footer](https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/components/Footer.jsx): `frontend/src/components/Footer.jsx`
- [Smooth scrolling](https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/hooks/useLenis.js): `frontend/src/hooks/useLenis.js`
- [Theme settings](https://github.com/misbahh2006/dairy_system/blob/main/frontend/src/styles/theme.js): `frontend/src/styles/theme.js`

### Backend API

- [FastAPI app](https://github.com/misbahh2006/dairy_system/blob/main/backend/app/main.py): `backend/app/main.py`
- [Project routes](https://github.com/misbahh2006/dairy_system/blob/main/backend/app/routes/project_routes.py): `backend/app/routes/project_routes.py`

### Project Data

- [Project schemas](https://github.com/misbahh2006/dairy_system/blob/main/backend/app/schemas.py): `backend/app/schemas.py`
- [Project CRUD](https://github.com/misbahh2006/dairy_system/blob/main/backend/app/crud.py): `backend/app/crud.py`
- [Project model](https://github.com/misbahh2006/dairy_system/blob/main/backend/app/models.py): `backend/app/models.py`
- [Database sessions](https://github.com/misbahh2006/dairy_system/blob/main/backend/app/database.py): `backend/app/database.py`

### Other components

- **Browser visitor**
- **API client**
- **SQLite database**

## Connections

- Browser visitor → React entry: opens app (evidence: `frontend/src/main.jsx`)
- React entry → App shell: renders (evidence: `frontend/src/main.jsx`)
- App shell → Navigation bar: renders (evidence: `frontend/src/App.jsx`)
- App shell → Hero section: renders (evidence: `frontend/src/App.jsx`)
- App shell → Footer: renders (evidence: `frontend/src/App.jsx`)
- App shell → Smooth scrolling: calls (evidence: `frontend/src/App.jsx`)
- App shell → Theme settings: configures (evidence: `frontend/src/App.jsx`)
- App shell → FastAPI app: fetches welcome (evidence: `frontend/src/App.jsx`)
- API client → Project routes: requests projects
- FastAPI app → Project routes: registers routes (evidence: `backend/app/main.py`)
- Project routes → Project schemas: validates responses (evidence: `backend/app/routes/project_routes.py`)
- Project routes → Project CRUD: calls (evidence: `backend/app/routes/project_routes.py`)
- Project routes → Database sessions: depends on session (evidence: `backend/app/routes/project_routes.py`)
- Project CRUD → Project model: creates and queries (evidence: `backend/app/crud.py`)
- Project CRUD → SQLite database: reads and writes
- Project model → Database sessions: uses base (evidence: `backend/app/models.py`)
- Database sessions → SQLite database: configures engine (evidence: `backend/app/database.py`)
