# frycodelab/nicegui-component-based architecture

> Architecture diagram of the GitHub repository frycodelab/nicegui-component-based, 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/frycodelab/nicegui-component-based
- Repository: https://github.com/frycodelab/nicegui-component-based

## Overview

NiceStack is a Python/NiceGUI web-app starter with a session-authenticated user journey: a visitor reaches the app, signs in, completes any required password change, and then navigates pages in the shared shell. Its broader capabilities include account administration, auditing, localization, operational demo pages, reusable UI, printing, PWA support, and logging. The graph combines sampled calls and imports with explicitly documented routing and layer responsibilities; unsampled subsystems are represented only where the README or source index supports them.

Main entry points: [`app/main.py`](https://github.com/frycodelab/nicegui-component-based/blob/main/app/main.py) (App routing), [`app/services/user_service.py`](https://github.com/frycodelab/nicegui-component-based/blob/main/app/services/user_service.py) (User rules), [`app/components/notifications.py`](https://github.com/frycodelab/nicegui-component-based/blob/main/app/components/notifications.py) (Notifications), [`app/views/users_content.py`](https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/users_content.py) (User administration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_main["App routing<br/>[main.py]"]
  node_shell["App shell<br/>[header.py]"]
  node_db[("SQLite persistence<br/>[database.py]")]
  node_logging["Logging<br/>[logging_config.py]"]
end

subgraph group_identity["Identity and governance"]
  node_security["Auth and access<br/>[security.py]"]
  node_login["Login page<br/>[login_content.py]"]
  node_password["Password change"]
  node_users["User administration<br/>[users_content.py]"]
  node_user_service["User rules<br/>[user_service.py]"]
  node_user_model["User model<br/>[user.py]"]
  node_roles["Role enum<br/>[enums.py]"]
  node_audit_page["Audit review<br/>[audit_content.py]"]
  node_audit_service["Audit trail service<br/>[audit_service.py]"]
  node_audit_model["Audit model<br/>[audit.py]"]
end

subgraph group_product["Pages and demos"]
  node_dashboard["Dashboard"]
  node_operations["Operations demos<br/>[orders_content.py]"]
  node_production["Production demo"]
  node_shipping["Shipping demo"]
  node_packing["Packing demo"]
  node_pallets["Pallet demo<br/>[pallets_content.py]"]
  node_design["Design system"]
  node_icons["Icon browser<br/>[icons_content.py]"]
  node_print_demo["Print demo page"]
end

subgraph group_shared["Shared capabilities"]
  node_print["Print renderer<br/>[print_component.py]"]
  node_notifications["Notifications<br/>[notifications.py]"]
  node_dialogs["Dialog components<br/>[dialogs.py]"]
  node_i18n["Live localization<br/>[i18n.py]"]
  node_pwa["PWA assets<br/>[sw.js]"]
end

node_visitor(("Visitor"))
node_external_browser(("Browser"))

node_visitor -->|"opens app"| node_main
node_main -->|"installs middleware"| node_security
node_main -->|"applies layout"| node_shell
node_main -->|"routes to"| node_login
node_main -->|"routes to"| node_dashboard
node_main -->|"routes to"| node_operations
node_main -->|"routes to"| node_production
node_main -->|"routes to"| node_shipping
node_main -->|"routes to"| node_packing
node_main -->|"routes to"| node_pallets
node_main -->|"routes to"| node_design
node_main -->|"routes to"| node_icons
node_main -->|"routes to"| node_audit_page
node_main -->|"routes to"| node_users
node_login -->|"authenticates with"| node_security
node_login -->|"checks account"| node_user_service
node_security -->|"loads current user"| node_user_service
node_user_service -->|"reads and writes"| node_db
node_user_service -->|"returns user data"| node_user_model
node_user_service -->|"uses roles"| node_roles
node_password -->|"updates password"| node_user_service
node_users -->|"manages accounts"| node_user_service
node_users -->|"uses dialogs"| node_dialogs
node_users -->|"records actions"| node_audit_service
node_audit_page -->|"queries trail"| node_audit_service
node_audit_service -->|"persists entries"| node_db
node_audit_service -->|"maps entries"| node_audit_model
node_dashboard -->|"translates labels"| node_i18n
node_dashboard -->|"shows notices"| node_notifications
node_operations -->|"shows notices"| node_notifications
node_production -->|"shows notices"| node_notifications
node_shipping -->|"shows notices"| node_notifications
node_packing -->|"shows notices"| node_notifications
node_pallets -->|"shows notices"| node_notifications
node_design -->|"demonstrates toasts"| node_notifications
node_design -->|"demonstrates dialogs"| node_dialogs
node_design -->|"translates labels"| node_i18n
node_icons -->|"translates labels"| node_i18n
node_print_demo -->|"renders print demo"| node_print
node_main -->|"serves print route"| node_print
node_main -->|"serves worker"| node_pwa
node_main -->|"configures logging"| node_logging
node_print -->|"opens print tab"| node_external_browser

click node_main "https://github.com/frycodelab/nicegui-component-based/blob/main/app/main.py"
click node_shell "https://github.com/frycodelab/nicegui-component-based/blob/main/app/header.py"
click node_db "https://github.com/frycodelab/nicegui-component-based/blob/main/app/core/database.py"
click node_logging "https://github.com/frycodelab/nicegui-component-based/blob/main/app/core/logging_config.py"
click node_security "https://github.com/frycodelab/nicegui-component-based/blob/main/app/core/security.py"
click node_login "https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/login_content.py"
click node_password "https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/change_password_content.py"
click node_users "https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/users_content.py"
click node_user_service "https://github.com/frycodelab/nicegui-component-based/blob/main/app/services/user_service.py"
click node_user_model "https://github.com/frycodelab/nicegui-component-based/blob/main/app/models/user.py"
click node_roles "https://github.com/frycodelab/nicegui-component-based/blob/main/app/models/enums.py"
click node_audit_page "https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/audit_content.py"
click node_audit_service "https://github.com/frycodelab/nicegui-component-based/blob/main/app/services/audit_service.py"
click node_audit_model "https://github.com/frycodelab/nicegui-component-based/blob/main/app/models/audit.py"
click node_dashboard "https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/dashboard_content.py"
click node_operations "https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/orders_content.py"
click node_production "https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/production_content.py"
click node_shipping "https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/shipping_content.py"
click node_packing "https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/packings_content.py"
click node_pallets "https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/pallets_content.py"
click node_design "https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/design_system_content.py"
click node_icons "https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/icons_content.py"
click node_print "https://github.com/frycodelab/nicegui-component-based/blob/main/app/components/print_component.py"
click node_print_demo "https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/print_demo_content.py"
click node_notifications "https://github.com/frycodelab/nicegui-component-based/blob/main/app/components/notifications.py"
click node_dialogs "https://github.com/frycodelab/nicegui-component-based/blob/main/app/components/dialogs.py"
click node_i18n "https://github.com/frycodelab/nicegui-component-based/blob/main/app/services/i18n.py"
click node_pwa "https://github.com/frycodelab/nicegui-component-based/blob/main/app/assets/pwa/sw.js"

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_main,node_shell,node_db,node_logging,node_external_browser toneBlue
class node_security,node_login,node_password,node_users,node_user_service,node_user_model,node_roles,node_audit_page,node_audit_service,node_audit_model toneAmber
class node_dashboard,node_operations,node_production,node_shipping,node_packing,node_pallets,node_design,node_icons,node_print_demo toneMint
class node_print,node_notifications,node_dialogs,node_i18n,node_pwa toneRose
class node_visitor toneIndigo
```

## Components

### Application runtime

- [App routing](https://github.com/frycodelab/nicegui-component-based/blob/main/app/main.py): `app/main.py`
- [App shell](https://github.com/frycodelab/nicegui-component-based/blob/main/app/header.py): `app/header.py`
- [SQLite persistence](https://github.com/frycodelab/nicegui-component-based/blob/main/app/core/database.py): `app/core/database.py`
- [Logging](https://github.com/frycodelab/nicegui-component-based/blob/main/app/core/logging_config.py): `app/core/logging_config.py`

### Identity and governance

- [Auth and access](https://github.com/frycodelab/nicegui-component-based/blob/main/app/core/security.py): `app/core/security.py`
- [Login page](https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/login_content.py): `app/views/login_content.py`
- [Password change](https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/change_password_content.py): `app/views/change_password_content.py`
- [User administration](https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/users_content.py): `app/views/users_content.py`
- [User rules](https://github.com/frycodelab/nicegui-component-based/blob/main/app/services/user_service.py): `app/services/user_service.py`
- [User model](https://github.com/frycodelab/nicegui-component-based/blob/main/app/models/user.py): `app/models/user.py`
- [Role enum](https://github.com/frycodelab/nicegui-component-based/blob/main/app/models/enums.py): `app/models/enums.py`
- [Audit review](https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/audit_content.py): `app/views/audit_content.py`
- [Audit trail service](https://github.com/frycodelab/nicegui-component-based/blob/main/app/services/audit_service.py): `app/services/audit_service.py`
- [Audit model](https://github.com/frycodelab/nicegui-component-based/blob/main/app/models/audit.py): `app/models/audit.py`

### Pages and demos

- [Dashboard](https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/dashboard_content.py): `app/views/dashboard_content.py`
- [Operations demos](https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/orders_content.py): `app/views/orders_content.py`
- [Production demo](https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/production_content.py): `app/views/production_content.py`
- [Shipping demo](https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/shipping_content.py): `app/views/shipping_content.py`
- [Packing demo](https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/packings_content.py): `app/views/packings_content.py`
- [Pallet demo](https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/pallets_content.py): `app/views/pallets_content.py`
- [Design system](https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/design_system_content.py): `app/views/design_system_content.py`
- [Icon browser](https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/icons_content.py): `app/views/icons_content.py`
- [Print demo page](https://github.com/frycodelab/nicegui-component-based/blob/main/app/views/print_demo_content.py): `app/views/print_demo_content.py`

### Shared capabilities

- [Print renderer](https://github.com/frycodelab/nicegui-component-based/blob/main/app/components/print_component.py): `app/components/print_component.py`
- [Notifications](https://github.com/frycodelab/nicegui-component-based/blob/main/app/components/notifications.py): `app/components/notifications.py`
- [Dialog components](https://github.com/frycodelab/nicegui-component-based/blob/main/app/components/dialogs.py): `app/components/dialogs.py`
- [Live localization](https://github.com/frycodelab/nicegui-component-based/blob/main/app/services/i18n.py): `app/services/i18n.py`
- [PWA assets](https://github.com/frycodelab/nicegui-component-based/blob/main/app/assets/pwa/sw.js): `app/assets/pwa/sw.js`

### Other components

- **Visitor**
- **Browser**

## Connections

- Visitor → App routing: opens app (evidence: `README.md`)
- App routing → Auth and access: installs middleware (evidence: `app/main.py`)
- App routing → App shell: applies layout (evidence: `README.md`)
- App routing → Login page: routes to (evidence: `README.md`)
- App routing → Dashboard: routes to (evidence: `app/main.py`)
- App routing → Operations demos: routes to (evidence: `app/main.py`)
- App routing → Production demo: routes to (evidence: `app/main.py`)
- App routing → Shipping demo: routes to (evidence: `app/main.py`)
- App routing → Packing demo: routes to (evidence: `app/main.py`)
- App routing → Pallet demo: routes to (evidence: `app/main.py`)
- App routing → Design system: routes to (evidence: `app/main.py`)
- App routing → Icon browser: routes to (evidence: `app/main.py`)
- App routing → Audit review: routes to (evidence: `app/main.py`)
- App routing → User administration: routes to (evidence: `app/main.py`)
- Login page → Auth and access: authenticates with (evidence: `app/views/login_content.py`)
- Login page → User rules: checks account (evidence: `app/views/login_content.py`)
- Auth and access → User rules: loads current user (evidence: `app/core/security.py`)
- User rules → SQLite persistence: reads and writes (evidence: `app/services/user_service.py`)
- User rules → User model: returns user data (evidence: `app/services/user_service.py`)
- User rules → Role enum: uses roles (evidence: `app/services/user_service.py`)
- Password change → User rules: updates password
- User administration → User rules: manages accounts (evidence: `app/views/users_content.py`)
- User administration → Dialog components: uses dialogs (evidence: `app/views/users_content.py`)
- User administration → Audit trail service: records actions (evidence: `app/views/users_content.py`)
- Audit review → Audit trail service: queries trail (evidence: `app/views/audit_content.py`)
- Audit trail service → SQLite persistence: persists entries (evidence: `app/services/audit_service.py`)
- Audit trail service → Audit model: maps entries (evidence: `app/services/audit_service.py`)
- Dashboard → Live localization: translates labels (evidence: `app/views/dashboard_content.py`)
- Dashboard → Notifications: shows notices (evidence: `app/views/dashboard_content.py`)
- Operations demos → Notifications: shows notices (evidence: `app/views/orders_content.py`)
- Production demo → Notifications: shows notices (evidence: `app/views/production_content.py`)
- Shipping demo → Notifications: shows notices (evidence: `app/views/shipping_content.py`)
- Packing demo → Notifications: shows notices (evidence: `app/views/packings_content.py`)
- Pallet demo → Notifications: shows notices (evidence: `app/views/pallets_content.py`)
- Design system → Notifications: demonstrates toasts (evidence: `app/views/design_system_content.py`)
- Design system → Dialog components: demonstrates dialogs (evidence: `app/views/design_system_content.py`)
- Design system → Live localization: translates labels (evidence: `app/views/design_system_content.py`)
- Icon browser → Live localization: translates labels (evidence: `app/views/icons_content.py`)
- Print demo page → Print renderer: renders print demo (evidence: `app/views/print_demo_content.py`)
- App routing → Print renderer: serves print route (evidence: `README.md`)
- App routing → PWA assets: serves worker (evidence: `app/main.py`)
- App routing → Logging: configures logging (evidence: `README.md`)
- Print renderer → Browser: opens print tab (evidence: `app/components/print_component.py`)
