# soham-darak/cep_agrimed architecture

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

- Interactive diagram: https://gitdiagram.com/soham-darak/cep_agrimed
- Repository: https://github.com/soham-darak/cep_agrimed

## Overview

AgriMed is a farmer-facing crop disease and treatment information app with an agricultural chatbot. The main workflow is selecting a crop and disease on the home page, navigating to a result view, and presenting disease guidance and treatment options. A separate chatbot answers questions through Gemini. The tree and excerpts do not expose the app’s complete feature implementations; unshown relationships are omitted rather than inferred.

Main entry points: [`src/App.jsx`](https://github.com/soham-darak/cep_agrimed/blob/master/src/App.jsx) (Page Routing), [`src/components/Result.jsx`](https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Result.jsx) (Disease Results), [`src/components/Chatbot.jsx`](https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Chatbot.jsx) (Chat Interface), [`src/api/chat.js`](https://github.com/soham-darak/cep_agrimed/blob/master/src/api/chat.js) (Gemini Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_entry["React Entry<br/>[main.jsx]"]
  node_routing["Page Routing<br/>[App.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_navigation["Header Navigation<br/>[Header.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
  node_about["About Page<br/>[AboutUs.jsx]"]
  node_contact["Contact Page<br/>[ContactUs.jsx]"]
  node_privacy["Privacy Policy<br/>[PrivacyPolicy.jsx]"]
  node_terms["Terms of Service<br/>[TermsOfService.jsx]"]
end

subgraph group_crop["Crop Guidance"]
  node_home["Crop Selection<br/>[Home.jsx]"]
  node_result["Disease Results<br/>[Result.jsx]"]
  node_description["Disease Guidance<br/>[Description.jsx]"]
  node_treatments["Treatment Options<br/>[Table.jsx]"]
end

subgraph group_chat["Agricultural Chat"]
  node_chatui["Chat Interface<br/>[Chatbot.jsx]"]
  node_faq["Agriculture FAQs<br/>[faqData.js]"]
  node_chatclient["Gemini Client<br/>[chat.js]"]
  node_config["API Configuration<br/>[config.js]"]
end

node_farmer(("Farmer"))
node_gemini{{"Gemini API"}}

node_farmer -->|"opens app"| node_entry
node_entry -->|"renders"| node_routing
node_routing -->|"routes to"| node_login
node_routing -->|"routes to"| node_home
node_routing -->|"routes to"| node_result
node_routing -->|"renders"| node_navigation
node_routing -->|"renders"| node_footer
node_routing -->|"renders"| node_chatui
node_routing -->|"routes to"| node_about
node_routing -->|"routes to"| node_contact
node_routing -->|"routes to"| node_privacy
node_routing -->|"routes to"| node_terms
node_result -->|"renders"| node_description
node_result -->|"renders"| node_treatments
node_chatui -->|"imports"| node_faq
node_chatui -->|"calls"| node_chatclient
node_chatclient -->|"reads key"| node_config
node_chatclient -->|"sends prompt"| node_gemini

click node_entry "https://github.com/soham-darak/cep_agrimed/blob/master/src/main.jsx"
click node_routing "https://github.com/soham-darak/cep_agrimed/blob/master/src/App.jsx"
click node_login "https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Login.jsx"
click node_navigation "https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Header.jsx"
click node_footer "https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Footer.jsx"
click node_home "https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Home.jsx"
click node_result "https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Result.jsx"
click node_description "https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Description.jsx"
click node_treatments "https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Table.jsx"
click node_chatui "https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Chatbot.jsx"
click node_faq "https://github.com/soham-darak/cep_agrimed/blob/master/src/data/faqData.js"
click node_chatclient "https://github.com/soham-darak/cep_agrimed/blob/master/src/api/chat.js"
click node_config "https://github.com/soham-darak/cep_agrimed/blob/master/src/config.js"
click node_about "https://github.com/soham-darak/cep_agrimed/blob/master/src/components/AboutUs.jsx"
click node_contact "https://github.com/soham-darak/cep_agrimed/blob/master/src/components/ContactUs.jsx"
click node_privacy "https://github.com/soham-darak/cep_agrimed/blob/master/src/components/PrivacyPolicy.jsx"
click node_terms "https://github.com/soham-darak/cep_agrimed/blob/master/src/components/TermsOfService.jsx"

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_entry,node_routing,node_login,node_navigation,node_footer,node_about,node_contact,node_privacy,node_terms toneBlue
class node_home,node_result,node_description,node_treatments toneAmber
class node_chatui,node_faq,node_chatclient,node_config,node_gemini toneMint
class node_farmer toneIndigo
```

## Components

### Application Shell

- [React Entry](https://github.com/soham-darak/cep_agrimed/blob/master/src/main.jsx): `src/main.jsx`
- [Page Routing](https://github.com/soham-darak/cep_agrimed/blob/master/src/App.jsx): `src/App.jsx`
- [Login](https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Login.jsx): `src/components/Login.jsx`
- [Header Navigation](https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Header.jsx): `src/components/Header.jsx`
- [Footer](https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Footer.jsx): `src/components/Footer.jsx`
- [About Page](https://github.com/soham-darak/cep_agrimed/blob/master/src/components/AboutUs.jsx): `src/components/AboutUs.jsx`
- [Contact Page](https://github.com/soham-darak/cep_agrimed/blob/master/src/components/ContactUs.jsx): `src/components/ContactUs.jsx`
- [Privacy Policy](https://github.com/soham-darak/cep_agrimed/blob/master/src/components/PrivacyPolicy.jsx): `src/components/PrivacyPolicy.jsx`
- [Terms of Service](https://github.com/soham-darak/cep_agrimed/blob/master/src/components/TermsOfService.jsx): `src/components/TermsOfService.jsx`

### Crop Guidance

- [Crop Selection](https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Home.jsx): `src/components/Home.jsx`
- [Disease Results](https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Result.jsx): `src/components/Result.jsx`
- [Disease Guidance](https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Description.jsx): `src/components/Description.jsx`
- [Treatment Options](https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Table.jsx): `src/components/Table.jsx`

### Agricultural Chat

- [Chat Interface](https://github.com/soham-darak/cep_agrimed/blob/master/src/components/Chatbot.jsx): `src/components/Chatbot.jsx`
- [Agriculture FAQs](https://github.com/soham-darak/cep_agrimed/blob/master/src/data/faqData.js): `src/data/faqData.js`
- [Gemini Client](https://github.com/soham-darak/cep_agrimed/blob/master/src/api/chat.js): `src/api/chat.js`
- [API Configuration](https://github.com/soham-darak/cep_agrimed/blob/master/src/config.js): `src/config.js`

### Other components

- **Farmer**
- **Gemini API**

## Connections

- Farmer → React Entry: opens app (evidence: `src/main.jsx`)
- React Entry → Page Routing: renders (evidence: `src/main.jsx`)
- Page Routing → Login: routes to (evidence: `src/App.jsx`)
- Page Routing → Crop Selection: routes to (evidence: `src/App.jsx`)
- Page Routing → Disease Results: routes to (evidence: `src/App.jsx`)
- Page Routing → Header Navigation: renders (evidence: `src/App.jsx`)
- Page Routing → Footer: renders (evidence: `src/App.jsx`)
- Page Routing → Chat Interface: renders (evidence: `src/App.jsx`)
- Page Routing → About Page: routes to (evidence: `src/App.jsx`)
- Page Routing → Contact Page: routes to (evidence: `src/App.jsx`)
- Page Routing → Privacy Policy: routes to (evidence: `src/App.jsx`)
- Page Routing → Terms of Service: routes to (evidence: `src/App.jsx`)
- Disease Results → Disease Guidance: renders (evidence: `src/components/Result.jsx`)
- Disease Results → Treatment Options: renders (evidence: `src/components/Result.jsx`)
- Chat Interface → Agriculture FAQs: imports (evidence: `src/components/Chatbot.jsx`)
- Chat Interface → Gemini Client: calls (evidence: `src/components/Chatbot.jsx`)
- Gemini Client → API Configuration: reads key (evidence: `src/api/chat.js`)
- Gemini Client → Gemini API: sends prompt (evidence: `src/api/chat.js`)
