# kurtuson92-web/e-lista architecture

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

- Interactive diagram: https://gitdiagram.com/kurtuson92-web/e-lista
- Repository: https://github.com/kurtuson92-web/e-lista

## Overview

Cupitate is a browser-based credit ledger with account signup, login, profile and password management, and credit deposits and spending. Users submit account actions from the home page, then reach the dashboard to view or change their credit history. The Express server handles these requests, hashes passwords, and persists user records and credit entries in MongoDB. Both root-level and `public/` client scripts are present; the excerpts show their request behavior, but do not establish which duplicate scripts each HTML page loads.

Main entry points: [`index.js`](https://github.com/kurtuson92-web/e-lista/blob/main/index.js) (HTTP server), [`public/home.js`](https://github.com/kurtuson92-web/e-lista/blob/main/public/home.js) (Home client), [`home.js`](https://github.com/kurtuson92-web/e-lista/blob/main/home.js) (Root home client), [`public/dashboard.js`](https://github.com/kurtuson92-web/e-lista/blob/main/public/dashboard.js) (Dashboard client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser clients"]
  node_home_public["Home client<br/>[home.js]"]
  node_home_root["Root home client<br/>[home.js]"]
  node_dashboard_public["Dashboard client<br/>[dashboard.js]"]
  node_dashboard_root["Root dashboard client<br/>[dashboard.js]"]
end

subgraph group_account["Account services"]
  node_server["HTTP server<br/>[index.js]"]
  node_account_auth["Signup and login<br/>[index.js]"]
  node_account_recovery["Password recovery<br/>[index.js]"]
  node_account_profile["Profile management<br/>[index.js]"]
  node_bcrypt["bcrypt"]
end

subgraph group_ledger["Credit ledger"]
  node_credit_api["Credit operations<br/>[index.js]"]
end

subgraph group_persistence["Persistence"]
  node_user_model["User and credits<br/>[index.js]"]
  node_mongo[("MongoDB")]
end

node_user(("User"))

node_user -->|"uses"| node_home_public
node_user -->|"uses"| node_home_root
node_home_public -->|"submits auth requests"| node_server
node_home_root -->|"submits auth requests"| node_server
node_user -->|"uses"| node_dashboard_public
node_user -->|"uses"| node_dashboard_root
node_dashboard_public -->|"sends account and credit requests"| node_server
node_dashboard_root -->|"sends account and credit requests"| node_server
node_server -->|"routes signup and login"| node_account_auth
node_server -->|"routes password resets"| node_account_recovery
node_server -->|"routes profile updates"| node_account_profile
node_server -->|"routes credit actions"| node_credit_api
node_account_auth -->|"looks up and saves users"| node_user_model
node_account_recovery -->|"reads and updates users"| node_user_model
node_account_profile -->|"reads and updates users"| node_user_model
node_credit_api -->|"reads and saves credits"| node_user_model
node_account_auth -->|"hashes and compares"| node_bcrypt
node_account_recovery -->|"hashes and compares"| node_bcrypt
node_user_model -->|"persists user records"| node_mongo

click node_home_public "https://github.com/kurtuson92-web/e-lista/blob/main/public/home.js"
click node_home_root "https://github.com/kurtuson92-web/e-lista/blob/main/home.js"
click node_dashboard_public "https://github.com/kurtuson92-web/e-lista/blob/main/public/dashboard.js"
click node_dashboard_root "https://github.com/kurtuson92-web/e-lista/blob/main/dashboard.js"
click node_server "https://github.com/kurtuson92-web/e-lista/blob/main/index.js"
click node_account_auth "https://github.com/kurtuson92-web/e-lista/blob/main/index.js"
click node_account_recovery "https://github.com/kurtuson92-web/e-lista/blob/main/index.js"
click node_account_profile "https://github.com/kurtuson92-web/e-lista/blob/main/index.js"
click node_credit_api "https://github.com/kurtuson92-web/e-lista/blob/main/index.js"
click node_user_model "https://github.com/kurtuson92-web/e-lista/blob/main/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_home_public,node_home_root,node_dashboard_public,node_dashboard_root,node_user toneBlue
class node_server,node_account_auth,node_account_recovery,node_account_profile,node_bcrypt toneAmber
class node_credit_api toneMint
class node_user_model,node_mongo toneRose
```

## Components

### Browser clients

- [Home client](https://github.com/kurtuson92-web/e-lista/blob/main/public/home.js): `public/home.js`
- [Root home client](https://github.com/kurtuson92-web/e-lista/blob/main/home.js): `home.js`
- [Dashboard client](https://github.com/kurtuson92-web/e-lista/blob/main/public/dashboard.js): `public/dashboard.js`
- [Root dashboard client](https://github.com/kurtuson92-web/e-lista/blob/main/dashboard.js): `dashboard.js`

### Account services

- [HTTP server](https://github.com/kurtuson92-web/e-lista/blob/main/index.js): `index.js`
- [Signup and login](https://github.com/kurtuson92-web/e-lista/blob/main/index.js): `index.js`
- [Password recovery](https://github.com/kurtuson92-web/e-lista/blob/main/index.js): `index.js`
- [Profile management](https://github.com/kurtuson92-web/e-lista/blob/main/index.js): `index.js`
- **bcrypt**

### Credit ledger

- [Credit operations](https://github.com/kurtuson92-web/e-lista/blob/main/index.js): `index.js`

### Persistence

- [User and credits](https://github.com/kurtuson92-web/e-lista/blob/main/index.js): `index.js`
- **MongoDB**

### Other components

- **User**

## Connections

- User → Home client: uses (evidence: `public/home.js`)
- User → Root home client: uses (evidence: `home.js`)
- Home client → HTTP server: submits auth requests (evidence: `public/home.js`)
- Root home client → HTTP server: submits auth requests (evidence: `home.js`)
- User → Dashboard client: uses (evidence: `public/dashboard.js`)
- User → Root dashboard client: uses (evidence: `dashboard.js`)
- Dashboard client → HTTP server: sends account and credit requests (evidence: `public/dashboard.js`)
- Root dashboard client → HTTP server: sends account and credit requests (evidence: `dashboard.js`)
- HTTP server → Signup and login: routes signup and login (evidence: `index.js`)
- HTTP server → Password recovery: routes password resets (evidence: `index.js`)
- HTTP server → Profile management: routes profile updates (evidence: `index.js`)
- HTTP server → Credit operations: routes credit actions (evidence: `index.js`)
- Signup and login → User and credits: looks up and saves users (evidence: `index.js`)
- Password recovery → User and credits: reads and updates users (evidence: `index.js`)
- Profile management → User and credits: reads and updates users (evidence: `index.js`)
- Credit operations → User and credits: reads and saves credits (evidence: `index.js`)
- Signup and login → bcrypt: hashes and compares (evidence: `index.js`)
- Password recovery → bcrypt: hashes and compares (evidence: `index.js`)
- User and credits → MongoDB: persists user records (evidence: `index.js`)
