# Life OS - Comprehensive System Design Document **Version:** 1.0 **Date:** 2026-03-02 **Purpose:** Complete rebuild reference. Contains everything needed to reconstruct this system from ground zero. --- # Part 1: System Overview ## 1. Project Identity & Purpose Life OS is a **single-user personal productivity web application**. It is a unified system for managing every dimension of personal productivity: tasks, projects, notes, contacts, meetings, decisions, time tracking, file management, and more. **Design Philosophy:** - **KISS.** Simple wins. Complexity must earn its place. - **Logical deletes everywhere.** No data permanently destroyed without admin confirmation. - **Generic over specific.** Shared base code. Config-driven where possible. - **Consistent patterns.** Every list, form, detail view follows identical conventions. - **Search is first-class.** Every entity gets PostgreSQL full-text search via tsvector/tsquery. - **Context travels with navigation.** Drill-down pre-fills context into create forms. - **Single source of truth.** One system for everything. **Live URL:** `https://lifeos-dev.invixiom.com` **Server:** defiant-01, 46.225.166.142, Ubuntu 24.04 **Repository:** `github.com/mdombaugh/lifeos-dev` (main branch) --- ## 2. Architecture Overview Life OS is a **server-rendered monolith**. There is no SPA, no frontend framework, and no build pipeline. **Key Architectural Decisions:** | Decision | Choice | Rationale | |----------|--------|-----------| | Rendering | Server-side (Jinja2) | Simplicity; no JS framework to maintain | | Data mutations | HTML form POST with 303 redirect (PRG) | Standard web pattern; no XHR/fetch for data ops | | JavaScript role | UI state only (sidebar, search, timer, theme) | Minimal client JS; zero fetch for data changes | | ORM | None. Raw SQL via `text()` | Full control; no migration tooling needed | | CRUD abstraction | Generic BaseRepository class | One class handles all 48 tables | | Deletion | Soft delete everywhere | `is_deleted` + `deleted_at`; admin trash for recovery | | Search | PostgreSQL tsvector/tsquery | Built-in, no external search service | | Authentication | None (single user) | Phase 3 roadmap item | | CSRF | None (single user) | Not needed for single-user system | **Request Flow:** ``` Browser → Nginx (SSL termination) → Docker container (uvicorn) → FastAPI router → BaseRepository / raw SQL → PostgreSQL → Jinja2 template → HTML response ``` **Data Mutation Flow (PRG Pattern):** ``` Browser submits HTML