# reverie/yourworldoftext architecture

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

- Interactive diagram: https://gitdiagram.com/reverie/yourworldoftext
- Repository: https://github.com/reverie/yourworldoftext

## Overview

Your World of Text is a Django application for viewing and collaboratively editing large character worlds, with accounts, access controls, and world-specific features. The main workflow is a browser client polling for tile updates and submitting edits; server views enforce permissions and read or update lazily created 8×16 tiles. Configuration and tile properties support protected areas and links. The README documents client polling, while the sampled views show update, edit, configuration, and protection behavior. Some client/server details and unsampled routes are represented only where explicitly documented.

Main entry points: [`ywot/views.py`](https://github.com/reverie/yourworldoftext/blob/master/ywot/views.py) (World views), [`ywot/models.py`](https://github.com/reverie/yourworldoftext/blob/master/ywot/models.py) (Character tiles), [`static/yourworld.js`](https://github.com/reverie/yourworldoftext/blob/master/static/yourworld.js) (World editor), [`urls.py`](https://github.com/reverie/yourworldoftext/blob/master/urls.py) (URL routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser experience"]
  node_client["World editor<br/>[yourworld.js]"]
  node_templates["Page templates"]
end

subgraph group_web["Django web layer"]
  node_routes["URL routes<br/>[urls.py]"]
  node_views["World views<br/>[views.py]"]
end

subgraph group_domain["World domain"]
  node_permissions["Access rules<br/>[permissions.py]"]
  node_worlds["Worlds<br/>[models.py]"]
  node_tiles["Character tiles<br/>[models.py]"]
  node_edits["Edit history<br/>[models.py]"]
  node_membership["World membership<br/>[models.py]"]
end

subgraph group_runtime["Runtime configuration"]
  node_database[("Application database")]
  node_settings["Django settings<br/>[settings.py]"]
  node_helpers["Request helpers<br/>[helpers.py]"]
end

node_user(("World visitor"))

node_user -->|"edits world"| node_client
node_client -->|"polls and submits"| node_views
node_routes -->|"routes requests"| node_views
node_views -->|"renders pages"| node_templates
node_views -->|"checks access"| node_permissions
node_views -->|"loads and configures"| node_worlds
node_views -->|"reads and edits"| node_tiles
node_views -->|"manages membership"| node_membership
node_tiles -.->|"records changes"| node_edits
node_settings -->|"configures store"| node_database
node_worlds -.->|"persists worlds"| node_database
node_tiles -.->|"persists tiles"| node_database
node_edits -.->|"persists history"| node_database
node_membership -.->|"persists membership"| node_database
node_views -->|"renders with"| node_helpers

click node_client "https://github.com/reverie/yourworldoftext/blob/master/static/yourworld.js"
click node_templates "https://github.com/reverie/yourworldoftext/tree/master/templates"
click node_routes "https://github.com/reverie/yourworldoftext/blob/master/urls.py"
click node_views "https://github.com/reverie/yourworldoftext/blob/master/ywot/views.py"
click node_permissions "https://github.com/reverie/yourworldoftext/blob/master/ywot/permissions.py"
click node_worlds "https://github.com/reverie/yourworldoftext/blob/master/ywot/models.py"
click node_tiles "https://github.com/reverie/yourworldoftext/blob/master/ywot/models.py"
click node_edits "https://github.com/reverie/yourworldoftext/blob/master/ywot/models.py"
click node_membership "https://github.com/reverie/yourworldoftext/blob/master/ywot/models.py"
click node_settings "https://github.com/reverie/yourworldoftext/blob/master/settings.py"
click node_helpers "https://github.com/reverie/yourworldoftext/blob/master/helpers.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_client,node_templates toneBlue
class node_routes,node_views toneAmber
class node_permissions,node_worlds,node_tiles,node_edits,node_membership toneMint
class node_database,node_settings,node_helpers toneRose
class node_user toneIndigo
```

## Components

### Browser experience

- [World editor](https://github.com/reverie/yourworldoftext/blob/master/static/yourworld.js): `static/yourworld.js`
- [Page templates](https://github.com/reverie/yourworldoftext/tree/master/templates): `templates`

### Django web layer

- [URL routes](https://github.com/reverie/yourworldoftext/blob/master/urls.py): `urls.py`
- [World views](https://github.com/reverie/yourworldoftext/blob/master/ywot/views.py): `ywot/views.py`

### World domain

- [Access rules](https://github.com/reverie/yourworldoftext/blob/master/ywot/permissions.py): `ywot/permissions.py`
- [Worlds](https://github.com/reverie/yourworldoftext/blob/master/ywot/models.py): `ywot/models.py`
- [Character tiles](https://github.com/reverie/yourworldoftext/blob/master/ywot/models.py): `ywot/models.py`
- [Edit history](https://github.com/reverie/yourworldoftext/blob/master/ywot/models.py): `ywot/models.py`
- [World membership](https://github.com/reverie/yourworldoftext/blob/master/ywot/models.py): `ywot/models.py`

### Runtime configuration

- **Application database**
- [Django settings](https://github.com/reverie/yourworldoftext/blob/master/settings.py): `settings.py`
- [Request helpers](https://github.com/reverie/yourworldoftext/blob/master/helpers.py): `helpers.py`

### Other components

- **World visitor**

## Connections

- World visitor → World editor: edits world (evidence: `README`)
- World editor → World views: polls and submits (evidence: `README`)
- URL routes → World views: routes requests (evidence: `urls.py`)
- World views → Page templates: renders pages (evidence: `ywot/views.py`)
- World views → Access rules: checks access (evidence: `ywot/views.py`)
- World views → Worlds: loads and configures (evidence: `ywot/views.py`)
- World views → Character tiles: reads and edits (evidence: `ywot/views.py`)
- World views → World membership: manages membership (evidence: `ywot/views.py`)
- Character tiles → Edit history: records changes (evidence: `ywot/models.py`)
- Django settings → Application database: configures store (evidence: `settings.py`)
- Worlds → Application database: persists worlds
- Character tiles → Application database: persists tiles
- Edit history → Application database: persists history
- World membership → Application database: persists membership
- World views → Request helpers: renders with (evidence: `ywot/views.py`)
