# nico-amsterdam/vue-crud-nuxt architecture

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

- Interactive diagram: https://gitdiagram.com/nico-amsterdam/vue-crud-nuxt
- Repository: https://github.com/nico-amsterdam/vue-crud-nuxt

## Overview

Vue CRUD Nuxt is a localized product-management app with passwordless WebAuthn access, Pinia-backed product state, Nuxt API routes, and SQLite via Cloudflare D1. The main workflow is sign in, browse/search products, then add, edit, or delete them through the product store and API. The README also documents responsive/accessibility support, theme switching, and Cloudflare deployment. Several product routes and server handlers were not excerpted, so links involving those implementations are omitted or marked unverified rather than inferred as direct calls.

Main entry points: [`app/stores/product.ts`](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/stores/product.ts) (Product store), [`server/api/webauthn`](https://github.com/nico-amsterdam/vue-crud-nuxt/tree/master/server/api/webauthn) (WebAuthn handlers), [`server/api/products`](https://github.com/nico-amsterdam/vue-crud-nuxt/tree/master/server/api/products) (Product API), [`app/pages/index.vue`](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/pages/index.vue) (Product list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Nuxt client"]
  node_authpage["Sign-in page<br/>[auth.vue]"]
  node_authguard["Auth middleware<br/>[auth.ts]"]
  node_appframe["App shell<br/>[app.vue]"]
  node_layout["CRUD layout<br/>[vue-crud.vue]"]
  node_theme["Theme store<br/>[theme.ts]"]
end

subgraph group_product["Product workflow"]
  node_productlist["Product list<br/>[index.vue]"]
  node_addpage["Add product<br/>[add-product.vue]"]
  node_editpage["Edit product<br/>[edit.vue]"]
  node_deletepage["Delete product<br/>[delete.vue]"]
  node_productform["Product form<br/>[ProductForm.vue]"]
  node_productstore["Product store<br/>[product.ts]"]
end

subgraph group_server["Server services"]
  node_authapi["WebAuthn handlers"]
  node_session["User session"]
  node_productapi["Product API"]
  node_security["Request security"]
end

subgraph group_persistence["Persistence and localization"]
  node_challengekv[("Challenge KV")]
  node_productdb[("Product schema<br/>[schema.ts]")]
  node_dbadapter["D1 adapter<br/>[db.ts]"]
  node_translations["Client translations"]
  node_servertranslations["Server translations<br/>[translations.ts]"]
end

node_user(("User"))
node_d1[("Cloudflare D1")]

node_user -->|"signs in"| node_authpage
node_authpage -->|"starts WebAuthn"| node_authapi
node_authapi -->|"stores challenge"| node_challengekv
node_authapi -->|"reads credentials"| node_productdb
node_authapi -->|"sets session"| node_session
node_appframe -->|"watches login"| node_session
node_productlist -->|"loads products"| node_productstore
node_productstore -->|"requests products"| node_productapi
node_addpage -.->|"uses form"| node_productform
node_editpage -.->|"uses form"| node_productform
node_addpage -.->|"adds product"| node_productstore
node_editpage -.->|"updates product"| node_productstore
node_deletepage -.->|"deletes product"| node_productstore
node_productapi -.->|"queries data"| node_dbadapter
node_dbadapter -->|"uses schema"| node_productdb
node_dbadapter -->|"opens database"| node_d1
node_authguard -.->|"checks access"| node_session
node_productlist -->|"renders in"| node_layout
node_layout -.->|"reads theme"| node_theme
node_productlist -.->|"uses locale"| node_translations
node_productapi -.->|"localizes responses"| node_servertranslations
node_security -.->|"checks requests"| node_productapi

click node_authpage "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/pages/auth.vue"
click node_authapi "https://github.com/nico-amsterdam/vue-crud-nuxt/tree/master/server/api/webauthn"
click node_authguard "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/middleware/auth.ts"
click node_appframe "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/app.vue"
click node_layout "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/layouts/vue-crud.vue"
click node_productlist "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/pages/index.vue"
click node_addpage "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/pages/add-product.vue"
click node_editpage "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/pages/product/%5Bid%5D/edit.vue"
click node_deletepage "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/pages/product/%5Bid%5D/delete.vue"
click node_productform "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/components/ProductForm.vue"
click node_productstore "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/stores/product.ts"
click node_productapi "https://github.com/nico-amsterdam/vue-crud-nuxt/tree/master/server/api/products"
click node_productdb "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/server/database/schema.ts"
click node_dbadapter "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/server/utils/db.ts"
click node_theme "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/stores/theme.ts"
click node_translations "https://github.com/nico-amsterdam/vue-crud-nuxt/tree/master/i18n/locales"
click node_servertranslations "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/server/utils/translations.ts"
click node_security "https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/server/middleware/00.global-security.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_authpage,node_authguard,node_appframe,node_layout,node_theme,node_user toneBlue
class node_productlist,node_addpage,node_editpage,node_deletepage,node_productform,node_productstore,node_d1 toneAmber
class node_authapi,node_session,node_productapi,node_security toneMint
class node_challengekv,node_productdb,node_dbadapter,node_translations,node_servertranslations toneRose
```

## Components

### Nuxt client

- [Sign-in page](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/pages/auth.vue): `app/pages/auth.vue`
- [Auth middleware](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/middleware/auth.ts): `app/middleware/auth.ts`
- [App shell](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/app.vue): `app/app.vue`
- [CRUD layout](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/layouts/vue-crud.vue): `app/layouts/vue-crud.vue`
- [Theme store](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/stores/theme.ts): `app/stores/theme.ts`

### Product workflow

- [Product list](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/pages/index.vue): `app/pages/index.vue`
- [Add product](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/pages/add-product.vue): `app/pages/add-product.vue`
- [Edit product](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/pages/product/%5Bid%5D/edit.vue): `app/pages/product/[id]/edit.vue`
- [Delete product](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/pages/product/%5Bid%5D/delete.vue): `app/pages/product/[id]/delete.vue`
- [Product form](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/components/ProductForm.vue): `app/components/ProductForm.vue`
- [Product store](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/app/stores/product.ts): `app/stores/product.ts`

### Server services

- [WebAuthn handlers](https://github.com/nico-amsterdam/vue-crud-nuxt/tree/master/server/api/webauthn): `server/api/webauthn`
- **User session**
- [Product API](https://github.com/nico-amsterdam/vue-crud-nuxt/tree/master/server/api/products): `server/api/products`
- [Request security](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/server/middleware/00.global-security.ts): `server/middleware/00.global-security.ts`

### Persistence and localization

- **Challenge KV**
- [Product schema](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/server/database/schema.ts): `server/database/schema.ts`
- [D1 adapter](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/server/utils/db.ts): `server/utils/db.ts`
- [Client translations](https://github.com/nico-amsterdam/vue-crud-nuxt/tree/master/i18n/locales): `i18n/locales`
- [Server translations](https://github.com/nico-amsterdam/vue-crud-nuxt/blob/master/server/utils/translations.ts): `server/utils/translations.ts`

### Other components

- **User**
- **Cloudflare D1**

## Connections

- User → Sign-in page: signs in (evidence: `README.md`)
- Sign-in page → WebAuthn handlers: starts WebAuthn (evidence: `README.md`)
- WebAuthn handlers → Challenge KV: stores challenge (evidence: `server/api/webauthn/authenticate.post.ts`)
- WebAuthn handlers → Product schema: reads credentials (evidence: `server/api/webauthn/authenticate.post.ts`)
- WebAuthn handlers → User session: sets session (evidence: `server/api/webauthn/authenticate.post.ts`)
- App shell → User session: watches login (evidence: `app/app.vue`)
- Product list → Product store: loads products (evidence: `app/pages/index.vue`)
- Product store → Product API: requests products (evidence: `app/stores/product.ts`)
- Add product → Product form: uses form
- Edit product → Product form: uses form
- Add product → Product store: adds product
- Edit product → Product store: updates product
- Delete product → Product store: deletes product
- Product API → D1 adapter: queries data
- D1 adapter → Product schema: uses schema (evidence: `server/utils/db.ts`)
- D1 adapter → Cloudflare D1: opens database (evidence: `README.md`)
- Auth middleware → User session: checks access
- Product list → CRUD layout: renders in (evidence: `app/pages/index.vue`)
- CRUD layout → Theme store: reads theme
- Product list → Client translations: uses locale
- Product API → Server translations: localizes responses
- Request security → Product API: checks requests
