# j4eu/store-expiration-tracker architecture

> Architecture diagram of the GitHub repository j4eu/store-expiration-tracker, 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/j4eu/store-expiration-tracker
- Repository: https://github.com/j4eu/store-expiration-tracker

## Overview

Store-Expiration-Tracker is a single-operator tool for keeping each tracked product’s expiration status visible, including when its date is unknown. The main workflow is barcode lookup, update-or-register, review due and unchecked products, record a discard or no-discard decision, and optionally archive or restore products. The Vue screen calls a FastAPI API; its handlers implement these operations over SQLite and use signed, expiring sessions for access control. The excerpts show the main request and persistence paths; deployment and infrastructure are intentionally not mapped as product behavior.

Main entry points: [`backend/app/main.py`](https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/main.py) (Product API handlers), [`frontend/src/App.vue`](https://github.com/j4eu/store-expiration-tracker/blob/main/frontend/src/App.vue) (Operations screen), [`frontend/src/api.js`](https://github.com/j4eu/store-expiration-tracker/blob/main/frontend/src/api.js) (API client), [`backend/app/auth.py`](https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/auth.py) (Session authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Operator interface"]
  node_vue_app["Operations screen<br/>[App.vue]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["API and domain operations"]
  node_fastapi["Product API handlers<br/>[main.py]"]
  node_product_lookup["Barcode lookup and registration<br/>[main.py]"]
  node_dashboard["Due and unchecked lists<br/>[main.py]"]
  node_expiration["Expiration decisions<br/>[main.py]"]
  node_discard_history["Discard history<br/>[main.py]"]
  node_archive["Archive and restore<br/>[main.py]"]
  node_schemas["Request and response models<br/>[schemas.py]"]
end

subgraph group_access["Session and configuration"]
  node_auth["Session authentication<br/>[auth.py]"]
  node_runtime_settings["Runtime settings<br/>[settings.py]"]
end

subgraph group_persistence["Product data"]
  node_db_access["SQLite connection layer<br/>[db.py]"]
  node_sqlite[("SQLite database")]
end

node_operator(("Store operator"))

node_operator -->|"uses"| node_vue_app
node_vue_app -->|"requests through"| node_api_client
node_api_client -->|"calls API routes"| node_fastapi
node_fastapi -->|"routes lookup and create"| node_product_lookup
node_fastapi -->|"routes dashboard query"| node_dashboard
node_fastapi -->|"routes expiration decisions"| node_expiration
node_fastapi -->|"records discards"| node_discard_history
node_fastapi -->|"routes archive actions"| node_archive
node_fastapi -->|"checks sessions"| node_auth
node_auth -->|"reads cookie settings"| node_runtime_settings
node_fastapi -->|"opens connections"| node_db_access
node_db_access -->|"reads and writes"| node_sqlite
node_fastapi -->|"validates API data"| node_schemas

click node_vue_app "https://github.com/j4eu/store-expiration-tracker/blob/main/frontend/src/App.vue"
click node_api_client "https://github.com/j4eu/store-expiration-tracker/blob/main/frontend/src/api.js"
click node_fastapi "https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/main.py"
click node_product_lookup "https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/main.py"
click node_dashboard "https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/main.py"
click node_expiration "https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/main.py"
click node_discard_history "https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/main.py"
click node_archive "https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/main.py"
click node_schemas "https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/schemas.py"
click node_auth "https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/auth.py"
click node_runtime_settings "https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/settings.py"
click node_db_access "https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/db.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_vue_app,node_api_client toneBlue
class node_fastapi,node_product_lookup,node_dashboard,node_expiration,node_discard_history,node_archive,node_schemas toneAmber
class node_auth,node_runtime_settings toneMint
class node_db_access,node_sqlite toneRose
class node_operator toneIndigo
```

## Components

### Operator interface

- [Operations screen](https://github.com/j4eu/store-expiration-tracker/blob/main/frontend/src/App.vue): `frontend/src/App.vue`
- [API client](https://github.com/j4eu/store-expiration-tracker/blob/main/frontend/src/api.js): `frontend/src/api.js`

### API and domain operations

- [Product API handlers](https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/main.py): `backend/app/main.py`
- [Barcode lookup and registration](https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/main.py): `backend/app/main.py`
- [Due and unchecked lists](https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/main.py): `backend/app/main.py`
- [Expiration decisions](https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/main.py): `backend/app/main.py`
- [Discard history](https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/main.py): `backend/app/main.py`
- [Archive and restore](https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/main.py): `backend/app/main.py`
- [Request and response models](https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/schemas.py): `backend/app/schemas.py`

### Session and configuration

- [Session authentication](https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/auth.py): `backend/app/auth.py`
- [Runtime settings](https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/settings.py): `backend/app/settings.py`

### Product data

- [SQLite connection layer](https://github.com/j4eu/store-expiration-tracker/blob/main/backend/app/db.py): `backend/app/db.py`
- **SQLite database**

### Other components

- **Store operator**

## Connections

- Store operator → Operations screen: uses (evidence: `README.md`)
- Operations screen → API client: requests through (evidence: `frontend/src/App.vue`)
- API client → Product API handlers: calls API routes (evidence: `frontend/src/api.js`)
- Product API handlers → Barcode lookup and registration: routes lookup and create (evidence: `backend/app/main.py`)
- Product API handlers → Due and unchecked lists: routes dashboard query (evidence: `backend/app/main.py`)
- Product API handlers → Expiration decisions: routes expiration decisions (evidence: `backend/app/main.py`)
- Product API handlers → Discard history: records discards (evidence: `backend/app/main.py`)
- Product API handlers → Archive and restore: routes archive actions (evidence: `backend/app/main.py`)
- Product API handlers → Session authentication: checks sessions (evidence: `backend/app/main.py`)
- Session authentication → Runtime settings: reads cookie settings (evidence: `backend/app/auth.py`)
- Product API handlers → SQLite connection layer: opens connections (evidence: `backend/app/main.py`)
- SQLite connection layer → SQLite database: reads and writes (evidence: `backend/app/db.py`)
- Product API handlers → Request and response models: validates API data (evidence: `backend/app/main.py`)
