# tejaswini-123-mannem/seedmart architecture

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

- Interactive diagram: https://gitdiagram.com/tejaswini-123-mannem/seedmart
- Repository: https://github.com/tejaswini-123-mannem/seedmart

## Overview

SeedMart is a bilingual seed catalog and farmer-review platform. Farmers browse products, submit crop-result reviews, and can view their submission history; admins manage catalog content and moderate submissions before approved reviews become public. The graph follows the documented React-to-Express-to-MongoDB architecture and the sampled route/controller relationships. Several page and feature implementations were not sampled, so their internal calls are omitted where evidence is unavailable.

Main entry points: [`server/server.js`](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/server.js) (Express Server), [`server/controllers/submissionController.js`](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/controllers/submissionController.js) (Submission and Moderation), [`client/src/App.jsx`](https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/App.jsx) (Route Pages), [`client/src/api/client.js`](https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/api/client.js) (API Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Farmer and Admin UI"]
  node_app["Route Pages<br/>[App.jsx]"]
  node_language["Language Context"]
  node_translations["Translations<br/>[translations.js]"]
  node_authstate["Auth Context<br/>[AuthContext.jsx]"]
  node_catalogui["Catalog Pages"]
  node_submitui["Review Submission UI<br/>[SubmitReview.jsx]"]
  node_queueui["Moderation Queue UI<br/>[AdminQueue.jsx]"]
  node_settingsui["Admin Settings UI<br/>[AdminSettings.jsx]"]
  node_imageui["Image Uploader<br/>[ImageUploader.jsx]"]
  node_api["API Client<br/>[client.js]"]
end

subgraph group_service["API and Access"]
  node_server["Express Server<br/>[server.js]"]
  node_authmw["JWT and Admin Guards<br/>[authMiddleware.js]"]
  node_authctrl["Account API<br/>[authController.js]"]
  node_productctrl["Catalog API"]
  node_settingsctrl["Site Settings API"]
  node_uploadctrl["Upload API"]
end

subgraph group_reviews["Review Lifecycle"]
  node_submissionctrl["Submission and Moderation"]
  node_reviewctrl["Published Review API"]
  node_submissionmodel[("Submission Records")]
  node_reviewmodel[("Published Reviews<br/>[Review.js]")]
end

subgraph group_data["Persistence and Media"]
  node_productmodel[("Product Records<br/>[Product.js]")]
  node_usermodel[("User Records<br/>[User.js]")]
  node_settingsmodel[("Settings Records<br/>[Settings.js]")]
  node_cloudinary[("Cloudinary Media")]
  node_mongodb[("MongoDB")]
end

node_browser(("Browser"))

node_browser -->|"uses"| node_app
node_app -->|"routes to"| node_catalogui
node_app -->|"routes to"| node_submitui
node_app -->|"routes to"| node_queueui
node_app -->|"routes to"| node_settingsui
node_language -->|"looks up"| node_translations
node_browser -->|"requests"| node_api
node_api -->|"calls API"| node_server
node_server -->|"connects"| node_mongodb
node_server -->|"mounts routes"| node_authctrl
node_server -->|"mounts routes"| node_productctrl
node_server -->|"mounts routes"| node_submissionctrl
node_server -->|"mounts routes"| node_reviewctrl
node_server -->|"mounts routes"| node_settingsctrl
node_server -->|"mounts routes"| node_uploadctrl
node_submitui -->|"submits through"| node_api
node_submitui -->|"uses"| node_imageui
node_imageui -->|"uploads through"| node_api
node_queueui -->|"calls"| node_api
node_authctrl -->|"reads and writes"| node_usermodel
node_productctrl -->|"reads and writes"| node_productmodel
node_submissionctrl -->|"reads and writes"| node_submissionmodel
node_submissionctrl -->|"checks product"| node_productmodel
node_submissionctrl -->|"loads farmer"| node_usermodel
node_submissionctrl -->|"creates on approval"| node_reviewmodel
node_reviewctrl -->|"reads and edits"| node_reviewmodel
node_reviewctrl -->|"syncs submission"| node_submissionmodel
node_settingsctrl -->|"reads and writes"| node_settingsmodel
node_uploadctrl -->|"uploads media"| node_cloudinary
node_reviewctrl -->|"deletes photos"| node_cloudinary
node_submissionctrl -->|"deletes photos"| node_cloudinary
node_authmw -->|"guards requests"| node_server

click node_app "https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/App.jsx"
click node_language "https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/context/LanguageContext.jsx"
click node_translations "https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/i18n/translations.js"
click node_authstate "https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/context/AuthContext.jsx"
click node_catalogui "https://github.com/tejaswini-123-mannem/seedmart/tree/main/client/src/pages"
click node_submitui "https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/pages/SubmitReview.jsx"
click node_queueui "https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/pages/admin/AdminQueue.jsx"
click node_settingsui "https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/pages/admin/AdminSettings.jsx"
click node_imageui "https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/components/ImageUploader.jsx"
click node_api "https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/api/client.js"
click node_server "https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/server.js"
click node_authmw "https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/middleware/authMiddleware.js"
click node_authctrl "https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/controllers/authController.js"
click node_productctrl "https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/controllers/productController.js"
click node_submissionctrl "https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/controllers/submissionController.js"
click node_reviewctrl "https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/controllers/reviewController.js"
click node_submissionmodel "https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/models/ReviewSubmission.js"
click node_reviewmodel "https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/models/Review.js"
click node_productmodel "https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/models/Product.js"
click node_usermodel "https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/models/User.js"
click node_settingsctrl "https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/controllers/settingsController.js"
click node_settingsmodel "https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/models/Settings.js"
click node_uploadctrl "https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/controllers/uploadController.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_app,node_language,node_translations,node_authstate,node_catalogui,node_submitui,node_queueui,node_settingsui,node_imageui,node_api,node_browser toneBlue
class node_server,node_authmw,node_authctrl,node_productctrl,node_settingsctrl,node_uploadctrl toneAmber
class node_submissionctrl,node_reviewctrl,node_submissionmodel,node_reviewmodel toneMint
class node_productmodel,node_usermodel,node_settingsmodel,node_cloudinary,node_mongodb toneRose
```

## Components

### Farmer and Admin UI

- [Route Pages](https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Language Context](https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/context/LanguageContext.jsx): `client/src/context/LanguageContext.jsx`
- [Translations](https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/i18n/translations.js): `client/src/i18n/translations.js`
- [Auth Context](https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Catalog Pages](https://github.com/tejaswini-123-mannem/seedmart/tree/main/client/src/pages): `client/src/pages`
- [Review Submission UI](https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/pages/SubmitReview.jsx): `client/src/pages/SubmitReview.jsx`
- [Moderation Queue UI](https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/pages/admin/AdminQueue.jsx): `client/src/pages/admin/AdminQueue.jsx`
- [Admin Settings UI](https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/pages/admin/AdminSettings.jsx): `client/src/pages/admin/AdminSettings.jsx`
- [Image Uploader](https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/components/ImageUploader.jsx): `client/src/components/ImageUploader.jsx`
- [API Client](https://github.com/tejaswini-123-mannem/seedmart/blob/main/client/src/api/client.js): `client/src/api/client.js`

### API and Access

- [Express Server](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/server.js): `server/server.js`
- [JWT and Admin Guards](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/middleware/authMiddleware.js): `server/middleware/authMiddleware.js`
- [Account API](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [Catalog API](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/controllers/productController.js): `server/controllers/productController.js`
- [Site Settings API](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/controllers/settingsController.js): `server/controllers/settingsController.js`
- [Upload API](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/controllers/uploadController.js): `server/controllers/uploadController.js`

### Review Lifecycle

- [Submission and Moderation](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/controllers/submissionController.js): `server/controllers/submissionController.js`
- [Published Review API](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/controllers/reviewController.js): `server/controllers/reviewController.js`
- [Submission Records](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/models/ReviewSubmission.js): `server/models/ReviewSubmission.js`
- [Published Reviews](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/models/Review.js): `server/models/Review.js`

### Persistence and Media

- [Product Records](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/models/Product.js): `server/models/Product.js`
- [User Records](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/models/User.js): `server/models/User.js`
- [Settings Records](https://github.com/tejaswini-123-mannem/seedmart/blob/main/server/models/Settings.js): `server/models/Settings.js`
- **Cloudinary Media**
- **MongoDB**

### Other components

- **Browser**

## Connections

- Browser → Route Pages: uses (evidence: `README.md`)
- Route Pages → Catalog Pages: routes to (evidence: `client/src/App.jsx`)
- Route Pages → Review Submission UI: routes to (evidence: `client/src/App.jsx`)
- Route Pages → Moderation Queue UI: routes to (evidence: `client/src/App.jsx`)
- Route Pages → Admin Settings UI: routes to (evidence: `client/src/App.jsx`)
- Language Context → Translations: looks up (evidence: `client/src/context/LanguageContext.jsx`)
- Browser → API Client: requests (evidence: `README.md`)
- API Client → Express Server: calls API (evidence: `README.md`)
- Express Server → MongoDB: connects (evidence: `server/server.js`)
- Express Server → Account API: mounts routes (evidence: `server/server.js`)
- Express Server → Catalog API: mounts routes (evidence: `server/server.js`)
- Express Server → Submission and Moderation: mounts routes (evidence: `server/server.js`)
- Express Server → Published Review API: mounts routes (evidence: `server/server.js`)
- Express Server → Site Settings API: mounts routes (evidence: `server/server.js`)
- Express Server → Upload API: mounts routes (evidence: `server/server.js`)
- Review Submission UI → API Client: submits through (evidence: `client/src/pages/SubmitReview.jsx`)
- Review Submission UI → Image Uploader: uses (evidence: `client/src/pages/SubmitReview.jsx`)
- Image Uploader → API Client: uploads through (evidence: `client/src/components/ImageUploader.jsx`)
- Moderation Queue UI → API Client: calls (evidence: `client/src/pages/admin/AdminQueue.jsx`)
- Account API → User Records: reads and writes (evidence: `server/controllers/authController.js`)
- Catalog API → Product Records: reads and writes (evidence: `server/controllers/productController.js`)
- Submission and Moderation → Submission Records: reads and writes (evidence: `server/controllers/submissionController.js`)
- Submission and Moderation → Product Records: checks product (evidence: `server/controllers/submissionController.js`)
- Submission and Moderation → User Records: loads farmer (evidence: `server/controllers/submissionController.js`)
- Submission and Moderation → Published Reviews: creates on approval (evidence: `server/controllers/submissionController.js`)
- Published Review API → Published Reviews: reads and edits (evidence: `server/controllers/reviewController.js`)
- Published Review API → Submission Records: syncs submission (evidence: `server/controllers/reviewController.js`)
- Site Settings API → Settings Records: reads and writes (evidence: `server/controllers/settingsController.js`)
- Upload API → Cloudinary Media: uploads media (evidence: `server/controllers/uploadController.js`)
- Published Review API → Cloudinary Media: deletes photos (evidence: `server/controllers/reviewController.js`)
- Submission and Moderation → Cloudinary Media: deletes photos (evidence: `server/controllers/submissionController.js`)
- JWT and Admin Guards → Express Server: guards requests
