# udyalakvivek/notepad architecture

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

- Interactive diagram: https://gitdiagram.com/udyalakvivek/notepad
- Repository: https://github.com/udyalakvivek/notepad

## Overview

Personal Paste is a no-login Django notepad: a visitor creates a random-link note, edits it in the browser with autosave and polling, and can optionally protect it with a password, restore history, and manage one attachment. The graph follows routing into view handlers and their model-backed operations, with the browser editor as the API client. README documents several editor capabilities and attachment expiry whose full implementations were not sampled; those links are shown only where the excerpts or README support them.

Main entry points: [`myapp/urls.py`](https://github.com/udyalakvivek/notepad/blob/main/myapp/urls.py) (URL routing), [`myapp/models.py`](https://github.com/udyalakvivek/notepad/blob/main/myapp/models.py) (Notes), [`myapp/static/myapp/note.js`](https://github.com/udyalakvivek/notepad/blob/main/myapp/static/myapp/note.js) (Editor client), [`myapp/views.py`](https://github.com/udyalakvivek/notepad/blob/main/myapp/views.py) (Content autosave)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_note_js["Editor client<br/>[note.js]"]
  node_note_template["Editor page<br/>[note.html]"]
  node_note_css["Themes and styles<br/>[note.css]"]
end

subgraph group_app["Note application"]
  node_routes["URL routing<br/>[urls.py]"]
  node_note_views["Note handlers<br/>[views.py]"]
  node_creation["Link creation<br/>[views.py]"]
  node_note_api["Content autosave<br/>[views.py]"]
  node_password["Password access<br/>[views.py]"]
  node_history["Version history<br/>[views.py]"]
  node_attachments["Attachment management<br/>[views.py]"]
end

subgraph group_state["Persistence"]
  node_notes[("Notes<br/>[models.py]")]
  node_versions[("Note history<br/>[models.py]")]
  node_file_store[("Uploaded files<br/>[models.py]")]
end

node_visitor(("Visitor"))
node_django_db[("Configured database")]

node_visitor -->|"opens routes"| node_routes
node_routes -->|"routes root"| node_creation
node_routes -->|"routes note page"| node_note_views
node_routes -->|"routes content API"| node_note_api
node_routes -->|"routes access API"| node_password
node_routes -->|"routes history API"| node_history
node_routes -->|"routes file APIs"| node_attachments
node_creation -->|"creates note"| node_notes
node_note_views -->|"loads note"| node_notes
node_note_views -->|"renders editor"| node_note_template
node_note_template -->|"loads client"| node_note_js
node_note_template -->|"uses styles"| node_note_css
node_note_js -->|"saves and polls"| node_note_api
node_note_api -->|"reads and updates"| node_notes
node_note_api -->|"snapshots changes"| node_history
node_history -->|"reads and writes"| node_versions
node_note_js -->|"sets and unlocks"| node_password
node_password -->|"reads and updates"| node_notes
node_note_js -->|"loads and restores"| node_history
node_note_js -->|"uploads and deletes"| node_attachments
node_attachments -->|"updates metadata"| node_notes
node_attachments -->|"stores attachment"| node_file_store
node_notes -.->|"persists records"| node_django_db
node_versions -.->|"persists versions"| node_django_db

click node_routes "https://github.com/udyalakvivek/notepad/blob/main/myapp/urls.py"
click node_note_js "https://github.com/udyalakvivek/notepad/blob/main/myapp/static/myapp/note.js"
click node_note_template "https://github.com/udyalakvivek/notepad/blob/main/myapp/templates/myapp/note.html"
click node_note_css "https://github.com/udyalakvivek/notepad/blob/main/myapp/static/myapp/note.css"
click node_note_views "https://github.com/udyalakvivek/notepad/blob/main/myapp/views.py"
click node_creation "https://github.com/udyalakvivek/notepad/blob/main/myapp/views.py"
click node_note_api "https://github.com/udyalakvivek/notepad/blob/main/myapp/views.py"
click node_password "https://github.com/udyalakvivek/notepad/blob/main/myapp/views.py"
click node_history "https://github.com/udyalakvivek/notepad/blob/main/myapp/views.py"
click node_attachments "https://github.com/udyalakvivek/notepad/blob/main/myapp/views.py"
click node_notes "https://github.com/udyalakvivek/notepad/blob/main/myapp/models.py"
click node_versions "https://github.com/udyalakvivek/notepad/blob/main/myapp/models.py"
click node_file_store "https://github.com/udyalakvivek/notepad/blob/main/myapp/models.py"

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_note_js,node_note_template,node_note_css toneBlue
class node_routes,node_note_views,node_creation,node_note_api,node_password,node_history,node_attachments,node_django_db toneAmber
class node_notes,node_versions,node_file_store toneMint
class node_visitor toneIndigo
```

## Components

### Web interface

- [Editor client](https://github.com/udyalakvivek/notepad/blob/main/myapp/static/myapp/note.js): `myapp/static/myapp/note.js`
- [Editor page](https://github.com/udyalakvivek/notepad/blob/main/myapp/templates/myapp/note.html): `myapp/templates/myapp/note.html`
- [Themes and styles](https://github.com/udyalakvivek/notepad/blob/main/myapp/static/myapp/note.css): `myapp/static/myapp/note.css`

### Note application

- [URL routing](https://github.com/udyalakvivek/notepad/blob/main/myapp/urls.py): `myapp/urls.py`
- [Note handlers](https://github.com/udyalakvivek/notepad/blob/main/myapp/views.py): `myapp/views.py`
- [Link creation](https://github.com/udyalakvivek/notepad/blob/main/myapp/views.py): `myapp/views.py`
- [Content autosave](https://github.com/udyalakvivek/notepad/blob/main/myapp/views.py): `myapp/views.py`
- [Password access](https://github.com/udyalakvivek/notepad/blob/main/myapp/views.py): `myapp/views.py`
- [Version history](https://github.com/udyalakvivek/notepad/blob/main/myapp/views.py): `myapp/views.py`
- [Attachment management](https://github.com/udyalakvivek/notepad/blob/main/myapp/views.py): `myapp/views.py`

### Persistence

- [Notes](https://github.com/udyalakvivek/notepad/blob/main/myapp/models.py): `myapp/models.py`
- [Note history](https://github.com/udyalakvivek/notepad/blob/main/myapp/models.py): `myapp/models.py`
- [Uploaded files](https://github.com/udyalakvivek/notepad/blob/main/myapp/models.py): `myapp/models.py`

### Other components

- **Visitor**
- **Configured database**

## Connections

- Visitor → URL routing: opens routes (evidence: `README.md`)
- URL routing → Link creation: routes root (evidence: `myapp/urls.py`)
- URL routing → Note handlers: routes note page (evidence: `myapp/urls.py`)
- URL routing → Content autosave: routes content API (evidence: `myapp/urls.py`)
- URL routing → Password access: routes access API (evidence: `myapp/urls.py`)
- URL routing → Version history: routes history API (evidence: `myapp/urls.py`)
- URL routing → Attachment management: routes file APIs (evidence: `myapp/urls.py`)
- Link creation → Notes: creates note (evidence: `myapp/views.py`)
- Note handlers → Notes: loads note (evidence: `myapp/views.py`)
- Note handlers → Editor page: renders editor (evidence: `README.md`)
- Editor page → Editor client: loads client (evidence: `README.md`)
- Editor page → Themes and styles: uses styles (evidence: `README.md`)
- Editor client → Content autosave: saves and polls (evidence: `README.md`)
- Content autosave → Notes: reads and updates (evidence: `myapp/views.py`)
- Content autosave → Version history: snapshots changes (evidence: `myapp/views.py`)
- Version history → Note history: reads and writes (evidence: `myapp/views.py`)
- Editor client → Password access: sets and unlocks (evidence: `myapp/static/myapp/note.js`)
- Password access → Notes: reads and updates (evidence: `myapp/views.py`)
- Editor client → Version history: loads and restores (evidence: `README.md`)
- Editor client → Attachment management: uploads and deletes (evidence: `myapp/static/myapp/note.js`)
- Attachment management → Notes: updates metadata (evidence: `myapp/views.py`)
- Attachment management → Uploaded files: stores attachment (evidence: `myapp/models.py`)
- Notes → Configured database: persists records
- Note history → Configured database: persists versions
