# springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3 architecture

> Architecture diagram of the GitHub repository springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3
- Repository: https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3

## Overview

MarketMind AI is a small-business sales-intelligence platform: users access role-oriented dashboards and operational views, while backend APIs handle sales, invoices, inventory, payments, notifications, and audit data; AI endpoints expose forecasts and customer/product insights. The sampled code confirms sales CSV ingestion into relational records, invoice-controller service calls, AI API capabilities, and audit-log reading. Several route handlers, frontend service implementations, model-loading details, and persistence schema were not sampled, so those internal links are omitted or shown only where the available evidence supports them.

Main entry points: [`Frontend/src/routes/index.jsx`](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Frontend/src/routes/index.jsx) (Page routing), [`Backend_Database/src/controllers/salesController.js`](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/src/controllers/salesController.js) (Sales import and query), [`Frontend/src/App.jsx`](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Frontend/src/App.jsx) (Application shell), [`Frontend/src/pages`](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/tree/main/Frontend/src/pages) (Business views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_frontend["Application shell<br/>[App.jsx]"]
  node_web_routes["Page routing<br/>[index.jsx]"]
  node_dashboard["Role dashboards"]
  node_business_pages["Business views"]
  node_frontend_services["API services"]
end

subgraph group_backend["Business API"]
  node_backend_server["Backend API<br/>[server.js]"]
  node_sales_routes["Sales routes<br/>[salesroutes.js]"]
  node_sales_controller["Sales import and query<br/>[salesController.js]"]
  node_sale_service["Sales CSV service<br/>[saleService.js]"]
  node_invoice_controller["Invoice operations"]
  node_invoice_service["Invoice service<br/>[invoiceService.js]"]
  node_business_services["Business services"]
  node_retail_store[("Retail records")]
  node_backend_audit["Backend audit summary<br/>[auditRoutes.js]"]
end

subgraph group_ai["AI intelligence"]
  node_ai_api["AI endpoints<br/>[app.py]"]
  node_ai_pipeline["Forecast pipeline<br/>[main.py]"]
  node_feature_engineering["Feature engineering"]
  node_ai_modules["Customer and product insights"]
end

subgraph group_security["Access and audit"]
  node_security_server["Security API<br/>[server.js]"]
  node_protected_routes["Protected endpoints<br/>[protectedRoutes.js]"]
  node_security_controls["Auth and roles<br/>[middleware.js]"]
  node_security_audit["Audit summary<br/>[auditRoutes.js]"]
  node_activity_log["Activity log"]
end

node_user(("Business user"))

node_user -->|"uses"| node_frontend
node_frontend -->|"renders routes"| node_web_routes
node_web_routes -->|"selects page"| node_dashboard
node_web_routes -->|"selects page"| node_business_pages
node_business_pages -->|"requests data"| node_frontend_services
node_backend_server -->|"mounts routes"| node_sales_routes
node_sales_controller -->|"reads CSV"| node_sale_service
node_sales_controller -->|"writes and queries"| node_retail_store
node_invoice_controller -->|"calls"| node_invoice_service
node_business_services -->|"accesses records"| node_retail_store
node_ai_pipeline -->|"runs stage"| node_feature_engineering
node_ai_api -->|"serves insights"| node_ai_modules
node_security_server -->|"hosts routes"| node_protected_routes
node_protected_routes -->|"checks access"| node_security_controls
node_security_audit -->|"reads"| node_activity_log
node_backend_audit -->|"reads"| node_activity_log

click node_frontend "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Frontend/src/App.jsx"
click node_web_routes "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Frontend/src/routes/index.jsx"
click node_dashboard "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Frontend/src/pages/dashboards/StoreManagerDashboard.jsx"
click node_business_pages "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/tree/main/Frontend/src/pages"
click node_frontend_services "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/tree/main/Frontend/src/services"
click node_backend_server "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/server.js"
click node_sales_routes "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/src/routes/salesroutes.js"
click node_sales_controller "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/src/controllers/salesController.js"
click node_sale_service "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/src/services/saleService.js"
click node_invoice_controller "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/src/controllers/invoiceController.js"
click node_invoice_service "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/src/services/invoiceService.js"
click node_business_services "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/tree/main/Backend_Database/src/services"
click node_ai_api "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/AIML/api/app.py"
click node_ai_pipeline "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/AIML/main.py"
click node_feature_engineering "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/AIML/preprocessing/feature_engineering.py"
click node_ai_modules "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/tree/main/AIML"
click node_security_server "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Security_API/server.js"
click node_protected_routes "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Security_API/protectedRoutes.js"
click node_security_controls "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Security_API/middleware.js"
click node_security_audit "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Security_API/auditRoutes.js"
click node_backend_audit "https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/src/routes/auditRoutes.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_frontend,node_web_routes,node_dashboard,node_business_pages,node_frontend_services,node_user toneBlue
class node_backend_server,node_sales_routes,node_sales_controller,node_sale_service,node_invoice_controller,node_invoice_service,node_business_services,node_retail_store,node_backend_audit toneAmber
class node_ai_api,node_ai_pipeline,node_feature_engineering,node_ai_modules toneMint
class node_security_server,node_protected_routes,node_security_controls,node_security_audit,node_activity_log toneRose
```

## Components

### Web experience

- [Application shell](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Page routing](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Frontend/src/routes/index.jsx): `Frontend/src/routes/index.jsx`
- [Role dashboards](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Frontend/src/pages/dashboards/StoreManagerDashboard.jsx): `Frontend/src/pages/dashboards/StoreManagerDashboard.jsx`
- [Business views](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/tree/main/Frontend/src/pages): `Frontend/src/pages`
- [API services](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/tree/main/Frontend/src/services): `Frontend/src/services`

### Business API

- [Backend API](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/server.js): `Backend_Database/server.js`
- [Sales routes](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/src/routes/salesroutes.js): `Backend_Database/src/routes/salesroutes.js`
- [Sales import and query](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/src/controllers/salesController.js): `Backend_Database/src/controllers/salesController.js`
- [Sales CSV service](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/src/services/saleService.js): `Backend_Database/src/services/saleService.js`
- [Invoice operations](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/src/controllers/invoiceController.js): `Backend_Database/src/controllers/invoiceController.js`
- [Invoice service](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/src/services/invoiceService.js): `Backend_Database/src/services/invoiceService.js`
- [Business services](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/tree/main/Backend_Database/src/services): `Backend_Database/src/services`
- **Retail records**
- [Backend audit summary](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Backend_Database/src/routes/auditRoutes.js): `Backend_Database/src/routes/auditRoutes.js`

### AI intelligence

- [AI endpoints](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/AIML/api/app.py): `AIML/api/app.py`
- [Forecast pipeline](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/AIML/main.py): `AIML/main.py`
- [Feature engineering](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/AIML/preprocessing/feature_engineering.py): `AIML/preprocessing/feature_engineering.py`
- [Customer and product insights](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/tree/main/AIML): `AIML`

### Access and audit

- [Security API](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Security_API/server.js): `Security_API/server.js`
- [Protected endpoints](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Security_API/protectedRoutes.js): `Security_API/protectedRoutes.js`
- [Auth and roles](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Security_API/middleware.js): `Security_API/middleware.js`
- [Audit summary](https://github.com/springboardmentor54321v/small-business-sales-intelligence-platform-sb7-team3/blob/main/Security_API/auditRoutes.js): `Security_API/auditRoutes.js`
- **Activity log**

### Other components

- **Business user**

## Connections

- Business user → Application shell: uses
- Application shell → Page routing: renders routes
- Page routing → Role dashboards: selects page
- Page routing → Business views: selects page
- Business views → API services: requests data
- Backend API → Sales routes: mounts routes
- Sales import and query → Sales CSV service: reads CSV
- Sales import and query → Retail records: writes and queries
- Invoice operations → Invoice service: calls
- Business services → Retail records: accesses records
- Forecast pipeline → Feature engineering: runs stage
- AI endpoints → Customer and product insights: serves insights
- Security API → Protected endpoints: hosts routes
- Protected endpoints → Auth and roles: checks access
- Audit summary → Activity log: reads
- Backend audit summary → Activity log: reads
