# switchgirl95/shop architecture

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

- Interactive diagram: https://gitdiagram.com/switchgirl95/shop
- Repository: https://github.com/switchgirl95/shop

## Overview

Shop Manager is a JavaFX store-management application. A user enters through the login screen, then works in the cashier workflow or the management screens; those controllers use a shared persistence manager for store data. Cashier operations create invoices and line items, while catalogue export produces a PDF. The model includes products, categories, staff, photos, stock-management records and invoices. The README is brief, so workflow details come from the sampled source and SOURCE INDEX; unsampled subsystem links are omitted where their behavior is uncertain.

Main entry points: [`src/Modele/Produit.java`](https://github.com/switchgirl95/shop/blob/master/src/Modele/Produit.java) (Products), [`src/shop/LoginController.java`](https://github.com/switchgirl95/shop/blob/master/src/shop/LoginController.java) (Login screen), [`src/shop/Main_finalController.java`](https://github.com/switchgirl95/shop/blob/master/src/shop/Main_finalController.java) (Store management), [`src/shop/Cashier1Controller.java`](https://github.com/switchgirl95/shop/blob/master/src/shop/Cashier1Controller.java) (Cashier sales)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["JavaFX screens"]
  node_app["Application startup<br/>[Shop.java]"]
  node_login["Login screen"]
end

subgraph group_workflows["Store workflows"]
  node_management["Store management"]
  node_staff["Staff administration"]
  node_cashier["Cashier sales"]
  node_catalogue["Catalogue export<br/>[Catalog.java]"]
  node_catalogue_pdf["Catalogue PDF"]
end

subgraph group_domain["Store data"]
  node_product["Products<br/>[Produit.java]"]
  node_category["Categories<br/>[Categorie.java]"]
  node_stock["Stock management<br/>[GestionStock.java]"]
  node_staff_data["Staff records<br/>[Gestionnaire.java]"]
  node_photos["Product photos<br/>[Photo.java]"]
  node_invoice["Invoices<br/>[Facture.java]"]
  node_invoice_lines["Invoice lines<br/>[ListeFacture.java]"]
end

subgraph group_persistence["Persistence"]
  node_persistence["Persistence manager"]
  node_database[("Shop database")]
end

node_user(("Store user"))

node_user -->|"starts"| node_app
node_app -->|"loads screen"| node_login
node_login -->|"routes to"| node_cashier
node_login -->|"routes to"| node_management
node_login -->|"routes to"| node_staff
node_login -->|"routes to"| node_catalogue
node_management -->|"queries and updates"| node_persistence
node_staff -->|"deletes records"| node_persistence
node_cashier -->|"reads and saves"| node_persistence
node_catalogue -->|"loads products"| node_persistence
node_catalogue -->|"generates"| node_catalogue_pdf
node_persistence -.->|"persists data"| node_database
node_management -->|"manages"| node_product
node_management -->|"manages"| node_category
node_management -->|"uses"| node_stock
node_staff -->|"manages"| node_staff_data
node_cashier -->|"looks up"| node_product
node_cashier -->|"creates"| node_invoice
node_cashier -->|"saves"| node_invoice_lines
node_catalogue -->|"renders"| node_product
node_catalogue -->|"uses images"| node_photos
node_product -->|"references"| node_category
node_product -->|"contains"| node_photos
node_invoice -->|"references cashier"| node_staff_data
node_invoice -->|"contains"| node_invoice_lines
node_invoice_lines -->|"references"| node_product

click node_app "https://github.com/switchgirl95/shop/blob/master/src/shop/Shop.java"
click node_login "https://github.com/switchgirl95/shop/blob/master/src/shop/LoginController.java"
click node_management "https://github.com/switchgirl95/shop/blob/master/src/shop/Main_finalController.java"
click node_staff "https://github.com/switchgirl95/shop/blob/master/src/shop/GestionnairesController.java"
click node_cashier "https://github.com/switchgirl95/shop/blob/master/src/shop/Cashier1Controller.java"
click node_catalogue "https://github.com/switchgirl95/shop/blob/master/src/shop/Catalog.java"
click node_product "https://github.com/switchgirl95/shop/blob/master/src/Modele/Produit.java"
click node_category "https://github.com/switchgirl95/shop/blob/master/src/Modele/Categorie.java"
click node_stock "https://github.com/switchgirl95/shop/blob/master/src/Modele/GestionStock.java"
click node_staff_data "https://github.com/switchgirl95/shop/blob/master/src/Modele/Gestionnaire.java"
click node_photos "https://github.com/switchgirl95/shop/blob/master/src/Modele/Photo.java"
click node_invoice "https://github.com/switchgirl95/shop/blob/master/src/Modele/Facture.java"
click node_invoice_lines "https://github.com/switchgirl95/shop/blob/master/src/Modele/ListeFacture.java"
click node_persistence "https://github.com/switchgirl95/shop/blob/master/src/Modele/PersistenceManager.java"

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_user toneBlue
class node_management,node_staff,node_cashier,node_catalogue,node_catalogue_pdf toneAmber
class node_product,node_category,node_stock,node_staff_data,node_photos,node_invoice,node_invoice_lines toneMint
class node_persistence,node_database toneRose
```

## Components

### JavaFX screens

- [Application startup](https://github.com/switchgirl95/shop/blob/master/src/shop/Shop.java): `src/shop/Shop.java`
- [Login screen](https://github.com/switchgirl95/shop/blob/master/src/shop/LoginController.java): `src/shop/LoginController.java`

### Store workflows

- [Store management](https://github.com/switchgirl95/shop/blob/master/src/shop/Main_finalController.java): `src/shop/Main_finalController.java`
- [Staff administration](https://github.com/switchgirl95/shop/blob/master/src/shop/GestionnairesController.java): `src/shop/GestionnairesController.java`
- [Cashier sales](https://github.com/switchgirl95/shop/blob/master/src/shop/Cashier1Controller.java): `src/shop/Cashier1Controller.java`
- [Catalogue export](https://github.com/switchgirl95/shop/blob/master/src/shop/Catalog.java): `src/shop/Catalog.java`
- **Catalogue PDF**

### Store data

- [Products](https://github.com/switchgirl95/shop/blob/master/src/Modele/Produit.java): `src/Modele/Produit.java`
- [Categories](https://github.com/switchgirl95/shop/blob/master/src/Modele/Categorie.java): `src/Modele/Categorie.java`
- [Stock management](https://github.com/switchgirl95/shop/blob/master/src/Modele/GestionStock.java): `src/Modele/GestionStock.java`
- [Staff records](https://github.com/switchgirl95/shop/blob/master/src/Modele/Gestionnaire.java): `src/Modele/Gestionnaire.java`
- [Product photos](https://github.com/switchgirl95/shop/blob/master/src/Modele/Photo.java): `src/Modele/Photo.java`
- [Invoices](https://github.com/switchgirl95/shop/blob/master/src/Modele/Facture.java): `src/Modele/Facture.java`
- [Invoice lines](https://github.com/switchgirl95/shop/blob/master/src/Modele/ListeFacture.java): `src/Modele/ListeFacture.java`

### Persistence

- [Persistence manager](https://github.com/switchgirl95/shop/blob/master/src/Modele/PersistenceManager.java): `src/Modele/PersistenceManager.java`
- **Shop database**

### Other components

- **Store user**

## Connections

- Store user → Application startup: starts (evidence: `src/shop/Shop.java`)
- Application startup → Login screen: loads screen (evidence: `src/shop/Shop.java`)
- Login screen → Cashier sales: routes to (evidence: `src/shop/LoginController.java`)
- Login screen → Store management: routes to (evidence: `src/shop/LoginController.java`)
- Login screen → Staff administration: routes to (evidence: `src/shop/LoginController.java`)
- Login screen → Catalogue export: routes to (evidence: `src/shop/LoginController.java`)
- Store management → Persistence manager: queries and updates (evidence: `src/shop/Main_finalController.java`)
- Staff administration → Persistence manager: deletes records (evidence: `src/shop/GestionnairesController.java`)
- Cashier sales → Persistence manager: reads and saves (evidence: `src/shop/Cashier1Controller.java`)
- Catalogue export → Persistence manager: loads products (evidence: `src/shop/Catalog.java`)
- Catalogue export → Catalogue PDF: generates (evidence: `src/shop/Catalog.java`)
- Persistence manager → Shop database: persists data
- Store management → Products: manages (evidence: `src/shop/Main_finalController.java`)
- Store management → Categories: manages (evidence: `src/shop/Main_finalController.java`)
- Store management → Stock management: uses (evidence: `src/shop/Main_finalController.java`)
- Staff administration → Staff records: manages (evidence: `src/shop/GestionnairesController.java`)
- Cashier sales → Products: looks up (evidence: `src/shop/Cashier1Controller.java`)
- Cashier sales → Invoices: creates (evidence: `src/shop/Cashier1Controller.java`)
- Cashier sales → Invoice lines: saves (evidence: `src/shop/Cashier1Controller.java`)
- Catalogue export → Products: renders (evidence: `src/shop/Catalog.java`)
- Catalogue export → Product photos: uses images (evidence: `src/shop/Catalog.java`)
- Products → Categories: references (evidence: `src/Modele/Produit.java`)
- Products → Product photos: contains (evidence: `src/Modele/Produit.java`)
- Invoices → Staff records: references cashier (evidence: `src/Modele/Facture.java`)
- Invoices → Invoice lines: contains (evidence: `src/Modele/Facture.java`)
- Invoice lines → Products: references (evidence: `src/Modele/ListeFacture.java`)
