# shaeekhkushal/lifeos architecture

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

- Interactive diagram: https://gitdiagram.com/shaeekhkushal/lifeos
- Repository: https://github.com/shaeekhkushal/lifeos

## Overview

LifeOS is a local-first personal tracking app: users sign in, navigate a workspace, record and review life data, and persist it in a project-local SQLite database. The documented flow runs from the workspace through domain operations and a client cache/HTTP adapter to authenticated API handlers and per-user storage. The README documents major product areas not fully shown in sampled source; those branches are included, but their internal call paths are not inferred beyond documented relationships.

Main entry points: [`lifeos-app/src/app/page.tsx`](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/app/page.tsx) (Workspace navigation), [`lifeos-app/src/lib/data-service.ts`](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/lib/data-service.ts) (Domain operations), [`lifeos-app/src/app/api/auth/route.ts`](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/app/api/auth/route.ts) (Authentication API), [`lifeos-app/src/components/ModuleView.tsx`](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/ModuleView.tsx) (Configured tracking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace"]
  node_workspace["Workspace navigation<br/>[page.tsx]"]
  node_authui["Sign-in screens<br/>[AuthView.tsx]"]
end

subgraph group_domains["Tracking domains"]
  node_overview["Overview dashboard<br/>[FeatureViews.tsx]"]
  node_finance["Finance tracking<br/>[FeatureViews.tsx]"]
  node_habits["Habit tracking<br/>[FeatureViews.tsx]"]
  node_goals["Goal tracking<br/>[FeatureViews.tsx]"]
  node_tasks["Task tracking<br/>[FeatureViews.tsx]"]
  node_modules["Configured tracking<br/>[ModuleView.tsx]"]
  node_reports["Tracking reports<br/>[ModuleView.tsx]"]
  node_settings["Profile and settings<br/>[FeatureViews.tsx]"]
end

subgraph group_services["Application services"]
  node_domainops["Domain operations<br/>[data-service.ts]"]
  node_cache["Client cache<br/>[storage.ts]"]
  node_types["Record types<br/>[types.ts]"]
  node_utils["Date and currency helpers<br/>[utils.ts]"]
end

subgraph group_server["Server and persistence"]
  node_authroute["Authentication API<br/>[route.ts]"]
  node_dataapi["Records API<br/>[route.ts]"]
  node_authservice["Session and password checks<br/>[auth.ts]"]
  node_sqlite[("SQLite records and accounts<br/>[database.ts]")]
end

node_user(("Signed-in user"))

node_user -->|"uses"| node_workspace
node_workspace -->|"renders"| node_authui
node_workspace -->|"restores session"| node_authroute
node_authui -.->|"authenticates"| node_authroute
node_workspace -->|"selects view"| node_overview
node_workspace -->|"selects view"| node_finance
node_workspace -->|"selects view"| node_habits
node_workspace -->|"selects view"| node_goals
node_workspace -->|"selects view"| node_tasks
node_workspace -->|"selects view"| node_modules
node_workspace -->|"selects view"| node_settings
node_overview -->|"reads summaries"| node_domainops
node_finance -->|"uses operations"| node_domainops
node_habits -->|"uses operations"| node_domainops
node_goals -->|"uses operations"| node_domainops
node_tasks -->|"uses operations"| node_domainops
node_modules -.->|"uses operations"| node_domainops
node_modules -->|"renders"| node_reports
node_settings -.->|"uses operations"| node_domainops
node_domainops -->|"reads and writes"| node_cache
node_domainops -->|"uses types"| node_types
node_domainops -->|"uses helpers"| node_utils
node_cache -->|"sends actions"| node_dataapi
node_workspace -->|"loads user data"| node_domainops
node_authroute -->|"checks session"| node_authservice
node_dataapi -->|"checks session"| node_authservice
node_authroute -->|"manages accounts"| node_sqlite
node_dataapi -->|"reads and writes records"| node_sqlite

click node_workspace "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/app/page.tsx"
click node_authui "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/AuthView.tsx"
click node_overview "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/FeatureViews.tsx"
click node_finance "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/FeatureViews.tsx"
click node_habits "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/FeatureViews.tsx"
click node_goals "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/FeatureViews.tsx"
click node_tasks "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/FeatureViews.tsx"
click node_modules "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/ModuleView.tsx"
click node_reports "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/ModuleView.tsx"
click node_settings "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/FeatureViews.tsx"
click node_domainops "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/lib/data-service.ts"
click node_cache "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/lib/storage.ts"
click node_types "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/lib/types.ts"
click node_utils "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/lib/utils.ts"
click node_authroute "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/app/api/auth/route.ts"
click node_dataapi "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/app/api/data/route.ts"
click node_authservice "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/lib/server/auth.ts"
click node_sqlite "https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/lib/server/database.ts"

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_workspace,node_authui,node_user toneBlue
class node_overview,node_finance,node_habits,node_goals,node_tasks,node_modules,node_reports,node_settings toneAmber
class node_domainops,node_cache,node_types,node_utils toneMint
class node_authroute,node_dataapi,node_authservice,node_sqlite toneRose
```

## Components

### Workspace

- [Workspace navigation](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/app/page.tsx): `lifeos-app/src/app/page.tsx`
- [Sign-in screens](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/AuthView.tsx): `lifeos-app/src/components/AuthView.tsx`

### Tracking domains

- [Overview dashboard](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/FeatureViews.tsx): `lifeos-app/src/components/FeatureViews.tsx`
- [Finance tracking](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/FeatureViews.tsx): `lifeos-app/src/components/FeatureViews.tsx`
- [Habit tracking](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/FeatureViews.tsx): `lifeos-app/src/components/FeatureViews.tsx`
- [Goal tracking](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/FeatureViews.tsx): `lifeos-app/src/components/FeatureViews.tsx`
- [Task tracking](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/FeatureViews.tsx): `lifeos-app/src/components/FeatureViews.tsx`
- [Configured tracking](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/ModuleView.tsx): `lifeos-app/src/components/ModuleView.tsx`
- [Tracking reports](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/ModuleView.tsx): `lifeos-app/src/components/ModuleView.tsx`
- [Profile and settings](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/components/FeatureViews.tsx): `lifeos-app/src/components/FeatureViews.tsx`

### Application services

- [Domain operations](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/lib/data-service.ts): `lifeos-app/src/lib/data-service.ts`
- [Client cache](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/lib/storage.ts): `lifeos-app/src/lib/storage.ts`
- [Record types](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/lib/types.ts): `lifeos-app/src/lib/types.ts`
- [Date and currency helpers](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/lib/utils.ts): `lifeos-app/src/lib/utils.ts`

### Server and persistence

- [Authentication API](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/app/api/auth/route.ts): `lifeos-app/src/app/api/auth/route.ts`
- [Records API](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/app/api/data/route.ts): `lifeos-app/src/app/api/data/route.ts`
- [Session and password checks](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/lib/server/auth.ts): `lifeos-app/src/lib/server/auth.ts`
- [SQLite records and accounts](https://github.com/shaeekhkushal/lifeos/blob/main/lifeos-app/src/lib/server/database.ts): `lifeos-app/src/lib/server/database.ts`

### Other components

- **Signed-in user**

## Connections

- Signed-in user → Workspace navigation: uses (evidence: `README.md`)
- Workspace navigation → Sign-in screens: renders (evidence: `lifeos-app/src/app/page.tsx`)
- Workspace navigation → Authentication API: restores session (evidence: `lifeos-app/src/app/page.tsx`)
- Sign-in screens → Authentication API: authenticates
- Workspace navigation → Overview dashboard: selects view (evidence: `lifeos-app/src/app/page.tsx`)
- Workspace navigation → Finance tracking: selects view (evidence: `lifeos-app/src/app/page.tsx`)
- Workspace navigation → Habit tracking: selects view (evidence: `lifeos-app/src/app/page.tsx`)
- Workspace navigation → Goal tracking: selects view (evidence: `lifeos-app/src/app/page.tsx`)
- Workspace navigation → Task tracking: selects view (evidence: `README.md`)
- Workspace navigation → Configured tracking: selects view (evidence: `README.md`)
- Workspace navigation → Profile and settings: selects view (evidence: `README.md`)
- Overview dashboard → Domain operations: reads summaries (evidence: `README.md`)
- Finance tracking → Domain operations: uses operations (evidence: `lifeos-app/src/components/FeatureViews.tsx`)
- Habit tracking → Domain operations: uses operations (evidence: `lifeos-app/src/components/FeatureViews.tsx`)
- Goal tracking → Domain operations: uses operations (evidence: `lifeos-app/src/components/FeatureViews.tsx`)
- Task tracking → Domain operations: uses operations (evidence: `README.md`)
- Configured tracking → Domain operations: uses operations
- Configured tracking → Tracking reports: renders (evidence: `README.md`)
- Profile and settings → Domain operations: uses operations
- Domain operations → Client cache: reads and writes (evidence: `lifeos-app/src/lib/data-service.ts`)
- Domain operations → Record types: uses types (evidence: `lifeos-app/src/lib/data-service.ts`)
- Domain operations → Date and currency helpers: uses helpers (evidence: `lifeos-app/src/lib/data-service.ts`)
- Client cache → Records API: sends actions (evidence: `lifeos-app/src/lib/storage.ts`)
- Workspace navigation → Domain operations: loads user data (evidence: `lifeos-app/src/app/page.tsx`)
- Authentication API → Session and password checks: checks session (evidence: `lifeos-app/src/app/api/auth/route.ts`)
- Records API → Session and password checks: checks session (evidence: `lifeos-app/src/app/api/data/route.ts`)
- Authentication API → SQLite records and accounts: manages accounts (evidence: `lifeos-app/src/app/api/auth/route.ts`)
- Records API → SQLite records and accounts: reads and writes records (evidence: `lifeos-app/src/app/api/data/route.ts`)
