# jvpx1/cardapio-digital architecture

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

- Interactive diagram: https://gitdiagram.com/jvpx1/cardapio-digital
- Repository: https://github.com/jvpx1/cardapio-digital

## Overview

Cardápio Digital is a full-stack restaurant-menu manager. A user switches between the registration and menu views, submits validated dish details, and can list, edit, or confirm deletion of dishes. The browser communicates with an Express REST API, which validates and handles CRUD requests using SQLite for persistence. The README documents the complete CRUD and SPA capabilities; the shown source confirms the browser requests and API-to-database operations. The diagram omits styling and Postman materials, which are not part of the runtime workflow.

Main entry points: [`server/server.js`](https://github.com/jvpx1/cardapio-digital/blob/main/server/server.js) (Dish REST API), [`client/script.js`](https://github.com/jvpx1/cardapio-digital/blob/main/client/script.js) (SPA views), [`client/index.html`](https://github.com/jvpx1/cardapio-digital/blob/main/client/index.html) (Page structure), [`server/database.js`](https://github.com/jvpx1/cardapio-digital/blob/main/server/database.js) (SQLite database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser interface"]
  node_spa["SPA views<br/>[script.js]"]
  node_dish_form["Dish form<br/>[script.js]"]
  node_menu_actions["Menu and actions<br/>[script.js]"]
  node_page_shell["Page structure<br/>[index.html]"]
end

subgraph group_backend["API service"]
  node_rest_api["Dish REST API<br/>[server.js]"]
end

subgraph group_storage["Persistent storage"]
  node_sqlite[("SQLite database<br/>[database.js]")]
end

node_user(("Restaurant user"))

node_user -->|"uses"| node_spa
node_spa -->|"shows views"| node_page_shell
node_dish_form -->|"creates or updates"| node_rest_api
node_menu_actions -->|"loads or deletes"| node_rest_api
node_rest_api -->|"returns JSON"| node_dish_form
node_rest_api -->|"returns JSON"| node_menu_actions
node_rest_api -->|"reads and writes"| node_sqlite

click node_spa "https://github.com/jvpx1/cardapio-digital/blob/main/client/script.js"
click node_dish_form "https://github.com/jvpx1/cardapio-digital/blob/main/client/script.js"
click node_menu_actions "https://github.com/jvpx1/cardapio-digital/blob/main/client/script.js"
click node_page_shell "https://github.com/jvpx1/cardapio-digital/blob/main/client/index.html"
click node_rest_api "https://github.com/jvpx1/cardapio-digital/blob/main/server/server.js"
click node_sqlite "https://github.com/jvpx1/cardapio-digital/blob/main/server/database.js"

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_spa,node_dish_form,node_menu_actions,node_page_shell,node_user toneBlue
class node_rest_api toneAmber
class node_sqlite toneMint
```

## Components

### Browser interface

- [SPA views](https://github.com/jvpx1/cardapio-digital/blob/main/client/script.js): `client/script.js`
- [Dish form](https://github.com/jvpx1/cardapio-digital/blob/main/client/script.js): `client/script.js`
- [Menu and actions](https://github.com/jvpx1/cardapio-digital/blob/main/client/script.js): `client/script.js`
- [Page structure](https://github.com/jvpx1/cardapio-digital/blob/main/client/index.html): `client/index.html`

### API service

- [Dish REST API](https://github.com/jvpx1/cardapio-digital/blob/main/server/server.js): `server/server.js`

### Persistent storage

- [SQLite database](https://github.com/jvpx1/cardapio-digital/blob/main/server/database.js): `server/database.js`

### Other components

- **Restaurant user**

## Connections

- Restaurant user → SPA views: uses (evidence: `README.md`)
- SPA views → Page structure: shows views (evidence: `README.md`)
- Dish form → Dish REST API: creates or updates (evidence: `client/script.js`)
- Menu and actions → Dish REST API: loads or deletes (evidence: `client/script.js`)
- Dish REST API → Dish form: returns JSON (evidence: `client/script.js`)
- Dish REST API → Menu and actions: returns JSON (evidence: `client/script.js`)
- Dish REST API → SQLite database: reads and writes (evidence: `server/server.js`)
