# kukaracka/digitalpassportclient architecture

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

- Interactive diagram: https://gitdiagram.com/kukaracka/digitalpassportclient
- Repository: https://github.com/kukaracka/digitalpassportclient

## Overview

DigitalPassport is a React client for an electronic service book. Users register or sign in, manage their profile and preferences, and maintain a product inventory with details, images, and shareable product pages/QR codes. The main entry renders either the authenticated app or a token-based shared-product view; within inventory, the list owns create/edit/detail interactions while a product hook mediates API operations. The map reflects the shown imports and calls; product screens and services not excerpted are included where the source index identifies their responsibilities, but uncertain links are omitted.

Main entry points: [`src/App.jsx`](https://github.com/kukaracka/digitalpassportclient/blob/main/src/App.jsx) (App shell), [`src/components/ProductDetail.jsx`](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/ProductDetail.jsx) (Product detail), [`src/main.jsx`](https://github.com/kukaracka/digitalpassportclient/blob/main/src/main.jsx) (React entry), [`src/hooks/useProducts.js`](https://github.com/kukaracka/digitalpassportclient/blob/main/src/hooks/useProducts.js) (Product state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_main["React entry<br/>[main.jsx]"]
  node_app_shell["App shell<br/>[App.jsx]"]
  node_routes["View state<br/>[RouteContext.jsx]"]
  node_spinner["Loading indicator<br/>[LoadingSpinner.jsx]"]
end

subgraph group_account["Account and preferences"]
  node_login["Login<br/>[Login.jsx]"]
  node_register["Registration<br/>[Register.jsx]"]
  node_auth_hook["Auth state<br/>[useAuth.js]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_profile["Profile<br/>[Profile.jsx]"]
  node_edit_profile["Profile editor<br/>[EditProfile.jsx]"]
  node_avatar["Avatar upload<br/>[AvatarUploader.jsx]"]
  node_settings["Settings<br/>[Settings.jsx]"]
  node_theme_hook["Theme state<br/>[useTheme.js]"]
end

subgraph group_inventory["Product inventory"]
  node_products_page["Products page<br/>[Products.jsx]"]
  node_products_list["Products list<br/>[ProductsList.jsx]"]
  node_product_card["Product card<br/>[ProductCard.jsx]"]
  node_product_form["Product form<br/>[ProductForm.jsx]"]
  node_product_detail["Product detail<br/>[ProductDetail.jsx]"]
  node_product_hook["Product state<br/>[useProducts.js]"]
  node_draft_hook["Form drafts<br/>[useFormDraft.js]"]
  node_gallery["Image gallery"]
end

subgraph group_sharing["Product sharing"]
  node_shared_page["Shared product page"]
  node_qr["QR generator"]
end

subgraph group_services["Client services"]
  node_auth_api["Account API<br/>[authAPI.js]"]
  node_theme_manager["Theme persistence<br/>[themeManager.js]"]
  node_product_api["Product API<br/>[productAPI.js]"]
  node_image_api["Image API<br/>[productImageAPI.js]"]
end

node_visitor(("Visitor"))
node_backend[("API server")]

node_visitor -->|"opens"| node_main
node_main -->|"renders"| node_app_shell
node_main -->|"routes to"| node_shared_page
node_main -->|"provides"| node_routes
node_main -->|"initializes"| node_theme_manager
node_app_shell -->|"reads view"| node_routes
node_app_shell -->|"uses auth"| node_auth_hook
node_app_shell -->|"renders"| node_spinner
node_app_shell -->|"renders"| node_login
node_app_shell -->|"renders"| node_register
node_app_shell -->|"renders"| node_dashboard
node_app_shell -->|"renders"| node_products_page
node_app_shell -->|"renders"| node_profile
node_app_shell -->|"renders"| node_settings
node_auth_hook -->|"calls"| node_auth_api
node_auth_api -->|"HTTP requests"| node_backend
node_dashboard -.->|"navigates"| node_profile
node_profile -->|"renders"| node_edit_profile
node_dashboard -.->|"uses"| node_avatar
node_settings -->|"uses"| node_theme_hook
node_theme_hook -->|"reads and saves"| node_theme_manager
node_products_page -->|"renders"| node_products_list
node_products_page -->|"uses"| node_product_hook
node_products_list -->|"renders"| node_product_card
node_products_list -->|"renders"| node_product_form
node_products_list -->|"renders"| node_product_detail
node_product_detail -->|"calls"| node_product_hook
node_product_detail -->|"renders"| node_product_form
node_product_detail -->|"renders"| node_gallery
node_product_detail -->|"renders"| node_spinner
node_product_detail -->|"renders"| node_qr
node_product_form -->|"uses"| node_draft_hook
node_product_hook -->|"calls"| node_product_api
node_product_hook -->|"calls"| node_image_api
node_shared_page -->|"uses"| node_product_hook

click node_main "https://github.com/kukaracka/digitalpassportclient/blob/main/src/main.jsx"
click node_app_shell "https://github.com/kukaracka/digitalpassportclient/blob/main/src/App.jsx"
click node_routes "https://github.com/kukaracka/digitalpassportclient/blob/main/src/contexts/RouteContext.jsx"
click node_spinner "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/LoadingSpinner.jsx"
click node_login "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/Login.jsx"
click node_register "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/Register.jsx"
click node_auth_hook "https://github.com/kukaracka/digitalpassportclient/blob/main/src/hooks/useAuth.js"
click node_auth_api "https://github.com/kukaracka/digitalpassportclient/blob/main/src/services/authAPI.js"
click node_dashboard "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/Dashboard.jsx"
click node_profile "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/Profile.jsx"
click node_edit_profile "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/EditProfile.jsx"
click node_avatar "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/AvatarUploader.jsx"
click node_settings "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/Settings.jsx"
click node_theme_hook "https://github.com/kukaracka/digitalpassportclient/blob/main/src/hooks/useTheme.js"
click node_theme_manager "https://github.com/kukaracka/digitalpassportclient/blob/main/src/utils/themeManager.js"
click node_products_page "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/Products.jsx"
click node_products_list "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/ProductsList.jsx"
click node_product_card "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/ProductCard.jsx"
click node_product_form "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/ProductForm.jsx"
click node_product_detail "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/ProductDetail.jsx"
click node_product_hook "https://github.com/kukaracka/digitalpassportclient/blob/main/src/hooks/useProducts.js"
click node_product_api "https://github.com/kukaracka/digitalpassportclient/blob/main/src/services/productAPI.js"
click node_image_api "https://github.com/kukaracka/digitalpassportclient/blob/main/src/services/productImageAPI.js"
click node_draft_hook "https://github.com/kukaracka/digitalpassportclient/blob/main/src/hooks/useFormDraft.js"
click node_gallery "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/ProductImageGallery.jsx"
click node_shared_page "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/SharedProductPage.jsx"
click node_qr "https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/QRCodeGenerator.jsx"

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_app_shell,node_routes,node_spinner toneBlue
class node_login,node_register,node_auth_hook,node_dashboard,node_profile,node_edit_profile,node_avatar,node_settings,node_theme_hook,node_backend toneAmber
class node_products_page,node_products_list,node_product_card,node_product_form,node_product_detail,node_product_hook,node_draft_hook,node_gallery toneMint
class node_shared_page,node_qr toneRose
class node_auth_api,node_theme_manager,node_product_api,node_image_api,node_visitor toneIndigo
```

## Components

### Application shell

- [React entry](https://github.com/kukaracka/digitalpassportclient/blob/main/src/main.jsx): `src/main.jsx`
- [App shell](https://github.com/kukaracka/digitalpassportclient/blob/main/src/App.jsx): `src/App.jsx`
- [View state](https://github.com/kukaracka/digitalpassportclient/blob/main/src/contexts/RouteContext.jsx): `src/contexts/RouteContext.jsx`
- [Loading indicator](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/LoadingSpinner.jsx): `src/components/LoadingSpinner.jsx`

### Account and preferences

- [Login](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/Login.jsx): `src/components/Login.jsx`
- [Registration](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/Register.jsx): `src/components/Register.jsx`
- [Auth state](https://github.com/kukaracka/digitalpassportclient/blob/main/src/hooks/useAuth.js): `src/hooks/useAuth.js`
- [Dashboard](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/Dashboard.jsx): `src/components/Dashboard.jsx`
- [Profile](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/Profile.jsx): `src/components/Profile.jsx`
- [Profile editor](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/EditProfile.jsx): `src/components/EditProfile.jsx`
- [Avatar upload](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/AvatarUploader.jsx): `src/components/AvatarUploader.jsx`
- [Settings](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/Settings.jsx): `src/components/Settings.jsx`
- [Theme state](https://github.com/kukaracka/digitalpassportclient/blob/main/src/hooks/useTheme.js): `src/hooks/useTheme.js`

### Product inventory

- [Products page](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/Products.jsx): `src/components/Products.jsx`
- [Products list](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/ProductsList.jsx): `src/components/ProductsList.jsx`
- [Product card](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/ProductCard.jsx): `src/components/ProductCard.jsx`
- [Product form](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/ProductForm.jsx): `src/components/ProductForm.jsx`
- [Product detail](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/ProductDetail.jsx): `src/components/ProductDetail.jsx`
- [Product state](https://github.com/kukaracka/digitalpassportclient/blob/main/src/hooks/useProducts.js): `src/hooks/useProducts.js`
- [Form drafts](https://github.com/kukaracka/digitalpassportclient/blob/main/src/hooks/useFormDraft.js): `src/hooks/useFormDraft.js`
- [Image gallery](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/ProductImageGallery.jsx): `src/components/ProductImageGallery.jsx`

### Product sharing

- [Shared product page](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/SharedProductPage.jsx): `src/components/SharedProductPage.jsx`
- [QR generator](https://github.com/kukaracka/digitalpassportclient/blob/main/src/components/QRCodeGenerator.jsx): `src/components/QRCodeGenerator.jsx`

### Client services

- [Account API](https://github.com/kukaracka/digitalpassportclient/blob/main/src/services/authAPI.js): `src/services/authAPI.js`
- [Theme persistence](https://github.com/kukaracka/digitalpassportclient/blob/main/src/utils/themeManager.js): `src/utils/themeManager.js`
- [Product API](https://github.com/kukaracka/digitalpassportclient/blob/main/src/services/productAPI.js): `src/services/productAPI.js`
- [Image API](https://github.com/kukaracka/digitalpassportclient/blob/main/src/services/productImageAPI.js): `src/services/productImageAPI.js`

### Other components

- **Visitor**
- **API server**

## Connections

- Visitor → React entry: opens (evidence: `src/main.jsx`)
- React entry → App shell: renders (evidence: `src/main.jsx`)
- React entry → Shared product page: routes to (evidence: `src/main.jsx`)
- React entry → View state: provides (evidence: `src/main.jsx`)
- React entry → Theme persistence: initializes (evidence: `src/main.jsx`)
- App shell → View state: reads view (evidence: `src/App.jsx`)
- App shell → Auth state: uses auth (evidence: `src/App.jsx`)
- App shell → Loading indicator: renders (evidence: `src/App.jsx`)
- App shell → Login: renders (evidence: `src/App.jsx`)
- App shell → Registration: renders (evidence: `src/App.jsx`)
- App shell → Dashboard: renders (evidence: `src/App.jsx`)
- App shell → Products page: renders (evidence: `src/App.jsx`)
- App shell → Profile: renders (evidence: `src/App.jsx`)
- App shell → Settings: renders (evidence: `src/App.jsx`)
- Auth state → Account API: calls (evidence: `src/hooks/useAuth.js`)
- Account API → API server: HTTP requests (evidence: `src/services/authAPI.js`)
- Dashboard → Profile: navigates
- Profile → Profile editor: renders (evidence: `src/components/Profile.jsx`)
- Dashboard → Avatar upload: uses
- Settings → Theme state: uses (evidence: `src/components/Settings.jsx`)
- Theme state → Theme persistence: reads and saves (evidence: `src/hooks/useTheme.js`)
- Products page → Products list: renders (evidence: `src/components/Products.jsx`)
- Products page → Product state: uses (evidence: `src/components/Products.jsx`)
- Products list → Product card: renders (evidence: `src/components/ProductsList.jsx`)
- Products list → Product form: renders (evidence: `src/components/ProductsList.jsx`)
- Products list → Product detail: renders (evidence: `src/components/ProductsList.jsx`)
- Product detail → Product state: calls (evidence: `src/components/ProductDetail.jsx`)
- Product detail → Product form: renders (evidence: `src/components/ProductDetail.jsx`)
- Product detail → Image gallery: renders (evidence: `src/components/ProductDetail.jsx`)
- Product detail → Loading indicator: renders (evidence: `src/components/ProductDetail.jsx`)
- Product detail → QR generator: renders (evidence: `src/components/ProductDetail.jsx`)
- Product form → Form drafts: uses (evidence: `src/components/ProductForm.jsx`)
- Product state → Product API: calls (evidence: `src/hooks/useProducts.js`)
- Product state → Image API: calls (evidence: `src/hooks/useProducts.js`)
- Shared product page → Product state: uses (evidence: `src/components/SharedProductPage.jsx`)
