# dwennk/004-nuxt architecture

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

- Interactive diagram: https://gitdiagram.com/dwennk/004-nuxt
- Repository: https://github.com/dwennk/004-nuxt

## Overview

Microwest POS is a French-language shop-management app for in-store sales, repairs, payments, and related operations. The main workflow begins at the counter or a case page: a repair/support ticket may lead to a quote, customer order, and invoice; direct sales can begin at the invoice stage. Payments are tracked separately, and tickets can be closed after collection. README documents these stages and secondary modules. The tree and excerpts support the broad boundaries shown here; unsampled subsystem wiring is kept at directory level rather than inferred in detail.

Main entry points: [`app/pages/documents/index.vue`](https://github.com/dwennk/004-nuxt/blob/main/app/pages/documents/index.vue) (Quotes and invoices), [`app/pages/payments/index.vue`](https://github.com/dwennk/004-nuxt/blob/main/app/pages/payments/index.vue) (Payment ledger), [`server/utils/pos`](https://github.com/dwennk/004-nuxt/tree/main/server/utils/pos) (POS domain services), [`server/db/schema.ts`](https://github.com/dwennk/004-nuxt/blob/main/server/db/schema.ts) (POS database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_front["Storefront"]
  node_counter["Counter workspace<br/>[index.vue]"]
  node_catalog["Catalog and customers<br/>[index.vue]"]
end

subgraph group_cases["Cases and Sales"]
  node_tickets["Repair tickets<br/>[&#91;...path&#93;.vue]"]
  node_dossiers["Shared case editing<br/>[useDossierFetch.ts]"]
  node_documents["Quotes and invoices<br/>[index.vue]"]
  node_sales["Direct sales<br/>[new.vue]"]
  node_after_sales["After-sales returns<br/>[index.vue]"]
end

subgraph group_finance["Finance and Reporting"]
  node_payments["Payment ledger<br/>[index.vue]"]
  node_reports["Reports and closeout<br/>[index.vue]"]
  node_home_api["Counter overview API<br/>[comptoir.get.ts]"]
  node_pos_domain["POS domain services"]
end

subgraph group_services["Store Services"]
  node_reservations["Smartphone inventory"]
  node_vacations["Vacation tracking<br/>[vacations.ts]"]
  node_shopify["Shopify import<br/>[import.ts]"]
  node_shopify_service["Shopify API client<br/>[client.ts]"]
  node_assistant["AI assistant"]
end

subgraph group_platform["Platform Services"]
  node_db[("POS database<br/>[schema.ts]")]
  node_backups["Backup service<br/>[service.ts]"]
  node_auth["Authentication<br/>[auth.ts]"]
end

node_operator(("Store operator"))
node_shopify_ext{{"Shopify"}}
node_dropbox{{"Dropbox"}}

node_operator -->|"opens workspace"| node_counter
node_operator -->|"records case"| node_tickets
node_operator -->|"starts sale"| node_sales
node_counter -->|"loads overview"| node_home_api
node_counter -->|"opens ticket"| node_tickets
node_counter -->|"opens documents"| node_documents
node_tickets -->|"reserves edits"| node_dossiers
node_tickets -->|"creates quote/order"| node_documents
node_documents -->|"collects payment"| node_payments
node_sales -->|"creates invoice"| node_documents
node_sales -->|"records payment"| node_payments
node_after_sales -->|"owns documents"| node_documents
node_after_sales -->|"tracks payments"| node_payments
node_home_api -->|"reads overview"| node_pos_domain
node_pos_domain -->|"reads and writes"| node_db
node_payments -->|"uses payment services"| node_pos_domain
node_reports -->|"requests reports"| node_pos_domain
node_catalog -->|"uses catalog services"| node_pos_domain
node_reservations -->|"persists stock"| node_db
node_vacations -->|"persists entries"| node_db
node_shopify -->|"fetches orders"| node_shopify_service
node_shopify_service -.->|"calls API"| node_shopify_ext
node_shopify -->|"imports invoices"| node_documents
node_shopify -->|"imports payments"| node_payments
node_assistant -->|"queries allowed data"| node_db
node_backups -->|"exports database"| node_db
node_backups -.->|"uploads backup"| node_dropbox
node_operator -->|"authenticates"| node_auth

click node_counter "https://github.com/dwennk/004-nuxt/blob/main/app/pages/index.vue"
click node_catalog "https://github.com/dwennk/004-nuxt/blob/main/app/pages/catalog/index.vue"
click node_tickets "https://github.com/dwennk/004-nuxt/blob/main/app/pages/tickets/%5B...path%5D.vue"
click node_dossiers "https://github.com/dwennk/004-nuxt/blob/main/app/composables/useDossierFetch.ts"
click node_documents "https://github.com/dwennk/004-nuxt/blob/main/app/pages/documents/index.vue"
click node_sales "https://github.com/dwennk/004-nuxt/blob/main/app/pages/sales/new.vue"
click node_after_sales "https://github.com/dwennk/004-nuxt/blob/main/app/pages/dossiers/index.vue"
click node_payments "https://github.com/dwennk/004-nuxt/blob/main/app/pages/payments/index.vue"
click node_reports "https://github.com/dwennk/004-nuxt/blob/main/app/pages/reports/index.vue"
click node_home_api "https://github.com/dwennk/004-nuxt/blob/main/server/api/comptoir.get.ts"
click node_pos_domain "https://github.com/dwennk/004-nuxt/tree/main/server/utils/pos"
click node_db "https://github.com/dwennk/004-nuxt/blob/main/server/db/schema.ts"
click node_reservations "https://github.com/dwennk/004-nuxt/blob/main/server/utils/smartphone-stocks.ts"
click node_vacations "https://github.com/dwennk/004-nuxt/blob/main/server/utils/pos/vacations.ts"
click node_shopify "https://github.com/dwennk/004-nuxt/blob/main/server/utils/shopify/import.ts"
click node_shopify_service "https://github.com/dwennk/004-nuxt/blob/main/server/utils/shopify/client.ts"
click node_assistant "https://github.com/dwennk/004-nuxt/tree/main/server/utils/assistant"
click node_backups "https://github.com/dwennk/004-nuxt/blob/main/server/utils/backups/service.ts"
click node_auth "https://github.com/dwennk/004-nuxt/blob/main/server/middleware/auth.ts"

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_counter,node_catalog toneBlue
class node_tickets,node_dossiers,node_documents,node_sales,node_after_sales toneAmber
class node_payments,node_reports,node_home_api,node_pos_domain toneMint
class node_reservations,node_vacations,node_shopify,node_shopify_service,node_assistant toneRose
class node_db,node_backups,node_auth,node_operator,node_shopify_ext,node_dropbox toneIndigo
```

## Components

### Storefront

- [Counter workspace](https://github.com/dwennk/004-nuxt/blob/main/app/pages/index.vue): `app/pages/index.vue`
- [Catalog and customers](https://github.com/dwennk/004-nuxt/blob/main/app/pages/catalog/index.vue): `app/pages/catalog/index.vue`

### Cases and Sales

- [Repair tickets](https://github.com/dwennk/004-nuxt/blob/main/app/pages/tickets/%5B...path%5D.vue): `app/pages/tickets/[...path].vue`
- [Shared case editing](https://github.com/dwennk/004-nuxt/blob/main/app/composables/useDossierFetch.ts): `app/composables/useDossierFetch.ts`
- [Quotes and invoices](https://github.com/dwennk/004-nuxt/blob/main/app/pages/documents/index.vue): `app/pages/documents/index.vue`
- [Direct sales](https://github.com/dwennk/004-nuxt/blob/main/app/pages/sales/new.vue): `app/pages/sales/new.vue`
- [After-sales returns](https://github.com/dwennk/004-nuxt/blob/main/app/pages/dossiers/index.vue): `app/pages/dossiers/index.vue`

### Finance and Reporting

- [Payment ledger](https://github.com/dwennk/004-nuxt/blob/main/app/pages/payments/index.vue): `app/pages/payments/index.vue`
- [Reports and closeout](https://github.com/dwennk/004-nuxt/blob/main/app/pages/reports/index.vue): `app/pages/reports/index.vue`
- [Counter overview API](https://github.com/dwennk/004-nuxt/blob/main/server/api/comptoir.get.ts): `server/api/comptoir.get.ts`
- [POS domain services](https://github.com/dwennk/004-nuxt/tree/main/server/utils/pos): `server/utils/pos`

### Store Services

- [Smartphone inventory](https://github.com/dwennk/004-nuxt/blob/main/server/utils/smartphone-stocks.ts): `server/utils/smartphone-stocks.ts`
- [Vacation tracking](https://github.com/dwennk/004-nuxt/blob/main/server/utils/pos/vacations.ts): `server/utils/pos/vacations.ts`
- [Shopify import](https://github.com/dwennk/004-nuxt/blob/main/server/utils/shopify/import.ts): `server/utils/shopify/import.ts`
- [Shopify API client](https://github.com/dwennk/004-nuxt/blob/main/server/utils/shopify/client.ts): `server/utils/shopify/client.ts`
- [AI assistant](https://github.com/dwennk/004-nuxt/tree/main/server/utils/assistant): `server/utils/assistant`

### Platform Services

- [POS database](https://github.com/dwennk/004-nuxt/blob/main/server/db/schema.ts): `server/db/schema.ts`
- [Backup service](https://github.com/dwennk/004-nuxt/blob/main/server/utils/backups/service.ts): `server/utils/backups/service.ts`
- [Authentication](https://github.com/dwennk/004-nuxt/blob/main/server/middleware/auth.ts): `server/middleware/auth.ts`

### Other components

- **Store operator**
- **Shopify**
- **Dropbox**

## Connections

- Store operator → Counter workspace: opens workspace
- Store operator → Repair tickets: records case
- Store operator → Direct sales: starts sale
- Counter workspace → Counter overview API: loads overview
- Counter workspace → Repair tickets: opens ticket
- Counter workspace → Quotes and invoices: opens documents
- Repair tickets → Shared case editing: reserves edits
- Repair tickets → Quotes and invoices: creates quote/order
- Quotes and invoices → Payment ledger: collects payment
- Direct sales → Quotes and invoices: creates invoice
- Direct sales → Payment ledger: records payment
- After-sales returns → Quotes and invoices: owns documents
- After-sales returns → Payment ledger: tracks payments
- Counter overview API → POS domain services: reads overview
- POS domain services → POS database: reads and writes
- Payment ledger → POS domain services: uses payment services
- Reports and closeout → POS domain services: requests reports
- Catalog and customers → POS domain services: uses catalog services
- Smartphone inventory → POS database: persists stock
- Vacation tracking → POS database: persists entries
- Shopify import → Shopify API client: fetches orders
- Shopify API client → Shopify: calls API
- Shopify import → Quotes and invoices: imports invoices
- Shopify import → Payment ledger: imports payments
- AI assistant → POS database: queries allowed data
- Backup service → POS database: exports database
- Backup service → Dropbox: uploads backup
- Store operator → Authentication: authenticates
