How vexolmer/life_dash works
Purpose and entry points
Local FastAPI application that treats an Obsidian vault’s Markdown/YAML notes as the source of truth, synchronizes them into SQLite, and renders analytics/records server-side. Web startup is src/main.py; command-line access is cli.py. Persistent local state is data/db.sqlite.
Application composition
The application is split into content modules with the same layered shape: SQLModel schema, repository, service, transformer, and FastAPI router.
• Books: src/modules/books/models.py, src/modules/books/service.py, src/modules/books/router.py
• Games: src/modules/games/models.py, src/modules/games/service.py, src/modules/games/router.py
• Daily notes, including daily records and time-log relationships: src/modules/daily/models.py, src/modules/daily/service.py, src/modules/daily/router.py
This boundary isolates module-specific note formats, validation, persistence, and analytics.
Synchronization / ETL boundary
Parsing is a one-way import from Obsidian files to the local database; the web UI does not edit source content. src/parser/engine.py scans vault directories and file modification metadata. src/parser/sync.py orchestrates module syncs, decides whether records require update, invokes module transformers, skips invalid inputs, and returns synchronization statistics for the UI.
Module transformers convert frontmatter and Markdown bodies into SQLModel-ready records:
src/modules/books/transformer.py, src/modules/games/transformer.py, and src/modules/daily/transformer.py. The Daily transformer is materially distinct because it regex-parses structured sleep, health, and time-tracking sections and produces parent/child daily-log data.
Persistence and migration model
SQLite is accessed through SQLModel/SQLAlchemy infrastructure in src/core/database.py. Repositories encapsulate queries and upserts rather than exposing database operations to routers:
src/modules/books/repository.py, src/modules/games/repository.py, src/modules/daily/repository.py.
Schema evolution is managed by Alembic under migrations/env.py and migrations/versions/. Daily persistence has the important ownership boundary: a DailyNote and its time logs are synchronized together, supporting replacement/cascade behavior.
Request, analytics, and rendering flow
FastAPI routers call services, which obtain records through repositories and compute presentation-ready metrics such as filters, aggregates, reading/game progress, ISO-week calculations, and daily averages. Routes render Jinja templates rather than serving a separate frontend API. The shared landing/dashboard route is src/web/router.py; module pages are rooted in their module routers.
Templates establish the presentation boundary:
src/web/templates/layout.html,
src/web/templates/pages/books/,
src/web/templates/pages/daily/, and
src/web/templates/pages/games/.
HTMX enables partial interactions such as sync reporting via src/web/templates/components/sync_report.html.
Core runtime infrastructure
Configuration, including vault/database paths, is centralized in src/core/config.py; logging is configured in src/core/logger.py; dashboard/statistical caching is in src/core/cache.py. Operational failures during parsing are intended to be logged while malformed files are excluded from persistence. Shared base CRUD behavior resides in src/common/base.py.
External technologies and boundaries
Runtime dependencies are FastAPI, SQLModel with local SQLite, Pydantic Settings, python-frontmatter, and Loguru. The UI is server-rendered Jinja2 with HTMX and static styling in src/web/static/css/style.css; browser-side charts use Chart.js. Obsidian vault files are the upstream external data source; no separate database server or write-back integration is implied. scripts/mass_update_daily_notes.py is an offline vault-maintenance utility, outside the application request path.
Main entry points: router.py FastAPI routes · sync.py Sync orchestrator · database.py SQLite database · engine.py Vault scanner
Components 20
Entry Points
- FastAPI startup
src/main.py - CLI
cli.py
Vault Synchronization
- Obsidian vault · Authoritative content source.
- Vault scanner · Scans note directories and modification metadata.
src/parser/engine.py - Sync orchestrator · Determines updates, skips invalid files, and returns sync statistics.
src/parser/sync.py
Content Modules
- Books transformer
src/modules/books/transformer.py - Games transformer
src/modules/games/transformer.py - Daily transformer · Parses structured health, sleep, and time-log sections into parent/child data.
src/modules/daily/transformer.py - Books module · Provides book validation, persistence, progress, and analytics.
src/modules/books/models.py - Games module · Provides game validation, persistence, progress, and analytics.
src/modules/games/models.py - Daily module · Owns DailyNote and time-log replacement/cascade persistence.
src/modules/daily/models.py
Platform
- Configuration · Centralizes vault and database paths.
src/core/config.py - SQLite database · Local synchronized application state.
src/core/database.py - Local database file
data/db.sqlite - Alembic migrations
migrations/env.py - Operational logging · Records parser failures while malformed files are excluded.
src/core/logger.py - Dashboard cache
src/core/cache.py
Server Rendering
- FastAPI routes · Dashboard plus books, games, and daily page routes.
src/web/router.py - Jinja templates · Includes module pages and HTMX sync-report partials.
src/web/templates/layout.html - Browser UI · Renders server pages, partial updates, and charts.
src/web/static/css/style.css
Connections 25
- FastAPI startup → FastAPI routes: serves
- CLI → Sync orchestrator: runs sync
- Configuration → Vault scanner: vault path
- Configuration → SQLite database: database path
- Obsidian vault → Vault scanner: scan notes
- Vault scanner → Sync orchestrator: file metadata
- Sync orchestrator → Books transformer: book notes
- Sync orchestrator → Games transformer: game notes
- Sync orchestrator → Daily transformer: daily notes
- Books transformer → Books module: records
- Games transformer → Games module: records
- Daily transformer → Daily module: daily notes and logs
- Sync orchestrator → Operational logging: invalid input failures
- Books module → SQLite database: repository upserts and queries
- Games module → SQLite database: repository upserts and queries
- Daily module → SQLite database: cascade replacement
- SQLite database → Local database file: persists
- Alembic migrations → SQLite database: evolves schema
- FastAPI routes → Books module: book analytics
- FastAPI routes → Games module: game analytics
- FastAPI routes → Daily module: daily analytics
- FastAPI routes → Sync orchestrator: sync action
- FastAPI routes → Dashboard cache: dashboard statistics
- FastAPI routes → Jinja templates: render context
- Jinja templates → Browser UI: HTML and HTMX partials