# johnykarella/farms-website architecture

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

- Interactive diagram: https://gitdiagram.com/johnykarella/farms-website
- Repository: https://github.com/johnykarella/farms-website

## Overview

SBL Farms is a public farm-and-nursery showcase paired with a Flask inquiry and administration system. Visitors browse farm services and plant categories, then submit enquiries; staff authenticate to search, update, report on, and export those leads. The README documents the broader public site, newsletter, and admin capabilities. Backend source excerpts show API ownership and storage/auth dependencies; frontend API wiring is documented but its source was not sampled, so those edges cite the README.

Main entry points: [`sbl_farms_with nursery-2-9-2026/backend/app.py`](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/backend/app.py) (Flask API), [`sbl_farms_with nursery-2-9-2026/index.html`](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/index.html) (Farm Website), [`sbl_farms_with nursery-2-9-2026/contact.html`](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/contact.html) (Enquiry Form), [`sbl_farms_with nursery-2-9-2026/assets/admin/admin-dashboard.js`](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/assets/admin/admin-dashboard.js) (Admin Interface Logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Website"]
  node_website["Farm Website<br/>[index.html]"]
  node_offerings["Farm Offerings<br/>[agritour.html]"]
  node_nursery["Nursery Catalog<br/>[nursery.html]"]
  node_articles["Blog Articles<br/>[all_blogs.html]"]
end

subgraph group_engagement["Customer Engagement"]
  node_contact["Enquiry Form<br/>[contact.html]"]
  node_newsletter["Newsletter Form<br/>[index.html]"]
end

subgraph group_admin["Admin Operations"]
  node_adminlogin["Admin Login<br/>[admin.html]"]
  node_dashboard["Lead Dashboard"]
  node_adminjs["Admin Interface Logic<br/>[admin-dashboard.js]"]
end

subgraph group_backend["Backend Services"]
  node_api["Flask API<br/>[app.py]"]
  node_validation["Enquiry Services<br/>[services.py]"]
  node_auth["Admin Authentication<br/>[auth.py]"]
  node_storage[("JSON Data Store<br/>[database.py]")]
end

node_visitor(("Visitor"))
node_smtp["SMTP Mail Service"]

node_visitor -->|"browses"| node_website
node_website -->|"links to"| node_offerings
node_website -->|"links to"| node_nursery
node_website -->|"links to"| node_articles
node_visitor -->|"submits enquiry"| node_contact
node_visitor -.->|"subscribes"| node_newsletter
node_contact -->|"posts enquiry"| node_api
node_newsletter -->|"submits email"| node_api
node_api -->|"validates requests"| node_validation
node_api -->|"reads and writes"| node_storage
node_api -->|"checks sessions"| node_auth
node_auth -->|"manages credentials"| node_storage
node_adminlogin -->|"authenticates"| node_api
node_dashboard -.->|"uses interface logic"| node_adminjs
node_adminjs -->|"manages leads"| node_api
node_api -.->|"sends notifications"| node_smtp

click node_website "https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/index.html"
click node_offerings "https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/agritour.html"
click node_nursery "https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/nursery.html"
click node_articles "https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/all_blogs.html"
click node_contact "https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/contact.html"
click node_newsletter "https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/index.html"
click node_api "https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/backend/app.py"
click node_validation "https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/backend/services.py"
click node_auth "https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/backend/auth.py"
click node_storage "https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/backend/database.py"
click node_adminlogin "https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/admin.html"
click node_dashboard "https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/admin-dashboard.html"
click node_adminjs "https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/assets/admin/admin-dashboard.js"

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_website,node_offerings,node_nursery,node_articles toneBlue
class node_contact,node_newsletter toneAmber
class node_adminlogin,node_dashboard,node_adminjs toneMint
class node_api,node_validation,node_auth,node_storage toneRose
class node_visitor,node_smtp toneIndigo
```

## Components

### Public Website

- [Farm Website](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/index.html): `sbl_farms_with nursery-2-9-2026/index.html`
- [Farm Offerings](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/agritour.html): `sbl_farms_with nursery-2-9-2026/agritour.html`
- [Nursery Catalog](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/nursery.html): `sbl_farms_with nursery-2-9-2026/nursery.html`
- [Blog Articles](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/all_blogs.html): `sbl_farms_with nursery-2-9-2026/all_blogs.html`

### Customer Engagement

- [Enquiry Form](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/contact.html): `sbl_farms_with nursery-2-9-2026/contact.html`
- [Newsletter Form](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/index.html): `sbl_farms_with nursery-2-9-2026/index.html`

### Admin Operations

- [Admin Login](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/admin.html): `sbl_farms_with nursery-2-9-2026/admin.html`
- [Lead Dashboard](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/admin-dashboard.html): `sbl_farms_with nursery-2-9-2026/admin-dashboard.html`
- [Admin Interface Logic](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/assets/admin/admin-dashboard.js): `sbl_farms_with nursery-2-9-2026/assets/admin/admin-dashboard.js`

### Backend Services

- [Flask API](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/backend/app.py): `sbl_farms_with nursery-2-9-2026/backend/app.py`
- [Enquiry Services](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/backend/services.py): `sbl_farms_with nursery-2-9-2026/backend/services.py`
- [Admin Authentication](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/backend/auth.py): `sbl_farms_with nursery-2-9-2026/backend/auth.py`
- [JSON Data Store](https://github.com/johnykarella/farms-website/blob/main/sbl_farms_with%20nursery-2-9-2026/backend/database.py): `sbl_farms_with nursery-2-9-2026/backend/database.py`

### Other components

- **Visitor**
- **SMTP Mail Service**

## Connections

- Visitor → Farm Website: browses (evidence: `README.md`)
- Farm Website → Farm Offerings: links to (evidence: `README.md`)
- Farm Website → Nursery Catalog: links to (evidence: `README.md`)
- Farm Website → Blog Articles: links to (evidence: `README.md`)
- Visitor → Enquiry Form: submits enquiry (evidence: `README.md`)
- Visitor → Newsletter Form: subscribes (evidence: `README.md`)
- Enquiry Form → Flask API: posts enquiry (evidence: `README.md`)
- Newsletter Form → Flask API: submits email (evidence: `README.md`)
- Flask API → Enquiry Services: validates requests (evidence: `sbl_farms_with nursery-2-9-2026/backend/app.py`)
- Flask API → JSON Data Store: reads and writes (evidence: `sbl_farms_with nursery-2-9-2026/backend/app.py`)
- Flask API → Admin Authentication: checks sessions (evidence: `sbl_farms_with nursery-2-9-2026/backend/app.py`)
- Admin Authentication → JSON Data Store: manages credentials (evidence: `sbl_farms_with nursery-2-9-2026/backend/auth.py`)
- Admin Login → Flask API: authenticates (evidence: `README.md`)
- Lead Dashboard → Admin Interface Logic: uses interface logic
- Admin Interface Logic → Flask API: manages leads (evidence: `README.md`)
- Flask API → SMTP Mail Service: sends notifications
