# saumyatiwariexe/sunpowerodoo architecture

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

- Interactive diagram: https://gitdiagram.com/saumyatiwariexe/sunpowerodoo
- Repository: https://github.com/saumyatiwariexe/sunpowerodoo

## Overview

SunPower is a rooftop-solar installation management platform. Its documented business workflow runs from enquiry and survey through quoting, ordering, dispatch with serial scans, installation proof, warranty, and service; a director dashboard provides oversight. The available backend source implements the FastAPI entry point, user authentication, shared database/security foundations, and product/user models, while the README documents broader workflow capabilities whose implementation is not present in the supplied tree. Links for those documented stages rely on the README; unsampled wiring is not inferred.

Main entry points: [`backend/app/modules/users/router.py`](https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/modules/users/router.py) (Authentication routes), [`backend/app/modules/users/service.py`](https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/modules/users/service.py) (Login service), [`backend/app/core/db.py`](https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/core/db.py) (Database sessions), [`backend/app/core/deps.py`](https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/core/deps.py) (Session and role checks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_web["React interface"]
end

subgraph group_workflow["Solar operations"]
  node_enquiry["Enquiry intake"]
  node_survey["Site survey"]
  node_quote["Quote"]
  node_order["Order"]
  node_dispatch["Dispatch and serial scans"]
  node_installation["Installation proof"]
  node_warranty["Warranty"]
  node_service["Service tickets"]
  node_dashboard["Director dashboard"]
  node_catalog["Product catalog<br/>[models.py]"]
end

subgraph group_identity["Identity and access"]
  node_auth["Authentication routes<br/>[router.py]"]
  node_auth_service["Login service<br/>[service.py]"]
  node_users["User records<br/>[models.py]"]
  node_access["Session and role checks<br/>[deps.py]"]
  node_security["Token and password security<br/>[security.py]"]
end

subgraph group_platform["Backend platform"]
  node_api["FastAPI application<br/>[main.py]"]
  node_config["Application settings<br/>[config.py]"]
  node_db_layer["Database sessions<br/>[db.py]"]
  node_errors["Error responses<br/>[errors.py]"]
end

node_staff(("Company staff"))
node_postgres[("PostgreSQL")]

node_staff -->|"uses"| node_web
node_web -.->|"calls API"| node_api
node_api -->|"mounts routes"| node_auth
node_api -->|"registers handlers"| node_errors
node_staff -->|"starts workflow"| node_enquiry
node_enquiry -->|"leads to"| node_survey
node_survey -->|"leads to"| node_quote
node_quote -->|"leads to"| node_order
node_order -->|"leads to"| node_dispatch
node_dispatch -->|"leads to"| node_installation
node_installation -->|"triggers"| node_warranty
node_warranty -->|"followed by"| node_service
node_staff -->|"reviews"| node_dashboard
node_auth -->|"authenticates"| node_auth_service
node_auth -->|"gets session"| node_db_layer
node_auth -->|"creates token"| node_security
node_auth_service -->|"loads user"| node_users
node_auth_service -->|"verifies password"| node_security
node_access -->|"gets session"| node_db_layer
node_access -->|"loads user"| node_users
node_access -->|"validates token"| node_security
node_db_layer -->|"reads settings"| node_config
node_db_layer -.->|"connects"| node_postgres
node_auth_service -->|"raises errors"| node_errors

click node_web "https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/frontend"
click node_api "https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/main.py"
click node_enquiry "https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules"
click node_survey "https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules"
click node_quote "https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules"
click node_order "https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules"
click node_dispatch "https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules"
click node_installation "https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules"
click node_warranty "https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules"
click node_service "https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules"
click node_dashboard "https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules"
click node_auth "https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/modules/users/router.py"
click node_auth_service "https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/modules/users/service.py"
click node_users "https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/modules/users/models.py"
click node_catalog "https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/modules/catalog/models.py"
click node_access "https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/core/deps.py"
click node_security "https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/core/security.py"
click node_config "https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/core/config.py"
click node_db_layer "https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/core/db.py"
click node_errors "https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/core/errors.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_web toneBlue
class node_enquiry,node_survey,node_quote,node_order,node_dispatch,node_installation,node_warranty,node_service,node_dashboard,node_catalog,node_postgres toneAmber
class node_auth,node_auth_service,node_users,node_access,node_security toneMint
class node_api,node_config,node_db_layer,node_errors toneRose
class node_staff toneIndigo
```

## Components

### User experience

- [React interface](https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/frontend): `frontend`

### Solar operations

- [Enquiry intake](https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules): `backend/app/modules`
- [Site survey](https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules): `backend/app/modules`
- [Quote](https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules): `backend/app/modules`
- [Order](https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules): `backend/app/modules`
- [Dispatch and serial scans](https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules): `backend/app/modules`
- [Installation proof](https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules): `backend/app/modules`
- [Warranty](https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules): `backend/app/modules`
- [Service tickets](https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules): `backend/app/modules`
- [Director dashboard](https://github.com/saumyatiwariexe/sunpowerodoo/tree/main/backend/app/modules): `backend/app/modules`
- [Product catalog](https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/modules/catalog/models.py): `backend/app/modules/catalog/models.py`

### Identity and access

- [Authentication routes](https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/modules/users/router.py): `backend/app/modules/users/router.py`
- [Login service](https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/modules/users/service.py): `backend/app/modules/users/service.py`
- [User records](https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/modules/users/models.py): `backend/app/modules/users/models.py`
- [Session and role checks](https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/core/deps.py): `backend/app/core/deps.py`
- [Token and password security](https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/core/security.py): `backend/app/core/security.py`

### Backend platform

- [FastAPI application](https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/main.py): `backend/app/main.py`
- [Application settings](https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/core/config.py): `backend/app/core/config.py`
- [Database sessions](https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/core/db.py): `backend/app/core/db.py`
- [Error responses](https://github.com/saumyatiwariexe/sunpowerodoo/blob/main/backend/app/core/errors.py): `backend/app/core/errors.py`

### Other components

- **Company staff**
- **PostgreSQL**

## Connections

- Company staff → React interface: uses (evidence: `README.md`)
- React interface → FastAPI application: calls API
- FastAPI application → Authentication routes: mounts routes (evidence: `backend/app/main.py`)
- FastAPI application → Error responses: registers handlers (evidence: `backend/app/main.py`)
- Company staff → Enquiry intake: starts workflow (evidence: `README.md`)
- Enquiry intake → Site survey: leads to (evidence: `README.md`)
- Site survey → Quote: leads to (evidence: `README.md`)
- Quote → Order: leads to (evidence: `README.md`)
- Order → Dispatch and serial scans: leads to (evidence: `README.md`)
- Dispatch and serial scans → Installation proof: leads to (evidence: `README.md`)
- Installation proof → Warranty: triggers (evidence: `README.md`)
- Warranty → Service tickets: followed by (evidence: `README.md`)
- Company staff → Director dashboard: reviews (evidence: `README.md`)
- Authentication routes → Login service: authenticates (evidence: `backend/app/modules/users/router.py`)
- Authentication routes → Database sessions: gets session (evidence: `backend/app/modules/users/router.py`)
- Authentication routes → Token and password security: creates token (evidence: `backend/app/modules/users/router.py`)
- Login service → User records: loads user (evidence: `backend/app/modules/users/service.py`)
- Login service → Token and password security: verifies password (evidence: `backend/app/modules/users/service.py`)
- Session and role checks → Database sessions: gets session (evidence: `backend/app/core/deps.py`)
- Session and role checks → User records: loads user (evidence: `backend/app/core/deps.py`)
- Session and role checks → Token and password security: validates token (evidence: `backend/app/core/deps.py`)
- Database sessions → Application settings: reads settings (evidence: `backend/app/core/db.py`)
- Database sessions → PostgreSQL: connects (evidence: `README.md`)
- Login service → Error responses: raises errors (evidence: `backend/app/modules/users/service.py`)
