# yerk0w/snowpeak architecture

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

- Interactive diagram: https://gitdiagram.com/yerk0w/snowpeak
- Repository: https://github.com/yerk0w/snowpeak

## Overview

SNOWPEAK is a winter-sports equipment shop with an Express/SQLite API and a browser storefront. The main customer journey is browse products, choose variants, manage a cart, and submit an order; separate paths handle sign-in, feedback, and reservations. Administrators use CRM data and status-management endpoints. The frontend and API are each concentrated in one source file. Reservation UI and some CRM interactions are not shown in the excerpts, so only documented or directly visible connections are included.

Main entry points: [`server/index.js`](https://github.com/yerk0w/snowpeak/blob/main/server/index.js) (Express API), [`src/main.js`](https://github.com/yerk0w/snowpeak/blob/main/src/main.js) (CRM dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_catalog["Product catalog<br/>[main.js]"]
  node_product["Product selection<br/>[main.js]"]
  node_cart["Cart<br/>[main.js]"]
end

subgraph group_customer["Customer workflows"]
  node_checkout["Order checkout<br/>[main.js]"]
  node_account["Account login<br/>[main.js]"]
  node_feedback["Feedback form<br/>[main.js]"]
  node_crm["CRM dashboard<br/>[main.js]"]
end

subgraph group_api["REST API"]
  node_api["Express API<br/>[index.js]"]
  node_reservation["Reservation endpoints<br/>[index.js]"]
end

subgraph group_data["Persistence"]
  node_database[("SQLite store<br/>[index.js]")]
end

node_shopper(("Shopper"))
node_admin(("Administrator"))

node_shopper -->|"browses"| node_catalog
node_catalog -->|"loads products"| node_api
node_api -->|"reads products"| node_database
node_shopper -->|"selects item"| node_product
node_product -->|"adds variant"| node_cart
node_shopper -->|"manages items"| node_cart
node_shopper -->|"submits order"| node_checkout
node_checkout -->|"posts order"| node_api
node_api -->|"saves order"| node_database
node_shopper -->|"signs in"| node_account
node_account -->|"requests login"| node_api
node_api -->|"checks account"| node_database
node_shopper -->|"sends message"| node_feedback
node_feedback -->|"posts feedback"| node_api
node_api -->|"saves feedback"| node_database
node_shopper -.->|"requests booking"| node_reservation
node_reservation -->|"stores booking"| node_database
node_admin -->|"opens CRM"| node_crm
node_crm -->|"loads overview"| node_api
node_api -->|"reads CRM records"| node_database
node_crm -.->|"manages bookings"| node_reservation

click node_catalog "https://github.com/yerk0w/snowpeak/blob/main/src/main.js"
click node_product "https://github.com/yerk0w/snowpeak/blob/main/src/main.js"
click node_cart "https://github.com/yerk0w/snowpeak/blob/main/src/main.js"
click node_checkout "https://github.com/yerk0w/snowpeak/blob/main/src/main.js"
click node_account "https://github.com/yerk0w/snowpeak/blob/main/src/main.js"
click node_feedback "https://github.com/yerk0w/snowpeak/blob/main/src/main.js"
click node_crm "https://github.com/yerk0w/snowpeak/blob/main/src/main.js"
click node_api "https://github.com/yerk0w/snowpeak/blob/main/server/index.js"
click node_reservation "https://github.com/yerk0w/snowpeak/blob/main/server/index.js"
click node_database "https://github.com/yerk0w/snowpeak/blob/main/server/index.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_catalog,node_product,node_cart toneBlue
class node_checkout,node_account,node_feedback,node_crm toneAmber
class node_api,node_reservation toneMint
class node_database toneRose
class node_shopper,node_admin toneIndigo
```

## Components

### Storefront

- [Product catalog](https://github.com/yerk0w/snowpeak/blob/main/src/main.js): `src/main.js`
- [Product selection](https://github.com/yerk0w/snowpeak/blob/main/src/main.js): `src/main.js`
- [Cart](https://github.com/yerk0w/snowpeak/blob/main/src/main.js): `src/main.js`

### Customer workflows

- [Order checkout](https://github.com/yerk0w/snowpeak/blob/main/src/main.js): `src/main.js`
- [Account login](https://github.com/yerk0w/snowpeak/blob/main/src/main.js): `src/main.js`
- [Feedback form](https://github.com/yerk0w/snowpeak/blob/main/src/main.js): `src/main.js`
- [CRM dashboard](https://github.com/yerk0w/snowpeak/blob/main/src/main.js): `src/main.js`

### REST API

- [Express API](https://github.com/yerk0w/snowpeak/blob/main/server/index.js): `server/index.js`
- [Reservation endpoints](https://github.com/yerk0w/snowpeak/blob/main/server/index.js): `server/index.js`

### Persistence

- [SQLite store](https://github.com/yerk0w/snowpeak/blob/main/server/index.js): `server/index.js`

### Other components

- **Shopper**
- **Administrator**

## Connections

- Shopper → Product catalog: browses (evidence: `src/main.js`)
- Product catalog → Express API: loads products (evidence: `src/main.js`)
- Express API → SQLite store: reads products (evidence: `server/index.js`)
- Shopper → Product selection: selects item (evidence: `src/main.js`)
- Product selection → Cart: adds variant (evidence: `src/main.js`)
- Shopper → Cart: manages items (evidence: `src/main.js`)
- Shopper → Order checkout: submits order (evidence: `src/main.js`)
- Order checkout → Express API: posts order (evidence: `src/main.js`)
- Express API → SQLite store: saves order (evidence: `server/index.js`)
- Shopper → Account login: signs in (evidence: `src/main.js`)
- Account login → Express API: requests login (evidence: `src/main.js`)
- Express API → SQLite store: checks account (evidence: `server/index.js`)
- Shopper → Feedback form: sends message (evidence: `src/main.js`)
- Feedback form → Express API: posts feedback (evidence: `src/main.js`)
- Express API → SQLite store: saves feedback (evidence: `server/index.js`)
- Shopper → Reservation endpoints: requests booking (evidence: `README.md`)
- Reservation endpoints → SQLite store: stores booking (evidence: `server/index.js`)
- Administrator → CRM dashboard: opens CRM (evidence: `src/main.js`)
- CRM dashboard → Express API: loads overview (evidence: `src/main.js`)
- Express API → SQLite store: reads CRM records (evidence: `server/index.js`)
- CRM dashboard → Reservation endpoints: manages bookings (evidence: `README.md`)
