# ashutoshjoshi23/team-warriors-agritech architecture

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

- Interactive diagram: https://gitdiagram.com/ashutoshjoshi23/team-warriors-agritech
- Repository: https://github.com/ashutoshjoshi23/team-warriors-agritech

## Overview

FarmConnect is a farm-to-table marketplace. Buyers browse produce, manage a cart, check out and pay, then view orders and invoices; farmers manage products, while admins manage users, products, orders and marketplace statistics. The graph combines the documented capabilities with sampled controller and payment code. Several frontend and backend modules are unsampled, so their documented roles are included but uncertain implementation-level connections are omitted.

Main entry points: [`src/main/java/com/farmermarket/controller/PaymentController.java`](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/controller/PaymentController.java) (Payment API), [`src/main/java/com/farmermarket/controller/AdminController.java`](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/controller/AdminController.java) (Admin API), [`src/main/resources/static/js/checkout.js`](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/checkout.js) (Checkout), [`src/main/resources/static/js/auth.js`](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/auth.js) (Login and registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Marketplace storefront"]
  node_marketplace["Product discovery<br/>[products.js]"]
  node_product_detail["Product details<br/>[product-details.js]"]
  node_home["Homepage<br/>[home.js]"]
  node_shared_ui["Shared UI<br/>[main.js]"]
  node_voiceflow["Voiceflow chatbot"]
end

subgraph group_commerce["Shopping and orders"]
  node_cart["Cart and offers<br/>[cart.js]"]
  node_checkout["Checkout<br/>[checkout.js]"]
  node_orders_ui["Order history, invoices<br/>[orders.js]"]
  node_payment_gateway["Razorpay"]
end

subgraph group_identity["Accounts and dashboards"]
  node_auth_ui["Login and registration<br/>[auth.js]"]
  node_profile_ui["Profile<br/>[profile.js]"]
  node_dashboard_ui["Buyer and farmer dashboard<br/>[dashboard.js]"]
  node_admin_ui["Admin panel<br/>[admin.html]"]
end

subgraph group_services["Application services"]
  node_auth_api["Authentication API"]
  node_product_api["Product API"]
  node_order_api["Order API"]
  node_payment_api["Payment API"]
  node_admin_api["Admin API"]
end

subgraph group_persistence["Domain and persistence"]
  node_domain["Marketplace entities"]
  node_user_repo["User repository"]
  node_product_repo["Product repository"]
  node_order_repo["Order repository"]
  node_mysql[("MySQL database")]
end

node_buyer(("Buyer"))
node_farmer(("Farmer"))
node_admin(("Admin"))

node_buyer -->|"browses"| node_marketplace
node_marketplace -.->|"loads catalogue"| node_product_api
node_buyer -->|"views produce"| node_product_detail
node_buyer -->|"manages items"| node_cart
node_cart -->|"starts checkout"| node_checkout
node_buyer -->|"provides shipping"| node_checkout
node_checkout -.->|"creates payment"| node_payment_api
node_payment_api -->|"creates Razorpay order"| node_payment_gateway
node_payment_api -->|"reads and saves"| node_order_repo
node_payment_api -.->|"verifies payment"| node_checkout
node_buyer -->|"views invoices"| node_orders_ui
node_orders_ui -.->|"fetches history"| node_order_api
node_farmer -->|"manages products"| node_dashboard_ui
node_admin -->|"manages marketplace"| node_admin_ui
node_admin_ui -.->|"requests management"| node_admin_api
node_admin_api -->|"reads and saves orders"| node_order_repo
node_admin_api -->|"manages products"| node_product_repo
node_admin_api -->|"manages users"| node_user_repo
node_buyer -->|"signs in"| node_auth_ui
node_farmer -->|"registers"| node_auth_ui
node_auth_ui -.->|"authenticates"| node_auth_api
node_product_api -->|"reads and saves"| node_product_repo
node_domain -->|"persists entities"| node_mysql
node_voiceflow -->|"chat widget configured by"| node_shared_ui
node_shared_ui -.->|"serves shared navigation"| node_buyer

click node_marketplace "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/products.js"
click node_product_detail "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/product-details.js"
click node_home "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/home.js"
click node_shared_ui "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/main.js"
click node_cart "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/cart.js"
click node_checkout "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/checkout.js"
click node_orders_ui "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/orders.js"
click node_auth_ui "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/auth.js"
click node_profile_ui "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/profile.js"
click node_dashboard_ui "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/dashboard.js"
click node_admin_ui "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/admin.html"
click node_auth_api "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/controller/AuthController.java"
click node_product_api "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/controller/ProductController.java"
click node_order_api "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/controller/OrderController.java"
click node_payment_api "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/controller/PaymentController.java"
click node_admin_api "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/controller/AdminController.java"
click node_domain "https://github.com/ashutoshjoshi23/team-warriors-agritech/tree/main/src/main/java/com/farmermarket/model"
click node_user_repo "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/repository/UserRepository.java"
click node_product_repo "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/repository/ProductRepository.java"
click node_order_repo "https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/repository/OrderRepository.java"

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_marketplace,node_product_detail,node_home,node_shared_ui,node_voiceflow toneBlue
class node_cart,node_checkout,node_orders_ui,node_payment_gateway toneAmber
class node_auth_ui,node_profile_ui,node_dashboard_ui,node_admin_ui toneMint
class node_auth_api,node_product_api,node_order_api,node_payment_api,node_admin_api toneRose
class node_domain,node_user_repo,node_product_repo,node_order_repo,node_mysql,node_buyer,node_farmer,node_admin toneIndigo
```

## Components

### Marketplace storefront

- [Product discovery](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/products.js): `src/main/resources/static/js/products.js`
- [Product details](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/product-details.js): `src/main/resources/static/js/product-details.js`
- [Homepage](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/home.js): `src/main/resources/static/js/home.js`
- [Shared UI](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/main.js): `src/main/resources/static/js/main.js`
- **Voiceflow chatbot**

### Shopping and orders

- [Cart and offers](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/cart.js): `src/main/resources/static/js/cart.js`
- [Checkout](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/checkout.js): `src/main/resources/static/js/checkout.js`
- [Order history, invoices](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/orders.js): `src/main/resources/static/js/orders.js`
- **Razorpay**

### Accounts and dashboards

- [Login and registration](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/auth.js): `src/main/resources/static/js/auth.js`
- [Profile](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/profile.js): `src/main/resources/static/js/profile.js`
- [Buyer and farmer dashboard](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/js/dashboard.js): `src/main/resources/static/js/dashboard.js`
- [Admin panel](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/resources/static/admin.html): `src/main/resources/static/admin.html`

### Application services

- [Authentication API](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/controller/AuthController.java): `src/main/java/com/farmermarket/controller/AuthController.java`
- [Product API](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/controller/ProductController.java): `src/main/java/com/farmermarket/controller/ProductController.java`
- [Order API](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/controller/OrderController.java): `src/main/java/com/farmermarket/controller/OrderController.java`
- [Payment API](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/controller/PaymentController.java): `src/main/java/com/farmermarket/controller/PaymentController.java`
- [Admin API](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/controller/AdminController.java): `src/main/java/com/farmermarket/controller/AdminController.java`

### Domain and persistence

- [Marketplace entities](https://github.com/ashutoshjoshi23/team-warriors-agritech/tree/main/src/main/java/com/farmermarket/model): `src/main/java/com/farmermarket/model`
- [User repository](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/repository/UserRepository.java): `src/main/java/com/farmermarket/repository/UserRepository.java`
- [Product repository](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/repository/ProductRepository.java): `src/main/java/com/farmermarket/repository/ProductRepository.java`
- [Order repository](https://github.com/ashutoshjoshi23/team-warriors-agritech/blob/main/src/main/java/com/farmermarket/repository/OrderRepository.java): `src/main/java/com/farmermarket/repository/OrderRepository.java`
- **MySQL database**

### Other components

- **Buyer**
- **Farmer**
- **Admin**

## Connections

- Buyer → Product discovery: browses (evidence: `README.md`)
- Product discovery → Product API: loads catalogue
- Buyer → Product details: views produce (evidence: `README.md`)
- Buyer → Cart and offers: manages items (evidence: `README.md`)
- Cart and offers → Checkout: starts checkout (evidence: `README.md`)
- Buyer → Checkout: provides shipping (evidence: `README.md`)
- Checkout → Payment API: creates payment
- Payment API → Razorpay: creates Razorpay order (evidence: `src/main/java/com/farmermarket/controller/PaymentController.java`)
- Payment API → Order repository: reads and saves (evidence: `src/main/java/com/farmermarket/controller/PaymentController.java`)
- Payment API → Checkout: verifies payment
- Buyer → Order history, invoices: views invoices (evidence: `README.md`)
- Order history, invoices → Order API: fetches history
- Farmer → Buyer and farmer dashboard: manages products (evidence: `README.md`)
- Admin → Admin panel: manages marketplace (evidence: `README.md`)
- Admin panel → Admin API: requests management
- Admin API → Order repository: reads and saves orders (evidence: `src/main/java/com/farmermarket/controller/AdminController.java`)
- Admin API → Product repository: manages products (evidence: `src/main/java/com/farmermarket/controller/AdminController.java`)
- Admin API → User repository: manages users (evidence: `src/main/java/com/farmermarket/controller/AdminController.java`)
- Buyer → Login and registration: signs in (evidence: `README.md`)
- Farmer → Login and registration: registers (evidence: `README.md`)
- Login and registration → Authentication API: authenticates
- Product API → Product repository: reads and saves (evidence: `src/main/java/com/farmermarket/controller/ProductController.java`)
- Marketplace entities → MySQL database: persists entities (evidence: `README.md`)
- Voiceflow chatbot → Shared UI: chat widget configured by (evidence: `src/main/resources/static/js/main.js`)
- Shared UI → Buyer: serves shared navigation
