# peera-exe/account-workshop architecture

> Architecture diagram of the GitHub repository peera-exe/account-workshop, 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/peera-exe/account-workshop
- Repository: https://github.com/peera-exe/account-workshop

## Overview

Account Workshop is a small browser-based account-management app. Users register, log in, browse or search members, change passwords, and delete accounts. The browser sends API requests to the Express server, which validates requests, hashes or checks passwords, and reads or updates MongoDB. Static page markup is present in the tree, but its contents were not sampled, so the diagram focuses on the shown client and server behavior. All shown links are supported by app.js or public/script.js.

Main entry points: [`app.js`](https://github.com/peera-exe/account-workshop/blob/main/app.js) (Express routes), [`public/script.js`](https://github.com/peera-exe/account-workshop/blob/main/public/script.js) (Account interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser client"]
  node_browser["Account interface<br/>[script.js]"]
end

subgraph group_server["Account API"]
  node_api["Express routes<br/>[app.js]"]
  node_passwords["Password hashing<br/>[app.js]"]
end

subgraph group_data["Account storage"]
  node_users[("Users collection<br/>[app.js]")]
end

node_member(("Member"))
node_mongodb[("MongoDB")]

node_member -->|"uses"| node_browser
node_browser -->|"sends requests"| node_api
node_api -->|"returns responses"| node_browser
node_api -->|"hashes and checks"| node_passwords
node_api -->|"reads and writes"| node_users
node_api -->|"connects and indexes"| node_mongodb
node_users -->|"stores accounts"| node_mongodb

click node_browser "https://github.com/peera-exe/account-workshop/blob/main/public/script.js"
click node_api "https://github.com/peera-exe/account-workshop/blob/main/app.js"
click node_passwords "https://github.com/peera-exe/account-workshop/blob/main/app.js"
click node_users "https://github.com/peera-exe/account-workshop/blob/main/app.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_browser toneBlue
class node_api,node_passwords,node_mongodb toneAmber
class node_users toneMint
class node_member toneIndigo
```

## Components

### Browser client

- [Account interface](https://github.com/peera-exe/account-workshop/blob/main/public/script.js): `public/script.js`

### Account API

- [Express routes](https://github.com/peera-exe/account-workshop/blob/main/app.js): `app.js`
- [Password hashing](https://github.com/peera-exe/account-workshop/blob/main/app.js): `app.js`

### Account storage

- [Users collection](https://github.com/peera-exe/account-workshop/blob/main/app.js): `app.js`

### Other components

- **Member**
- **MongoDB**

## Connections

- Member → Account interface: uses (evidence: `public/script.js`)
- Account interface → Express routes: sends requests (evidence: `public/script.js`)
- Express routes → Account interface: returns responses (evidence: `app.js`)
- Express routes → Password hashing: hashes and checks (evidence: `app.js`)
- Express routes → Users collection: reads and writes (evidence: `app.js`)
- Express routes → MongoDB: connects and indexes (evidence: `app.js`)
- Users collection → MongoDB: stores accounts (evidence: `app.js`)
