# ramawaterfilter/seller-board architecture

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

- Interactive diagram: https://gitdiagram.com/ramawaterfilter/seller-board
- Repository: https://github.com/ramawaterfilter/seller-board

## Overview

Rama Commerce Intelligence is an early commerce-reporting foundation, not a finished reporting product. The implemented user workflow is sign-in with MFA, select a workspace, then manage Shopify connections and manually verify or sync a store; sync imports raw commerce records. The dashboard is currently a shell, and profit reporting, Amazon, and manual B2B workflows are not implemented here. Edges reflect shown calls, source-index references, or README statements; unsampled reporting internals are omitted.

Main entry points: [`api/src/app/main.py`](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/main.py) (FastAPI application), [`api/src/app/workspace/service/auth.py`](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/service/auth.py) (Auth service), [`web/src/App.tsx`](https://github.com/ramawaterfilter/seller-board/blob/main/web/src/App.tsx) (App shell), [`api/src/app/workspace/api/deps.py`](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/api/deps.py) (Permissions and dependencies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_app_shell["App shell<br/>[App.tsx]"]
  node_login["Sign-in UI<br/>[Login.tsx]"]
  node_channels_ui["Channels UI<br/>[Channels.tsx]"]
  node_dashboard["Dashboard shell<br/>[Dashboard.tsx]"]
  node_web_api["Web API client<br/>[api.ts]"]
end

subgraph group_identity["Identity and access"]
  node_auth_api["Auth endpoints<br/>[auth.py]"]
  node_auth_service["Auth service<br/>[auth.py]"]
  node_session["Session handling<br/>[session.py]"]
  node_access["Permissions and dependencies<br/>[deps.py]"]
  node_rbac["RBAC checks<br/>[rbac.py]"]
  node_totp["TOTP MFA<br/>[totp.py]"]
  node_email_otp["Email OTP sender<br/>[email_otp.py]"]
end

subgraph group_ingestion["Shopify ingestion"]
  node_shopify_api["Shopify endpoints<br/>[shopify.py]"]
  node_shopify_service["Connector and sync service<br/>[shopify.py]"]
  node_shopify_client["Shopify client<br/>[client.py]"]
  node_shopify_queries["GraphQL operations<br/>[queries.py]"]
end

subgraph group_platform["API platform"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_health["Health and readiness<br/>[health.py]"]
  node_database[("PostgreSQL access<br/>[database.py]")]
  node_audit[("Audit log<br/>[audit.py]")]
end

node_user(("Workspace user"))
node_redis[("Redis")]
node_shopify["Shopify store"]
node_postgres[("PostgreSQL")]

node_user -->|"uses"| node_app_shell
node_app_shell -->|"renders"| node_login
node_app_shell -->|"renders"| node_dashboard
node_app_shell -->|"renders"| node_channels_ui
node_app_shell -->|"calls"| node_web_api
node_login -->|"calls"| node_web_api
node_channels_ui -->|"calls"| node_web_api
node_web_api -.->|"sends requests"| node_api_app
node_api_app -->|"registers"| node_auth_api
node_api_app -->|"registers"| node_shopify_api
node_api_app -->|"registers"| node_health
node_auth_api -->|"calls"| node_auth_service
node_auth_api -->|"uses dependencies"| node_access
node_auth_service -->|"issues sessions"| node_session
node_auth_service -->|"records events"| node_audit
node_auth_service -->|"checks MFA"| node_totp
node_auth_api -->|"hashes tokens"| node_session
node_access -->|"uses"| node_auth_service
node_access -->|"validates sessions"| node_session
node_access -->|"checks grants"| node_rbac
node_shopify_api -->|"calls"| node_shopify_service
node_shopify_api -->|"uses dependencies"| node_access
node_shopify_api -->|"records events"| node_audit
node_shopify_service -->|"queries store"| node_shopify_client
node_shopify_client -->|"uses operations"| node_shopify_queries
node_shopify_client -->|"sends GraphQL"| node_shopify
node_shopify_service -->|"stores raw records"| node_postgres
node_api_app -->|"creates and closes"| node_database
node_api_app -->|"creates and closes"| node_redis
node_health -.->|"checks readiness"| node_database
node_health -.->|"checks readiness"| node_redis
node_database -->|"connects"| node_postgres
node_auth_service -.->|"sends OTP"| node_email_otp

click node_app_shell "https://github.com/ramawaterfilter/seller-board/blob/main/web/src/App.tsx"
click node_login "https://github.com/ramawaterfilter/seller-board/blob/main/web/src/pages/Login.tsx"
click node_channels_ui "https://github.com/ramawaterfilter/seller-board/blob/main/web/src/pages/Channels.tsx"
click node_dashboard "https://github.com/ramawaterfilter/seller-board/blob/main/web/src/pages/Dashboard.tsx"
click node_web_api "https://github.com/ramawaterfilter/seller-board/blob/main/web/src/api.ts"
click node_auth_api "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/api/auth.py"
click node_auth_service "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/service/auth.py"
click node_session "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/service/session.py"
click node_access "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/api/deps.py"
click node_rbac "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/service/rbac.py"
click node_totp "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/service/totp.py"
click node_email_otp "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/service/email_otp.py"
click node_api_app "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/main.py"
click node_health "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/platform/health.py"
click node_database "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/platform/database.py"
click node_shopify_api "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/ingestion/api/shopify.py"
click node_shopify_service "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/ingestion/service/shopify.py"
click node_shopify_client "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/ingestion/connectors/shopify/client.py"
click node_shopify_queries "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/ingestion/connectors/shopify/queries.py"
click node_audit "https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/platform/audit.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_shell,node_login,node_channels_ui,node_dashboard,node_web_api,node_user toneBlue
class node_auth_api,node_auth_service,node_session,node_access,node_rbac,node_totp,node_email_otp,node_redis,node_postgres toneAmber
class node_shopify_api,node_shopify_service,node_shopify_client,node_shopify_queries toneMint
class node_api_app,node_health,node_database,node_audit toneRose
class node_shopify toneIndigo
```

## Components

### Web interface

- [App shell](https://github.com/ramawaterfilter/seller-board/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Sign-in UI](https://github.com/ramawaterfilter/seller-board/blob/main/web/src/pages/Login.tsx): `web/src/pages/Login.tsx`
- [Channels UI](https://github.com/ramawaterfilter/seller-board/blob/main/web/src/pages/Channels.tsx): `web/src/pages/Channels.tsx`
- [Dashboard shell](https://github.com/ramawaterfilter/seller-board/blob/main/web/src/pages/Dashboard.tsx): `web/src/pages/Dashboard.tsx`
- [Web API client](https://github.com/ramawaterfilter/seller-board/blob/main/web/src/api.ts): `web/src/api.ts`

### Identity and access

- [Auth endpoints](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/api/auth.py): `api/src/app/workspace/api/auth.py`
- [Auth service](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/service/auth.py): `api/src/app/workspace/service/auth.py`
- [Session handling](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/service/session.py): `api/src/app/workspace/service/session.py`
- [Permissions and dependencies](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/api/deps.py): `api/src/app/workspace/api/deps.py`
- [RBAC checks](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/service/rbac.py): `api/src/app/workspace/service/rbac.py`
- [TOTP MFA](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/service/totp.py): `api/src/app/workspace/service/totp.py`
- [Email OTP sender](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/workspace/service/email_otp.py): `api/src/app/workspace/service/email_otp.py`

### Shopify ingestion

- [Shopify endpoints](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/ingestion/api/shopify.py): `api/src/app/ingestion/api/shopify.py`
- [Connector and sync service](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/ingestion/service/shopify.py): `api/src/app/ingestion/service/shopify.py`
- [Shopify client](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/ingestion/connectors/shopify/client.py): `api/src/app/ingestion/connectors/shopify/client.py`
- [GraphQL operations](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/ingestion/connectors/shopify/queries.py): `api/src/app/ingestion/connectors/shopify/queries.py`

### API platform

- [FastAPI application](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/main.py): `api/src/app/main.py`
- [Health and readiness](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/platform/health.py): `api/src/app/platform/health.py`
- [PostgreSQL access](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/platform/database.py): `api/src/app/platform/database.py`
- [Audit log](https://github.com/ramawaterfilter/seller-board/blob/main/api/src/app/platform/audit.py): `api/src/app/platform/audit.py`

### Other components

- **Workspace user**
- **Redis**
- **Shopify store**
- **PostgreSQL**

## Connections

- Workspace user → App shell: uses (evidence: `README.md`)
- App shell → Sign-in UI: renders (evidence: `web/src/App.tsx`)
- App shell → Dashboard shell: renders (evidence: `web/src/App.tsx`)
- App shell → Channels UI: renders (evidence: `web/src/App.tsx`)
- App shell → Web API client: calls (evidence: `web/src/App.tsx`)
- Sign-in UI → Web API client: calls (evidence: `web/src/api.ts`)
- Channels UI → Web API client: calls (evidence: `web/src/pages/Channels.tsx`)
- Web API client → FastAPI application: sends requests
- FastAPI application → Auth endpoints: registers (evidence: `api/src/app/main.py`)
- FastAPI application → Shopify endpoints: registers (evidence: `api/src/app/main.py`)
- FastAPI application → Health and readiness: registers (evidence: `api/src/app/main.py`)
- Auth endpoints → Auth service: calls (evidence: `api/src/app/workspace/api/auth.py`)
- Auth endpoints → Permissions and dependencies: uses dependencies (evidence: `api/src/app/workspace/api/auth.py`)
- Auth service → Session handling: issues sessions (evidence: `api/src/app/workspace/service/auth.py`)
- Auth service → Audit log: records events (evidence: `api/src/app/workspace/service/auth.py`)
- Auth service → TOTP MFA: checks MFA (evidence: `api/src/app/workspace/service/auth.py`)
- Auth endpoints → Session handling: hashes tokens (evidence: `api/src/app/workspace/api/auth.py`)
- Permissions and dependencies → Auth service: uses (evidence: `api/src/app/workspace/api/deps.py`)
- Permissions and dependencies → Session handling: validates sessions (evidence: `api/src/app/workspace/api/deps.py`)
- Permissions and dependencies → RBAC checks: checks grants (evidence: `api/src/app/workspace/api/deps.py`)
- Shopify endpoints → Connector and sync service: calls (evidence: `api/src/app/ingestion/api/shopify.py`)
- Shopify endpoints → Permissions and dependencies: uses dependencies (evidence: `api/src/app/ingestion/api/shopify.py`)
- Shopify endpoints → Audit log: records events (evidence: `api/src/app/ingestion/api/shopify.py`)
- Connector and sync service → Shopify client: queries store (evidence: `api/src/app/ingestion/service/shopify.py`)
- Shopify client → GraphQL operations: uses operations (evidence: `api/src/app/ingestion/connectors/shopify/client.py`)
- Shopify client → Shopify store: sends GraphQL (evidence: `api/src/app/ingestion/connectors/shopify/client.py`)
- Connector and sync service → PostgreSQL: stores raw records (evidence: `api/src/app/ingestion/service/shopify.py`)
- FastAPI application → PostgreSQL access: creates and closes (evidence: `api/src/app/main.py`)
- FastAPI application → Redis: creates and closes (evidence: `api/src/app/main.py`)
- Health and readiness → PostgreSQL access: checks readiness (evidence: `README.md`)
- Health and readiness → Redis: checks readiness (evidence: `README.md`)
- PostgreSQL access → PostgreSQL: connects (evidence: `api/src/app/platform/database.py`)
- Auth service → Email OTP sender: sends OTP
