# brandonedy05/ai-dev-kodigo architecture

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

- Interactive diagram: https://gitdiagram.com/brandonedy05/ai-dev-kodigo
- Repository: https://github.com/brandonedy05/ai-dev-kodigo

## Overview

Mi Tiendita Fácil is a desktop point-of-sale system: staff sign in, use role-filtered screens to manage cash, customers and products, and record sales; managers also administer users and review reports. The Flet frontend calls a FastAPI REST backend, whose services implement business operations over SQLModel data stored in SQLite or PostgreSQL. The graph combines documented product capabilities with sampled wiring; some individual router and service implementations were not excerpted, so their detailed internal calls are not asserted.

Main entry points: [`frontend/app/services/api_client.py`](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/services/api_client.py) (HTTP API client), [`backend/app/core/database.py`](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/core/database.py) (Database setup and sessions), [`frontend/app/main.py`](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/main.py) (POS application), [`backend/app/models/sale.py`](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/models/sale.py) (POS data models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Desktop frontend"]
  node_app["POS application<br/>[main.py]"]
  node_login["Login screen<br/>[login_view.py]"]
  node_terminal["Sales terminal"]
  node_cashview["Cash screen"]
  node_secondary["Products, customers, reports<br/>[secondary_views.py]"]
  node_usersview["User administration<br/>[users_view.py]"]
  node_client["HTTP API client<br/>[api_client.py]"]
end

subgraph group_api["API and security"]
  node_authapi["Authentication routes<br/>[auth.py]"]
  node_cashapi["Cash routes<br/>[cash_register.py]"]
  node_productapi["Product routes<br/>[products.py]"]
  node_reportapi["Report routes<br/>[reports.py]"]
  node_salesapi["Sales routes<br/>[sales.py]"]
  node_customerapi["Customer routes<br/>[customers.py]"]
  node_usersapi["User routes<br/>[users.py]"]
  node_security["Password and token security<br/>[security.py]"]
end

subgraph group_operations["Store operations"]
  node_cashsvc["Cash operations"]
  node_products["Product catalog<br/>[product_service.py]"]
  node_customers["Customer management"]
  node_sales["Sale processing<br/>[sale_service.py]"]
  node_reports["Sales and stock reports<br/>[report_service.py]"]
  node_userops["User administration<br/>[user_service.py]"]
end

subgraph group_data["Persistence and models"]
  node_database["Database setup and sessions<br/>[database.py]"]
  node_models["POS data models<br/>[sale.py]"]
  node_store[("SQLite or PostgreSQL")]
end

node_staff(("Cashier or manager"))

node_staff -->|"uses"| node_app
node_app -->|"shows"| node_login
node_app -->|"creates"| node_terminal
node_app -->|"creates"| node_cashview
node_app -->|"creates"| node_secondary
node_app -->|"creates"| node_usersview
node_login -->|"calls"| node_client
node_terminal -->|"calls"| node_client
node_cashview -->|"calls"| node_client
node_secondary -->|"calls"| node_client
node_usersview -->|"calls"| node_client
node_client -->|"HTTP requests"| node_authapi
node_client -->|"HTTP requests"| node_cashapi
node_client -->|"HTTP requests"| node_productapi
node_client -->|"HTTP requests"| node_reportapi
node_client -->|"HTTP requests"| node_salesapi
node_client -->|"HTTP requests"| node_customerapi
node_client -->|"HTTP requests"| node_usersapi
node_authapi -->|"delegates"| node_userops
node_authapi -->|"validates session"| node_security
node_cashapi -->|"delegates"| node_cashsvc
node_productapi -->|"delegates"| node_products
node_reportapi -->|"delegates"| node_reports
node_salesapi -->|"delegates"| node_sales
node_customerapi -->|"delegates"| node_customers
node_usersapi -->|"delegates"| node_userops
node_cashsvc -->|"uses models"| node_models
node_products -->|"uses models"| node_models
node_customers -->|"uses models"| node_models
node_sales -->|"uses models"| node_models
node_reports -->|"queries models"| node_models
node_userops -->|"uses models"| node_models
node_database -->|"seeds users"| node_userops
node_database -->|"connects"| node_store
node_cashsvc -.->|"uses sessions"| node_database
node_products -.->|"uses sessions"| node_database
node_customers -.->|"uses sessions"| node_database
node_sales -.->|"uses sessions"| node_database
node_reports -.->|"uses sessions"| node_database
node_userops -.->|"uses sessions"| node_database

click node_app "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/main.py"
click node_login "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/views/login_view.py"
click node_terminal "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/views/pos_terminal_view.py"
click node_cashview "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/views/cash_register_view.py"
click node_secondary "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/views/secondary_views.py"
click node_usersview "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/views/users_view.py"
click node_client "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/services/api_client.py"
click node_authapi "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/routers/auth.py"
click node_cashapi "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/routers/cash_register.py"
click node_productapi "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/routers/products.py"
click node_reportapi "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/routers/reports.py"
click node_salesapi "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/routers/sales.py"
click node_customerapi "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/routers/customers.py"
click node_usersapi "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/routers/users.py"
click node_security "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/core/security.py"
click node_cashsvc "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/services/cash_register_service.py"
click node_products "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/services/product_service.py"
click node_customers "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/services/customer_service.py"
click node_sales "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/services/sale_service.py"
click node_reports "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/services/report_service.py"
click node_userops "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/services/user_service.py"
click node_database "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/core/database.py"
click node_models "https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/models/sale.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_login,node_terminal,node_cashview,node_secondary,node_usersview,node_client toneBlue
class node_authapi,node_cashapi,node_productapi,node_reportapi,node_salesapi,node_customerapi,node_usersapi,node_security toneAmber
class node_cashsvc,node_products,node_customers,node_sales,node_reports,node_userops toneMint
class node_database,node_models,node_store toneRose
class node_staff toneIndigo
```

## Components

### Desktop frontend

- [POS application](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/main.py): `frontend/app/main.py`
- [Login screen](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/views/login_view.py): `frontend/app/views/login_view.py`
- [Sales terminal](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/views/pos_terminal_view.py): `frontend/app/views/pos_terminal_view.py`
- [Cash screen](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/views/cash_register_view.py): `frontend/app/views/cash_register_view.py`
- [Products, customers, reports](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/views/secondary_views.py): `frontend/app/views/secondary_views.py`
- [User administration](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/views/users_view.py): `frontend/app/views/users_view.py`
- [HTTP API client](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/frontend/app/services/api_client.py): `frontend/app/services/api_client.py`

### API and security

- [Authentication routes](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Cash routes](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/routers/cash_register.py): `backend/app/routers/cash_register.py`
- [Product routes](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/routers/products.py): `backend/app/routers/products.py`
- [Report routes](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/routers/reports.py): `backend/app/routers/reports.py`
- [Sales routes](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/routers/sales.py): `backend/app/routers/sales.py`
- [Customer routes](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/routers/customers.py): `backend/app/routers/customers.py`
- [User routes](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/routers/users.py): `backend/app/routers/users.py`
- [Password and token security](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/core/security.py): `backend/app/core/security.py`

### Store operations

- [Cash operations](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/services/cash_register_service.py): `backend/app/services/cash_register_service.py`
- [Product catalog](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/services/product_service.py): `backend/app/services/product_service.py`
- [Customer management](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/services/customer_service.py): `backend/app/services/customer_service.py`
- [Sale processing](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/services/sale_service.py): `backend/app/services/sale_service.py`
- [Sales and stock reports](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/services/report_service.py): `backend/app/services/report_service.py`
- [User administration](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/services/user_service.py): `backend/app/services/user_service.py`

### Persistence and models

- [Database setup and sessions](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/core/database.py): `backend/app/core/database.py`
- [POS data models](https://github.com/brandonedy05/ai-dev-kodigo/blob/main/backend/app/models/sale.py): `backend/app/models/sale.py`
- **SQLite or PostgreSQL**

### Other components

- **Cashier or manager**

## Connections

- Cashier or manager → POS application: uses (evidence: `README.md`)
- POS application → Login screen: shows (evidence: `frontend/app/main.py`)
- POS application → Sales terminal: creates (evidence: `frontend/app/main.py`)
- POS application → Cash screen: creates (evidence: `frontend/app/main.py`)
- POS application → Products, customers, reports: creates (evidence: `frontend/app/main.py`)
- POS application → User administration: creates (evidence: `frontend/app/main.py`)
- Login screen → HTTP API client: calls (evidence: `frontend/app/views/login_view.py`)
- Sales terminal → HTTP API client: calls (evidence: `frontend/app/views/pos_terminal_view.py`)
- Cash screen → HTTP API client: calls (evidence: `frontend/app/views/cash_register_view.py`)
- Products, customers, reports → HTTP API client: calls (evidence: `frontend/app/views/secondary_views.py`)
- User administration → HTTP API client: calls (evidence: `frontend/app/views/users_view.py`)
- HTTP API client → Authentication routes: HTTP requests (evidence: `README.md`)
- HTTP API client → Cash routes: HTTP requests (evidence: `README.md`)
- HTTP API client → Product routes: HTTP requests (evidence: `README.md`)
- HTTP API client → Report routes: HTTP requests (evidence: `README.md`)
- HTTP API client → Sales routes: HTTP requests (evidence: `README.md`)
- HTTP API client → Customer routes: HTTP requests (evidence: `README.md`)
- HTTP API client → User routes: HTTP requests (evidence: `README.md`)
- Authentication routes → User administration: delegates (evidence: `backend/app/routers/auth.py`)
- Authentication routes → Password and token security: validates session (evidence: `backend/app/routers/auth.py`)
- Cash routes → Cash operations: delegates (evidence: `backend/app/routers/cash_register.py`)
- Product routes → Product catalog: delegates (evidence: `backend/app/routers/products.py`)
- Report routes → Sales and stock reports: delegates (evidence: `backend/app/routers/reports.py`)
- Sales routes → Sale processing: delegates
- Customer routes → Customer management: delegates
- User routes → User administration: delegates
- Cash operations → POS data models: uses models (evidence: `backend/app/services/cash_register_service.py`)
- Product catalog → POS data models: uses models (evidence: `backend/app/services/product_service.py`)
- Customer management → POS data models: uses models (evidence: `backend/app/services/customer_service.py`)
- Sale processing → POS data models: uses models (evidence: `backend/app/services/sale_service.py`)
- Sales and stock reports → POS data models: queries models (evidence: `backend/app/services/report_service.py`)
- User administration → POS data models: uses models (evidence: `backend/app/services/user_service.py`)
- Database setup and sessions → User administration: seeds users (evidence: `backend/app/core/database.py`)
- Database setup and sessions → SQLite or PostgreSQL: connects (evidence: `backend/app/core/database.py`)
- Cash operations → Database setup and sessions: uses sessions
- Product catalog → Database setup and sessions: uses sessions
- Customer management → Database setup and sessions: uses sessions
- Sale processing → Database setup and sessions: uses sessions
- Sales and stock reports → Database setup and sessions: uses sessions
- User administration → Database setup and sessions: uses sessions (evidence: `backend/app/core/database.py`)
