# gyalzin/reflections architecture

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

- Interactive diagram: https://gitdiagram.com/gyalzin/reflections
- Repository: https://github.com/gyalzin/reflections

## Overview

Reflections is a single-user Flask activity tracker. A user opens a day timeline, adds or edits an activity with times and optional mood and notes, and the app validates and persists it before showing the timeline. The timeline supports day navigation and side-by-side display of overlapping entries. The sampled routes and database module establish the main request and persistence flow; several presentation details and capabilities are documented in the README but their implementation is not fully sampled.

Main entry points: [`main.py`](https://github.com/gyalzin/reflections/blob/main/main.py) (Flask routes), [`db.py`](https://github.com/gyalzin/reflections/blob/main/db.py) (Database operations), [`templates/index.html`](https://github.com/gyalzin/reflections/blob/main/templates/index.html) (Timeline view), [`templates/edit.html`](https://github.com/gyalzin/reflections/blob/main/templates/edit.html) (Edit view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_flask["Flask routes<br/>[main.py]"]
  node_entry_ops["Entry operations<br/>[main.py]"]
  node_timeline["Day timeline<br/>[main.py]"]
  node_layout["Overlap layout<br/>[main.py]"]
end

subgraph group_views["User interface"]
  node_index_view["Timeline view<br/>[index.html]"]
  node_edit_view["Edit view<br/>[edit.html]"]
  node_mood_view["Mood choices<br/>[mood.html]"]
  node_styles["Styles<br/>[style.css]"]
end

subgraph group_storage["Persistence"]
  node_db_ops["Database operations<br/>[db.py]"]
  node_schema["Table definitions<br/>[schema.sql]"]
  node_sqlite[("SQLite database")]
end

node_user(("User"))
node_browser(("Web browser"))

node_user -->|"uses"| node_browser
node_browser -->|"requests pages"| node_flask
node_flask -->|"routes actions"| node_entry_ops
node_flask -->|"renders day"| node_timeline
node_entry_ops -->|"reads and writes"| node_db_ops
node_timeline -->|"loads entries"| node_db_ops
node_timeline -.->|"lays out entries"| node_layout
node_timeline -->|"renders"| node_index_view
node_flask -->|"renders edit form"| node_edit_view
node_index_view -.->|"styled by"| node_styles
node_edit_view -.->|"uses mood choices"| node_mood_view
node_db_ops -->|"queries and updates"| node_sqlite
node_db_ops -->|"loads schema"| node_schema

click node_flask "https://github.com/gyalzin/reflections/blob/main/main.py"
click node_entry_ops "https://github.com/gyalzin/reflections/blob/main/main.py"
click node_timeline "https://github.com/gyalzin/reflections/blob/main/main.py"
click node_layout "https://github.com/gyalzin/reflections/blob/main/main.py"
click node_index_view "https://github.com/gyalzin/reflections/blob/main/templates/index.html"
click node_edit_view "https://github.com/gyalzin/reflections/blob/main/templates/edit.html"
click node_mood_view "https://github.com/gyalzin/reflections/blob/main/templates/mood.html"
click node_styles "https://github.com/gyalzin/reflections/blob/main/static/style.css"
click node_db_ops "https://github.com/gyalzin/reflections/blob/main/db.py"
click node_schema "https://github.com/gyalzin/reflections/blob/main/schema.sql"

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_flask,node_entry_ops,node_timeline,node_layout,node_user,node_browser toneBlue
class node_index_view,node_edit_view,node_mood_view,node_styles toneAmber
class node_db_ops,node_schema,node_sqlite toneMint
```

## Components

### Web application

- [Flask routes](https://github.com/gyalzin/reflections/blob/main/main.py): `main.py`
- [Entry operations](https://github.com/gyalzin/reflections/blob/main/main.py): `main.py`
- [Day timeline](https://github.com/gyalzin/reflections/blob/main/main.py): `main.py`
- [Overlap layout](https://github.com/gyalzin/reflections/blob/main/main.py): `main.py`

### User interface

- [Timeline view](https://github.com/gyalzin/reflections/blob/main/templates/index.html): `templates/index.html`
- [Edit view](https://github.com/gyalzin/reflections/blob/main/templates/edit.html): `templates/edit.html`
- [Mood choices](https://github.com/gyalzin/reflections/blob/main/templates/mood.html): `templates/mood.html`
- [Styles](https://github.com/gyalzin/reflections/blob/main/static/style.css): `static/style.css`

### Persistence

- [Database operations](https://github.com/gyalzin/reflections/blob/main/db.py): `db.py`
- [Table definitions](https://github.com/gyalzin/reflections/blob/main/schema.sql): `schema.sql`
- **SQLite database**

### Other components

- **User**
- **Web browser**

## Connections

- User → Web browser: uses (evidence: `README.md`)
- Web browser → Flask routes: requests pages (evidence: `README.md`)
- Flask routes → Entry operations: routes actions (evidence: `main.py`)
- Flask routes → Day timeline: renders day (evidence: `main.py`)
- Entry operations → Database operations: reads and writes (evidence: `main.py`)
- Day timeline → Database operations: loads entries (evidence: `main.py`)
- Day timeline → Overlap layout: lays out entries (evidence: `main.py`)
- Day timeline → Timeline view: renders (evidence: `main.py`)
- Flask routes → Edit view: renders edit form (evidence: `main.py`)
- Timeline view → Styles: styled by
- Edit view → Mood choices: uses mood choices
- Database operations → SQLite database: queries and updates (evidence: `db.py`)
- Database operations → Table definitions: loads schema (evidence: `db.py`)
