# dgpatil98600/full-stack architecture

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

- Interactive diagram: https://gitdiagram.com/dgpatil98600/full-stack
- Repository: https://github.com/dgpatil98600/full-stack

## Overview

InventoryManagement is a web application for shop owners to manage products, billing, notifications, accounts, and sales analysis, with an inventory chatbot. The principal workflow is to sign in, navigate protected shop features, and use the client to request or update backend data stored in MongoDB. The chatbot classifies a question, may fetch shop data, and generates a response. The graph includes the documented-by-source feature areas, but several UI-to-API links and unsampled route behaviors cannot be verified from the excerpts and are omitted or marked unverified.

Main entry points: [`InventoryManagement/src/routes.jsx`](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/routes.jsx) (Page routes), [`InventoryManagement/backend/server.js`](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/server.js) (Backend server), [`InventoryManagement/backend/chatbot/Controller.js`](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/Controller.js) (Chat orchestration), [`InventoryManagement/src/utils/axios.js`](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/utils/axios.js) (Authenticated API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_web_app["Web application<br/>[App.jsx]"]
  node_page_routes["Page routes<br/>[routes.jsx]"]
  node_api_client["Authenticated API client<br/>[axios.js]"]
end

subgraph group_identity["Identity"]
  node_auth_state["Auth state<br/>[AuthContext.jsx]"]
  node_protected_pages["Protected pages"]
  node_registration["Registration<br/>[Registration.jsx]"]
  node_user_profile["User profile<br/>[Profile.jsx]"]
end

subgraph group_operations["Shop operations"]
  node_inventory_ui["Inventory manager"]
  node_inventory_api["Inventory API<br/>[inventory.js]"]
  node_billing_ui["Bill generation<br/>[billgenerator.jsx]"]
  node_bill_history["Bill history<br/>[YourBills.jsx]"]
  node_bill_api["Billing API<br/>[bill.js]"]
  node_notifications_ui["Notifications<br/>[Notifications.jsx]"]
  node_notification_api["Notification API<br/>[notify.js]"]
  node_api_server["Backend server<br/>[server.js]"]
end

subgraph group_insights["Analysis and assistance"]
  node_product_analysis["Product analysis"]
  node_shop_analysis["Shop analysis<br/>[shopAnalysis.jsx]"]
  node_analysis_api["Shop analysis API<br/>[shopanalysis.js]"]
  node_chat_ui["Chat interface<br/>[chat.jsx]"]
  node_chat_routes["Chat endpoint<br/>[routes.js]"]
  node_chat_handler["Chat orchestration<br/>[Controller.js]"]
  node_intent_classifier["Intent classifier"]
  node_llm_service["Ollama service<br/>[OllamaService.js]"]
  node_chat_cache["Chat response cache<br/>[CacheMemory.js]"]
  node_rag_ingest["RAG ingestion<br/>[RagIngest.js]"]
  node_rag_retrieval["RAG retrieval<br/>[RagRetrieve.js]"]
  node_chromadb_client["Chroma client<br/>[ChromaClient.js]"]
end

subgraph group_persistence["Data stores"]
  node_product_store[("Product records<br/>[Product.js]")]
  node_bill_store[("Bill records<br/>[Bill.js]")]
  node_notification_store[("Notification records<br/>[Notification.js]")]
  node_user_store[("User records<br/>[User.js]")]
end

node_shop_owner(("Shop owner"))
node_ollama{{"Ollama service"}}
node_chroma{{"Chroma service"}}

node_shop_owner -->|"uses"| node_web_app
node_web_app -->|"loads routes"| node_page_routes
node_page_routes -->|"guards pages"| node_protected_pages
node_page_routes -->|"routes to"| node_inventory_ui
node_page_routes -->|"routes to"| node_billing_ui
node_page_routes -->|"routes to"| node_bill_history
node_page_routes -->|"routes to"| node_notifications_ui
node_page_routes -->|"routes to"| node_product_analysis
node_page_routes -->|"routes to"| node_shop_analysis
node_page_routes -->|"routes to"| node_user_profile
node_page_routes -->|"routes to"| node_registration
node_web_app -->|"provides auth"| node_auth_state
node_auth_state -->|"supplies state"| node_protected_pages
node_inventory_ui -->|"requests data"| node_api_client
node_notifications_ui -->|"requests data"| node_api_client
node_product_analysis -->|"requests data"| node_api_client
node_billing_ui -->|"requests data"| node_api_client
node_api_client -.->|"sends requests"| node_api_server
node_api_server -->|"mounts"| node_inventory_api
node_api_server -->|"mounts"| node_bill_api
node_api_server -->|"mounts"| node_notification_api
node_api_server -->|"mounts"| node_analysis_api
node_api_server -->|"mounts"| node_chat_routes
node_inventory_api -->|"reads and writes"| node_product_store
node_inventory_api -->|"uses"| node_notification_store
node_bill_api -->|"reads and writes"| node_bill_store
node_bill_api -->|"uses"| node_product_store
node_notification_api -->|"reads and writes"| node_notification_store
node_notification_api -->|"uses"| node_product_store
node_notification_api -->|"uses"| node_user_store
node_analysis_api -->|"reads"| node_bill_store
node_analysis_api -->|"reads"| node_product_store
node_auth_state -.->|"validates token"| node_api_server
node_chat_routes -->|"dispatches"| node_chat_handler
node_chat_handler -->|"classifies query"| node_intent_classifier
node_chat_handler -->|"generates answer"| node_llm_service
node_chat_handler -->|"checks cache"| node_chat_cache
node_llm_service -->|"calls"| node_ollama
node_rag_ingest -->|"adds documents"| node_chromadb_client
node_rag_retrieval -->|"queries"| node_chromadb_client
node_chromadb_client -->|"uses HTTP"| node_chroma
node_chat_handler -.->|"retrieves context"| node_rag_retrieval
node_chat_ui -.->|"sends questions"| node_chat_routes

click node_web_app "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/App.jsx"
click node_page_routes "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/routes.jsx"
click node_api_client "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/utils/axios.js"
click node_auth_state "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/context/AuthContext.jsx"
click node_protected_pages "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/context/UserProtectedWrapper.jsx"
click node_registration "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/Registration.jsx"
click node_user_profile "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/Profile.jsx"
click node_inventory_ui "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/inventorymanager.jsx"
click node_inventory_api "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/routes/inventory.js"
click node_billing_ui "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/billgenerator.jsx"
click node_bill_history "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/YourBills.jsx"
click node_bill_api "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/routes/bill.js"
click node_notifications_ui "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/Notifications.jsx"
click node_notification_api "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/routes/notify.js"
click node_product_analysis "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/ProductAnalysis.jsx"
click node_shop_analysis "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/shopAnalysis.jsx"
click node_analysis_api "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/routes/shopanalysis.js"
click node_chat_ui "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/chat.jsx"
click node_chat_routes "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/routes.js"
click node_chat_handler "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/Controller.js"
click node_intent_classifier "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/intent/IntentClassifier.js"
click node_llm_service "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/llm/OllamaService.js"
click node_chat_cache "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/memory/CacheMemory.js"
click node_rag_ingest "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/rag/RagIngest.js"
click node_rag_retrieval "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/rag/RagRetrieve.js"
click node_chromadb_client "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/rag/ChromaClient.js"
click node_api_server "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/server.js"
click node_product_store "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/models/Product.js"
click node_bill_store "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/models/Bill.js"
click node_notification_store "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/models/Notification.js"
click node_user_store "https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/models/User.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_web_app,node_page_routes,node_api_client toneBlue
class node_auth_state,node_protected_pages,node_registration,node_user_profile toneAmber
class node_inventory_ui,node_inventory_api,node_billing_ui,node_bill_history,node_bill_api,node_notifications_ui,node_notification_api,node_api_server toneMint
class node_product_analysis,node_shop_analysis,node_analysis_api,node_chat_ui,node_chat_routes,node_chat_handler,node_intent_classifier,node_llm_service,node_chat_cache,node_rag_ingest,node_rag_retrieval,node_chromadb_client toneRose
class node_product_store,node_bill_store,node_notification_store,node_user_store,node_shop_owner,node_ollama,node_chroma toneIndigo
```

## Components

### Web client

- [Web application](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/App.jsx): `InventoryManagement/src/App.jsx`
- [Page routes](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/routes.jsx): `InventoryManagement/src/routes.jsx`
- [Authenticated API client](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/utils/axios.js): `InventoryManagement/src/utils/axios.js`

### Identity

- [Auth state](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/context/AuthContext.jsx): `InventoryManagement/src/context/AuthContext.jsx`
- [Protected pages](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/context/UserProtectedWrapper.jsx): `InventoryManagement/src/context/UserProtectedWrapper.jsx`
- [Registration](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/Registration.jsx): `InventoryManagement/src/component/Registration.jsx`
- [User profile](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/Profile.jsx): `InventoryManagement/src/component/Profile.jsx`

### Shop operations

- [Inventory manager](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/inventorymanager.jsx): `InventoryManagement/src/component/inventorymanager.jsx`
- [Inventory API](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/routes/inventory.js): `InventoryManagement/backend/routes/inventory.js`
- [Bill generation](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/billgenerator.jsx): `InventoryManagement/src/component/billgenerator.jsx`
- [Bill history](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/YourBills.jsx): `InventoryManagement/src/component/YourBills.jsx`
- [Billing API](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/routes/bill.js): `InventoryManagement/backend/routes/bill.js`
- [Notifications](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/Notifications.jsx): `InventoryManagement/src/component/Notifications.jsx`
- [Notification API](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/routes/notify.js): `InventoryManagement/backend/routes/notify.js`
- [Backend server](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/server.js): `InventoryManagement/backend/server.js`

### Analysis and assistance

- [Product analysis](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/ProductAnalysis.jsx): `InventoryManagement/src/component/ProductAnalysis.jsx`
- [Shop analysis](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/shopAnalysis.jsx): `InventoryManagement/src/component/shopAnalysis.jsx`
- [Shop analysis API](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/routes/shopanalysis.js): `InventoryManagement/backend/routes/shopanalysis.js`
- [Chat interface](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/src/component/chat.jsx): `InventoryManagement/src/component/chat.jsx`
- [Chat endpoint](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/routes.js): `InventoryManagement/backend/chatbot/routes.js`
- [Chat orchestration](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/Controller.js): `InventoryManagement/backend/chatbot/Controller.js`
- [Intent classifier](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/intent/IntentClassifier.js): `InventoryManagement/backend/chatbot/intent/IntentClassifier.js`
- [Ollama service](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/llm/OllamaService.js): `InventoryManagement/backend/chatbot/llm/OllamaService.js`
- [Chat response cache](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/memory/CacheMemory.js): `InventoryManagement/backend/chatbot/memory/CacheMemory.js`
- [RAG ingestion](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/rag/RagIngest.js): `InventoryManagement/backend/chatbot/rag/RagIngest.js`
- [RAG retrieval](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/rag/RagRetrieve.js): `InventoryManagement/backend/chatbot/rag/RagRetrieve.js`
- [Chroma client](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/chatbot/rag/ChromaClient.js): `InventoryManagement/backend/chatbot/rag/ChromaClient.js`

### Data stores

- [Product records](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/models/Product.js): `InventoryManagement/backend/models/Product.js`
- [Bill records](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/models/Bill.js): `InventoryManagement/backend/models/Bill.js`
- [Notification records](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/models/Notification.js): `InventoryManagement/backend/models/Notification.js`
- [User records](https://github.com/dgpatil98600/full-stack/blob/main/InventoryManagement/backend/models/User.js): `InventoryManagement/backend/models/User.js`

### Other components

- **Shop owner**
- **Ollama service**
- **Chroma service**

## Connections

- Shop owner → Web application: uses
- Web application → Page routes: loads routes (evidence: `InventoryManagement/src/App.jsx`)
- Page routes → Protected pages: guards pages (evidence: `InventoryManagement/src/routes.jsx`)
- Page routes → Inventory manager: routes to (evidence: `InventoryManagement/src/routes.jsx`)
- Page routes → Bill generation: routes to (evidence: `InventoryManagement/src/routes.jsx`)
- Page routes → Bill history: routes to (evidence: `InventoryManagement/src/routes.jsx`)
- Page routes → Notifications: routes to (evidence: `InventoryManagement/src/routes.jsx`)
- Page routes → Product analysis: routes to (evidence: `InventoryManagement/src/routes.jsx`)
- Page routes → Shop analysis: routes to (evidence: `InventoryManagement/src/routes.jsx`)
- Page routes → User profile: routes to (evidence: `InventoryManagement/src/routes.jsx`)
- Page routes → Registration: routes to (evidence: `InventoryManagement/src/routes.jsx`)
- Web application → Auth state: provides auth (evidence: `InventoryManagement/src/main.jsx`)
- Auth state → Protected pages: supplies state (evidence: `InventoryManagement/src/context/UserProtectedWrapper.jsx`)
- Inventory manager → Authenticated API client: requests data (evidence: `InventoryManagement/src/component/inventorymanager.jsx`)
- Notifications → Authenticated API client: requests data (evidence: `InventoryManagement/src/component/Notifications.jsx`)
- Product analysis → Authenticated API client: requests data (evidence: `InventoryManagement/src/component/ProductAnalysis.jsx`)
- Bill generation → Authenticated API client: requests data (evidence: `InventoryManagement/src/component/billgenerator.jsx`)
- Authenticated API client → Backend server: sends requests
- Backend server → Inventory API: mounts (evidence: `InventoryManagement/backend/server.js`)
- Backend server → Billing API: mounts (evidence: `InventoryManagement/backend/server.js`)
- Backend server → Notification API: mounts (evidence: `InventoryManagement/backend/server.js`)
- Backend server → Shop analysis API: mounts (evidence: `InventoryManagement/backend/server.js`)
- Backend server → Chat endpoint: mounts (evidence: `InventoryManagement/backend/server.js`)
- Inventory API → Product records: reads and writes (evidence: `InventoryManagement/backend/routes/inventory.js`)
- Inventory API → Notification records: uses (evidence: `InventoryManagement/backend/routes/inventory.js`)
- Billing API → Bill records: reads and writes (evidence: `InventoryManagement/backend/routes/bill.js`)
- Billing API → Product records: uses (evidence: `InventoryManagement/backend/routes/bill.js`)
- Notification API → Notification records: reads and writes (evidence: `InventoryManagement/backend/routes/notify.js`)
- Notification API → Product records: uses (evidence: `InventoryManagement/backend/routes/notify.js`)
- Notification API → User records: uses (evidence: `InventoryManagement/backend/routes/notify.js`)
- Shop analysis API → Bill records: reads (evidence: `InventoryManagement/backend/routes/shopanalysis.js`)
- Shop analysis API → Product records: reads (evidence: `InventoryManagement/backend/routes/shopanalysis.js`)
- Auth state → Backend server: validates token
- Chat endpoint → Chat orchestration: dispatches (evidence: `InventoryManagement/backend/chatbot/routes.js`)
- Chat orchestration → Intent classifier: classifies query (evidence: `InventoryManagement/backend/chatbot/Controller.js`)
- Chat orchestration → Ollama service: generates answer (evidence: `InventoryManagement/backend/chatbot/Controller.js`)
- Chat orchestration → Chat response cache: checks cache (evidence: `InventoryManagement/backend/chatbot/Controller.js`)
- Ollama service → Ollama service: calls (evidence: `InventoryManagement/backend/chatbot/llm/OllamaService.js`)
- RAG ingestion → Chroma client: adds documents (evidence: `InventoryManagement/backend/chatbot/rag/RagIngest.js`)
- RAG retrieval → Chroma client: queries (evidence: `InventoryManagement/backend/chatbot/rag/RagRetrieve.js`)
- Chroma client → Chroma service: uses HTTP (evidence: `InventoryManagement/backend/chatbot/rag/ChromaClient.js`)
- Chat orchestration → RAG retrieval: retrieves context
- Chat interface → Chat endpoint: sends questions
