# nanikandikonda/smart-saloon architecture

> Architecture diagram of the GitHub repository nanikandikonda/smart-saloon, 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/nanikandikonda/smart-saloon
- Repository: https://github.com/nanikandikonda/smart-saloon

## Overview

SmartSalon is a salon booking and operations product: customers browse services and book appointments, while authenticated staff use customer, appointment, payment, reporting, and branch-management views. The React application routes users to these experiences and calls the FastAPI backend; backend endpoints operate on salon records and can dispatch notifications or payments. A chatbot has both grounded salon-information retrieval and controlled, role-checked CRM lookup capabilities. The README gives no further detail, and several backend/frontend modules were not sampled, so uncertain internal connections are omitted.

Main entry points: [`src/App.jsx`](https://github.com/nanikandikonda/smart-saloon/blob/main/src/App.jsx) (App Routing), [`src/services/api.js`](https://github.com/nanikandikonda/smart-saloon/blob/main/src/services/api.js) (API Client), [`backend/main.py`](https://github.com/nanikandikonda/smart-saloon/blob/main/backend/main.py) (HTTP API), [`backend/intent_router.py`](https://github.com/nanikandikonda/smart-saloon/blob/main/backend/intent_router.py) (Intent Router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Customer Web"]
  node_app["App Routing<br/>[App.jsx]"]
  node_authui["Sign-in UI<br/>[AuthModal.jsx]"]
  node_authstate["Auth State<br/>[AuthContext.jsx]"]
  node_services["Service Catalog<br/>[Services.jsx]"]
  node_booking["Appointment Booking<br/>[Booking.jsx]"]
  node_customerportal["Customer Portal"]
  node_api_client["API Client<br/>[api.js]"]
  node_chatui["Chat Widget<br/>[Chatbot.jsx]"]
end

subgraph group_ops["Salon Operations"]
  node_crm["CRM Console"]
  node_manager["Branch Management"]
  node_staff["Staff Dashboard<br/>[StaffDashboard.jsx]"]
end

subgraph group_server["Backend API"]
  node_api["HTTP API<br/>[main.py]"]
  node_identity["Identity &amp; Roles<br/>[auth.py]"]
  node_records[("Salon Records<br/>[models.py]")]
  node_payments["Payment Handling<br/>[payments.py]"]
  node_notifications["Notifications<br/>[notifications.py]"]
end

subgraph group_assistant["Salon Assistant"]
  node_intent["Intent Router<br/>[intent_router.py]"]
  node_rag["Knowledge Retrieval<br/>[rag_service.py]"]
  node_crmquery["Authorized CRM Queries"]
  node_ollama["Local Language Model<br/>[ollama_service.py]"]
  node_chromadb[("Knowledge Index<br/>[rag_service.py]")]
end

node_customer(("Customer"))
node_operator(("Salon Operator"))
node_sms["Notification Provider"]

node_customer -->|"opens"| node_app
node_operator -->|"opens"| node_app
node_app -->|"routes to"| node_services
node_app -->|"routes to"| node_booking
node_app -->|"opens"| node_authui
node_app -->|"routes to"| node_customerportal
node_app -->|"routes to"| node_crm
node_app -->|"routes to"| node_manager
node_app -->|"routes to"| node_staff
node_authui -->|"calls"| node_authstate
node_services -->|"loads services"| node_api_client
node_manager -->|"manages branches"| node_api_client
node_booking -->|"submits booking"| node_api_client
node_customerportal -->|"loads account"| node_api_client
node_crm -->|"requests CRM data"| node_api_client
node_api_client -->|"HTTP requests"| node_api
node_api -->|"checks access"| node_identity
node_api -->|"reads and writes"| node_records
node_api -->|"handles payment"| node_payments
node_api -->|"dispatches notices"| node_notifications
node_notifications -.->|"may dispatch"| node_sms
node_customer -->|"asks questions"| node_chatui
node_chatui -->|"sends chat"| node_api_client
node_api -->|"routes chat intent"| node_intent
node_intent -->|"requests knowledge"| node_rag
node_intent -->|"requests CRM data"| node_crmquery
node_rag -->|"searches index"| node_chromadb
node_rag -->|"grounds response"| node_ollama
node_crmquery -->|"queries records"| node_records

click node_app "https://github.com/nanikandikonda/smart-saloon/blob/main/src/App.jsx"
click node_authui "https://github.com/nanikandikonda/smart-saloon/blob/main/src/components/AuthModal.jsx"
click node_authstate "https://github.com/nanikandikonda/smart-saloon/blob/main/src/context/AuthContext.jsx"
click node_services "https://github.com/nanikandikonda/smart-saloon/blob/main/src/pages/Services.jsx"
click node_booking "https://github.com/nanikandikonda/smart-saloon/blob/main/src/pages/Booking.jsx"
click node_customerportal "https://github.com/nanikandikonda/smart-saloon/blob/main/src/pages/customer/CustomerDashboard.jsx"
click node_api_client "https://github.com/nanikandikonda/smart-saloon/blob/main/src/services/api.js"
click node_crm "https://github.com/nanikandikonda/smart-saloon/tree/main/src/pages/crm"
click node_manager "https://github.com/nanikandikonda/smart-saloon/blob/main/src/pages/manager/ManagerBranchManagement.jsx"
click node_staff "https://github.com/nanikandikonda/smart-saloon/blob/main/src/pages/staff/StaffDashboard.jsx"
click node_api "https://github.com/nanikandikonda/smart-saloon/blob/main/backend/main.py"
click node_identity "https://github.com/nanikandikonda/smart-saloon/blob/main/backend/auth.py"
click node_records "https://github.com/nanikandikonda/smart-saloon/blob/main/backend/models.py"
click node_payments "https://github.com/nanikandikonda/smart-saloon/blob/main/backend/payments.py"
click node_notifications "https://github.com/nanikandikonda/smart-saloon/blob/main/backend/notifications.py"
click node_chatui "https://github.com/nanikandikonda/smart-saloon/blob/main/src/components/Chatbot.jsx"
click node_intent "https://github.com/nanikandikonda/smart-saloon/blob/main/backend/intent_router.py"
click node_rag "https://github.com/nanikandikonda/smart-saloon/blob/main/backend/rag_service.py"
click node_crmquery "https://github.com/nanikandikonda/smart-saloon/blob/main/backend/crm_query_service.py"
click node_ollama "https://github.com/nanikandikonda/smart-saloon/blob/main/backend/ollama_service.py"
click node_chromadb "https://github.com/nanikandikonda/smart-saloon/blob/main/backend/rag_service.py"

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_authui,node_authstate,node_services,node_booking,node_customerportal,node_api_client,node_chatui toneBlue
class node_crm,node_manager,node_staff toneAmber
class node_api,node_identity,node_records,node_payments,node_notifications toneMint
class node_intent,node_rag,node_crmquery,node_ollama,node_chromadb toneRose
class node_customer,node_operator,node_sms toneIndigo
```

## Components

### Customer Web

- [App Routing](https://github.com/nanikandikonda/smart-saloon/blob/main/src/App.jsx): `src/App.jsx`
- [Sign-in UI](https://github.com/nanikandikonda/smart-saloon/blob/main/src/components/AuthModal.jsx): `src/components/AuthModal.jsx`
- [Auth State](https://github.com/nanikandikonda/smart-saloon/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Service Catalog](https://github.com/nanikandikonda/smart-saloon/blob/main/src/pages/Services.jsx): `src/pages/Services.jsx`
- [Appointment Booking](https://github.com/nanikandikonda/smart-saloon/blob/main/src/pages/Booking.jsx): `src/pages/Booking.jsx`
- [Customer Portal](https://github.com/nanikandikonda/smart-saloon/blob/main/src/pages/customer/CustomerDashboard.jsx): `src/pages/customer/CustomerDashboard.jsx`
- [API Client](https://github.com/nanikandikonda/smart-saloon/blob/main/src/services/api.js): `src/services/api.js`
- [Chat Widget](https://github.com/nanikandikonda/smart-saloon/blob/main/src/components/Chatbot.jsx): `src/components/Chatbot.jsx`

### Salon Operations

- [CRM Console](https://github.com/nanikandikonda/smart-saloon/tree/main/src/pages/crm): `src/pages/crm`
- [Branch Management](https://github.com/nanikandikonda/smart-saloon/blob/main/src/pages/manager/ManagerBranchManagement.jsx): `src/pages/manager/ManagerBranchManagement.jsx`
- [Staff Dashboard](https://github.com/nanikandikonda/smart-saloon/blob/main/src/pages/staff/StaffDashboard.jsx): `src/pages/staff/StaffDashboard.jsx`

### Backend API

- [HTTP API](https://github.com/nanikandikonda/smart-saloon/blob/main/backend/main.py): `backend/main.py`
- [Identity & Roles](https://github.com/nanikandikonda/smart-saloon/blob/main/backend/auth.py): `backend/auth.py`
- [Salon Records](https://github.com/nanikandikonda/smart-saloon/blob/main/backend/models.py): `backend/models.py`
- [Payment Handling](https://github.com/nanikandikonda/smart-saloon/blob/main/backend/payments.py): `backend/payments.py`
- [Notifications](https://github.com/nanikandikonda/smart-saloon/blob/main/backend/notifications.py): `backend/notifications.py`

### Salon Assistant

- [Intent Router](https://github.com/nanikandikonda/smart-saloon/blob/main/backend/intent_router.py): `backend/intent_router.py`
- [Knowledge Retrieval](https://github.com/nanikandikonda/smart-saloon/blob/main/backend/rag_service.py): `backend/rag_service.py`
- [Authorized CRM Queries](https://github.com/nanikandikonda/smart-saloon/blob/main/backend/crm_query_service.py): `backend/crm_query_service.py`
- [Local Language Model](https://github.com/nanikandikonda/smart-saloon/blob/main/backend/ollama_service.py): `backend/ollama_service.py`
- [Knowledge Index](https://github.com/nanikandikonda/smart-saloon/blob/main/backend/rag_service.py): `backend/rag_service.py`

### Other components

- **Customer**
- **Salon Operator**
- **Notification Provider**

## Connections

- Customer → App Routing: opens
- Salon Operator → App Routing: opens
- App Routing → Service Catalog: routes to
- App Routing → Appointment Booking: routes to
- App Routing → Sign-in UI: opens
- App Routing → Customer Portal: routes to
- App Routing → CRM Console: routes to
- App Routing → Branch Management: routes to
- App Routing → Staff Dashboard: routes to
- Sign-in UI → Auth State: calls
- Service Catalog → API Client: loads services
- Branch Management → API Client: manages branches
- Appointment Booking → API Client: submits booking
- Customer Portal → API Client: loads account
- CRM Console → API Client: requests CRM data
- API Client → HTTP API: HTTP requests
- HTTP API → Identity & Roles: checks access
- HTTP API → Salon Records: reads and writes
- HTTP API → Payment Handling: handles payment
- HTTP API → Notifications: dispatches notices
- Notifications → Notification Provider: may dispatch
- Customer → Chat Widget: asks questions
- Chat Widget → API Client: sends chat
- HTTP API → Intent Router: routes chat intent
- Intent Router → Knowledge Retrieval: requests knowledge
- Intent Router → Authorized CRM Queries: requests CRM data
- Knowledge Retrieval → Knowledge Index: searches index
- Knowledge Retrieval → Local Language Model: grounds response
- Authorized CRM Queries → Salon Records: queries records
