# pratik-rahul-bamne/shoet architecture

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

- Interactive diagram: https://gitdiagram.com/pratik-rahul-bamne/shoet
- Repository: https://github.com/pratik-rahul-bamne/shoet

## Overview

ShoeT is a footwear inventory, point-of-sale, purchasing, and demand-forecasting application. Staff and administrators use its React interface to authenticate, manage size-and-colour variants and stock, receive purchases, process sales and returns, and review analytics and reorder recommendations. The frontend calls a FastAPI backend whose endpoint modules own business operations and persist data through SQLAlchemy. The README also advertises device and wearer views, but the supplied tree shows no corresponding backend integration; those are represented as frontend capabilities only. Relationships follow sampled source and the SOURCE INDEX; unsampled behavior is not inferred.

Main entry points: [`backend/app/core/database.py`](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/core/database.py) (SQL database), [`frontend/src/App.tsx`](https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/App.tsx) (Application shell), [`frontend/src/services/api.ts`](https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/services/api.ts) (API client), [`backend/app/api/v1/endpoints/analytics.py`](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/analytics.py) (Demand analytics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Retail interface"]
  node_app["Application shell<br/>[App.tsx]"]
  node_auth_ui["Session context<br/>[AuthContext.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_catalog_ui["Product catalog<br/>[ProductsView.tsx]"]
  node_stock_ui["Stock management<br/>[InventoryView.tsx]"]
  node_purchase_ui["Purchasing<br/>[PurchasesView.tsx]"]
  node_pos_ui["Sales and returns<br/>[SalesPOSView.tsx]"]
  node_analytics_ui["Dashboard and forecasts<br/>[DashboardView.tsx]"]
  node_wearable_ui["Devices and wearers<br/>[DevicesView.tsx]"]
end

subgraph group_identity["Access control"]
  node_auth_api["Authentication endpoints<br/>[auth.py]"]
  node_user_api["User administration<br/>[users.py]"]
  node_security["JWT and passwords<br/>[security.py]"]
  node_dependencies["Request authorization<br/>[deps.py]"]
end

subgraph group_operations["Retail operations"]
  node_product_api["Catalog endpoints<br/>[products.py]"]
  node_inventory_api["Inventory endpoints<br/>[inventory.py]"]
  node_purchase_api["Purchase receiving<br/>[purchases.py]"]
  node_sales_api["Sales and returns<br/>[sales.py]"]
end

subgraph group_intelligence["Analytics"]
  node_analytics_api["Demand analytics<br/>[analytics.py]"]
end

subgraph group_persistence["Backend and data"]
  node_catalog_model["Product variants<br/>[product.py]"]
  node_inventory_model["Stock and movements<br/>[inventory.py]"]
  node_sales_model["Sales and returns<br/>[sale.py]"]
  node_purchase_model["Purchase orders<br/>[purchase.py]"]
  node_user_model["User records<br/>[user.py]"]
  node_database[("SQL database<br/>[database.py]")]
end

node_staff(("Retail staff"))

node_staff -->|"uses"| node_app
node_app -->|"provides session"| node_auth_ui
node_app -->|"renders"| node_catalog_ui
node_app -->|"renders"| node_stock_ui
node_app -->|"renders"| node_purchase_ui
node_app -->|"renders"| node_pos_ui
node_app -->|"renders"| node_analytics_ui
node_app -->|"renders"| node_wearable_ui
node_auth_ui -->|"authenticates through"| node_api_client
node_api_client -->|"calls"| node_auth_api
node_api_client -->|"calls"| node_product_api
node_api_client -->|"calls"| node_inventory_api
node_api_client -->|"calls"| node_purchase_api
node_api_client -->|"calls"| node_sales_api
node_api_client -->|"calls"| node_analytics_api
node_auth_api -->|"verifies credentials"| node_security
node_auth_api -->|"reads and creates"| node_user_model
node_dependencies -->|"loads user"| node_user_model
node_dependencies -->|"validates JWT"| node_security
node_user_api -->|"manages"| node_user_model
node_product_api -->|"reads and writes"| node_catalog_model
node_inventory_api -->|"reads and writes"| node_inventory_model
node_purchase_api -->|"records orders"| node_purchase_model
node_purchase_api -->|"receives stock"| node_inventory_model
node_sales_api -->|"records sales"| node_sales_model
node_sales_api -->|"updates stock"| node_inventory_model
node_analytics_api -->|"reads stock"| node_inventory_model
node_analytics_api -->|"reads variants"| node_catalog_model
node_analytics_api -->|"analyzes sales"| node_sales_model
node_auth_api -->|"uses session"| node_database
node_product_api -->|"uses session"| node_database
node_inventory_api -->|"uses session"| node_database
node_purchase_api -->|"uses session"| node_database
node_sales_api -->|"uses session"| node_database
node_analytics_api -->|"uses session"| node_database
node_user_api -->|"uses session"| node_database
node_database -->|"maps models"| node_catalog_model
node_database -->|"maps models"| node_inventory_model
node_database -->|"maps models"| node_sales_model
node_database -->|"maps models"| node_purchase_model
node_database -->|"maps models"| node_user_model

click node_app "https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/App.tsx"
click node_auth_ui "https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/context/AuthContext.tsx"
click node_api_client "https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/services/api.ts"
click node_catalog_ui "https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/views/ProductsView.tsx"
click node_stock_ui "https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/views/InventoryView.tsx"
click node_purchase_ui "https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/views/PurchasesView.tsx"
click node_pos_ui "https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/views/SalesPOSView.tsx"
click node_analytics_ui "https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/views/DashboardView.tsx"
click node_wearable_ui "https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/views/DevicesView.tsx"
click node_auth_api "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/auth.py"
click node_user_api "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/users.py"
click node_product_api "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/products.py"
click node_inventory_api "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/inventory.py"
click node_purchase_api "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/purchases.py"
click node_sales_api "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/sales.py"
click node_analytics_api "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/analytics.py"
click node_security "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/core/security.py"
click node_dependencies "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/deps.py"
click node_catalog_model "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/models/product.py"
click node_inventory_model "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/models/inventory.py"
click node_sales_model "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/models/sale.py"
click node_purchase_model "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/models/purchase.py"
click node_user_model "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/models/user.py"
click node_database "https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/core/database.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_auth_ui,node_api_client,node_catalog_ui,node_stock_ui,node_purchase_ui,node_pos_ui,node_analytics_ui,node_wearable_ui toneBlue
class node_auth_api,node_user_api,node_security,node_dependencies toneAmber
class node_product_api,node_inventory_api,node_purchase_api,node_sales_api toneMint
class node_analytics_api toneRose
class node_catalog_model,node_inventory_model,node_sales_model,node_purchase_model,node_user_model,node_database,node_staff toneIndigo
```

## Components

### Retail interface

- [Application shell](https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Session context](https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [API client](https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Product catalog](https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/views/ProductsView.tsx): `frontend/src/views/ProductsView.tsx`
- [Stock management](https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/views/InventoryView.tsx): `frontend/src/views/InventoryView.tsx`
- [Purchasing](https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/views/PurchasesView.tsx): `frontend/src/views/PurchasesView.tsx`
- [Sales and returns](https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/views/SalesPOSView.tsx): `frontend/src/views/SalesPOSView.tsx`
- [Dashboard and forecasts](https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/views/DashboardView.tsx): `frontend/src/views/DashboardView.tsx`
- [Devices and wearers](https://github.com/pratik-rahul-bamne/shoet/blob/main/frontend/src/views/DevicesView.tsx): `frontend/src/views/DevicesView.tsx`

### Access control

- [Authentication endpoints](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/auth.py): `backend/app/api/v1/endpoints/auth.py`
- [User administration](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/users.py): `backend/app/api/v1/endpoints/users.py`
- [JWT and passwords](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/core/security.py): `backend/app/core/security.py`
- [Request authorization](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/deps.py): `backend/app/api/deps.py`

### Retail operations

- [Catalog endpoints](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/products.py): `backend/app/api/v1/endpoints/products.py`
- [Inventory endpoints](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/inventory.py): `backend/app/api/v1/endpoints/inventory.py`
- [Purchase receiving](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/purchases.py): `backend/app/api/v1/endpoints/purchases.py`
- [Sales and returns](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/sales.py): `backend/app/api/v1/endpoints/sales.py`

### Analytics

- [Demand analytics](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/api/v1/endpoints/analytics.py): `backend/app/api/v1/endpoints/analytics.py`

### Backend and data

- [Product variants](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/models/product.py): `backend/app/models/product.py`
- [Stock and movements](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/models/inventory.py): `backend/app/models/inventory.py`
- [Sales and returns](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/models/sale.py): `backend/app/models/sale.py`
- [Purchase orders](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/models/purchase.py): `backend/app/models/purchase.py`
- [User records](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/models/user.py): `backend/app/models/user.py`
- [SQL database](https://github.com/pratik-rahul-bamne/shoet/blob/main/backend/app/core/database.py): `backend/app/core/database.py`

### Other components

- **Retail staff**

## Connections

- Retail staff → Application shell: uses (evidence: `frontend/src/App.tsx`)
- Application shell → Session context: provides session (evidence: `frontend/src/App.tsx`)
- Application shell → Product catalog: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Stock management: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Purchasing: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Sales and returns: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Dashboard and forecasts: renders (evidence: `frontend/src/App.tsx`)
- Application shell → Devices and wearers: renders (evidence: `frontend/src/App.tsx`)
- Session context → API client: authenticates through (evidence: `frontend/src/context/AuthContext.tsx`)
- API client → Authentication endpoints: calls (evidence: `frontend/src/services/api.ts`)
- API client → Catalog endpoints: calls (evidence: `frontend/src/services/api.ts`)
- API client → Inventory endpoints: calls (evidence: `frontend/src/services/api.ts`)
- API client → Purchase receiving: calls (evidence: `frontend/src/services/api.ts`)
- API client → Sales and returns: calls (evidence: `frontend/src/services/api.ts`)
- API client → Demand analytics: calls (evidence: `frontend/src/services/api.ts`)
- Authentication endpoints → JWT and passwords: verifies credentials (evidence: `backend/app/api/v1/endpoints/auth.py`)
- Authentication endpoints → User records: reads and creates (evidence: `backend/app/api/v1/endpoints/auth.py`)
- Request authorization → User records: loads user (evidence: `backend/app/api/deps.py`)
- Request authorization → JWT and passwords: validates JWT (evidence: `backend/app/api/deps.py`)
- User administration → User records: manages (evidence: `backend/app/api/v1/endpoints/users.py`)
- Catalog endpoints → Product variants: reads and writes (evidence: `backend/app/api/v1/endpoints/products.py`)
- Inventory endpoints → Stock and movements: reads and writes (evidence: `backend/app/api/v1/endpoints/inventory.py`)
- Purchase receiving → Purchase orders: records orders (evidence: `backend/app/api/v1/endpoints/purchases.py`)
- Purchase receiving → Stock and movements: receives stock (evidence: `backend/app/api/v1/endpoints/purchases.py`)
- Sales and returns → Sales and returns: records sales (evidence: `backend/app/api/v1/endpoints/sales.py`)
- Sales and returns → Stock and movements: updates stock (evidence: `backend/app/api/v1/endpoints/sales.py`)
- Demand analytics → Stock and movements: reads stock (evidence: `backend/app/api/v1/endpoints/analytics.py`)
- Demand analytics → Product variants: reads variants (evidence: `backend/app/api/v1/endpoints/analytics.py`)
- Demand analytics → Sales and returns: analyzes sales (evidence: `backend/app/api/v1/endpoints/analytics.py`)
- Authentication endpoints → SQL database: uses session (evidence: `backend/app/api/v1/endpoints/auth.py`)
- Catalog endpoints → SQL database: uses session (evidence: `backend/app/api/v1/endpoints/products.py`)
- Inventory endpoints → SQL database: uses session (evidence: `backend/app/api/v1/endpoints/inventory.py`)
- Purchase receiving → SQL database: uses session (evidence: `backend/app/api/v1/endpoints/purchases.py`)
- Sales and returns → SQL database: uses session (evidence: `backend/app/api/v1/endpoints/sales.py`)
- Demand analytics → SQL database: uses session (evidence: `backend/app/api/v1/endpoints/analytics.py`)
- User administration → SQL database: uses session (evidence: `backend/app/api/v1/endpoints/users.py`)
- SQL database → Product variants: maps models (evidence: `backend/app/models/product.py`)
- SQL database → Stock and movements: maps models (evidence: `backend/app/models/inventory.py`)
- SQL database → Sales and returns: maps models (evidence: `backend/app/models/sale.py`)
- SQL database → Purchase orders: maps models (evidence: `backend/app/models/purchase.py`)
- SQL database → User records: maps models (evidence: `backend/app/models/user.py`)
