# marufff101/taped architecture

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

- Interactive diagram: https://gitdiagram.com/marufff101/taped
- Repository: https://github.com/marufff101/taped

## Overview

Taped is a typing-practice site whose main workflow is practicing a test, recording its performance and mistakes, then using account history and weak-key statistics to guide further practice. The browser app also supports sign-in, comments, updates, and a host dashboard. Express routes handle account, test, profile, social, and host operations against SQLite; verification codes can be sent through SMTP. The supplied excerpts show the server wiring and several route implementations, but not the full browser app or all route implementations, so some browser-to-feature links rely on README-documented capabilities.

Main entry points: [`server/index.js`](https://github.com/marufff101/taped/blob/main/server/index.js) (Express entry), [`server/db.js`](https://github.com/marufff101/taped/blob/main/server/db.js) (Taped database), [`public/js/app.js`](https://github.com/marufff101/taped/blob/main/public/js/app.js) (Typing app), [`server/routes/auth.js`](https://github.com/marufff101/taped/blob/main/server/routes/auth.js) (Account flows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Practice experience"]
  node_browser["Typing app<br/>[app.js]"]
  node_web["Page shell<br/>[index.html]"]
end

subgraph group_service["Web service"]
  node_server["Express entry<br/>[index.js]"]
  node_config["Runtime config<br/>[config.js]"]
  node_tests["Test recording<br/>[tests.js]"]
  node_profile["Stats and history<br/>[profile.js]"]
  node_social["Comments and updates<br/>[social.js]"]
  node_admin["Host dashboard<br/>[admin.js]"]
end

subgraph group_identity["Accounts and identity"]
  node_authmw["Session middleware<br/>[auth.js]"]
  node_authroutes["Account flows<br/>[auth.js]"]
  node_mailer["Verification mail<br/>[mailer.js]"]
end

subgraph group_data["Persistence and messaging"]
  node_sqlite[("Taped database<br/>[db.js]")]
  node_smtp["SMTP service"]
end

node_member(("Member or guest"))

node_member -->|"practices and views"| node_browser
node_browser -.->|"renders within"| node_web
node_browser -->|"uses documented API"| node_server
node_server -->|"loads settings"| node_config
node_server -->|"attaches user"| node_authmw
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_tests
node_server -->|"mounts routes"| node_profile
node_server -->|"mounts routes"| node_admin
node_server -->|"mounts routes"| node_social
node_authroutes -->|"sends codes"| node_mailer
node_mailer -->|"sends email"| node_smtp
node_authroutes -->|"reads and writes"| node_sqlite
node_tests -->|"stores tests and mistakes"| node_sqlite
node_profile -->|"reads stats and history"| node_sqlite
node_social -->|"reads and writes posts"| node_sqlite
node_admin -->|"reads and manages members"| node_sqlite
node_authmw -->|"looks up session user"| node_sqlite

click node_browser "https://github.com/marufff101/taped/blob/main/public/js/app.js"
click node_web "https://github.com/marufff101/taped/blob/main/public/index.html"
click node_server "https://github.com/marufff101/taped/blob/main/server/index.js"
click node_config "https://github.com/marufff101/taped/blob/main/server/config.js"
click node_authmw "https://github.com/marufff101/taped/blob/main/server/auth.js"
click node_authroutes "https://github.com/marufff101/taped/blob/main/server/routes/auth.js"
click node_mailer "https://github.com/marufff101/taped/blob/main/server/mailer.js"
click node_tests "https://github.com/marufff101/taped/blob/main/server/routes/tests.js"
click node_profile "https://github.com/marufff101/taped/blob/main/server/routes/profile.js"
click node_social "https://github.com/marufff101/taped/blob/main/server/routes/social.js"
click node_admin "https://github.com/marufff101/taped/blob/main/server/routes/admin.js"
click node_sqlite "https://github.com/marufff101/taped/blob/main/server/db.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,node_web toneBlue
class node_server,node_config,node_tests,node_profile,node_social,node_admin toneAmber
class node_authmw,node_authroutes,node_mailer toneMint
class node_sqlite,node_smtp toneRose
class node_member toneIndigo
```

## Components

### Practice experience

- [Typing app](https://github.com/marufff101/taped/blob/main/public/js/app.js): `public/js/app.js`
- [Page shell](https://github.com/marufff101/taped/blob/main/public/index.html): `public/index.html`

### Web service

- [Express entry](https://github.com/marufff101/taped/blob/main/server/index.js): `server/index.js`
- [Runtime config](https://github.com/marufff101/taped/blob/main/server/config.js): `server/config.js`
- [Test recording](https://github.com/marufff101/taped/blob/main/server/routes/tests.js): `server/routes/tests.js`
- [Stats and history](https://github.com/marufff101/taped/blob/main/server/routes/profile.js): `server/routes/profile.js`
- [Comments and updates](https://github.com/marufff101/taped/blob/main/server/routes/social.js): `server/routes/social.js`
- [Host dashboard](https://github.com/marufff101/taped/blob/main/server/routes/admin.js): `server/routes/admin.js`

### Accounts and identity

- [Session middleware](https://github.com/marufff101/taped/blob/main/server/auth.js): `server/auth.js`
- [Account flows](https://github.com/marufff101/taped/blob/main/server/routes/auth.js): `server/routes/auth.js`
- [Verification mail](https://github.com/marufff101/taped/blob/main/server/mailer.js): `server/mailer.js`

### Persistence and messaging

- [Taped database](https://github.com/marufff101/taped/blob/main/server/db.js): `server/db.js`
- **SMTP service**

### Other components

- **Member or guest**

## Connections

- Member or guest → Typing app: practices and views (evidence: `README.md`)
- Typing app → Page shell: renders within
- Typing app → Express entry: uses documented API (evidence: `README.md`)
- Express entry → Runtime config: loads settings (evidence: `server/index.js`)
- Express entry → Session middleware: attaches user (evidence: `server/index.js`)
- Express entry → Account flows: mounts routes (evidence: `server/index.js`)
- Express entry → Test recording: mounts routes (evidence: `server/index.js`)
- Express entry → Stats and history: mounts routes (evidence: `server/index.js`)
- Express entry → Host dashboard: mounts routes (evidence: `server/index.js`)
- Express entry → Comments and updates: mounts routes (evidence: `server/index.js`)
- Account flows → Verification mail: sends codes (evidence: `server/routes/auth.js`)
- Verification mail → SMTP service: sends email (evidence: `server/mailer.js`)
- Account flows → Taped database: reads and writes (evidence: `server/routes/auth.js`)
- Test recording → Taped database: stores tests and mistakes (evidence: `server/routes/tests.js`)
- Stats and history → Taped database: reads stats and history (evidence: `server/routes/profile.js`)
- Comments and updates → Taped database: reads and writes posts (evidence: `server/routes/social.js`)
- Host dashboard → Taped database: reads and manages members (evidence: `server/routes/admin.js`)
- Session middleware → Taped database: looks up session user (evidence: `server/auth.js`)
