# engabdullah3334-bot/lifeos1 architecture

> Architecture diagram of the GitHub repository engabdullah3334-bot/lifeos1, 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/engabdullah3334-bot/lifeos1
- Repository: https://github.com/engabdullah3334-bot/lifeos1

## Overview

LifeOS is a personal productivity web app with task/project management, notes and writing, authentication, settings, and an AI assistant. A typical workflow is to sign in, manage projects and tasks through the API, and view or update them in the browser; the AI assistant can also invoke registered task and writing actions. The graph distinguishes routes from domain services and includes the AI provider layer. README content was not provided, and frontend module wiring is largely unsampled, so those connections are omitted where evidence is unavailable.

Main entry points: [`core/ai_agent.py`](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/ai_agent.py) (AI agent), [`core/task.py`](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/task.py) (Tasks and projects), [`core/writing.py`](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/writing.py) (Notes and writing), [`core/actions.py`](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/actions.py) (AI action executors)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Web app"]
  node_server["Flask server<br/>[server.py]"]
  node_auth_routes["Authentication API<br/>[auth.py]"]
  node_task_routes["Tasks API<br/>[tasks.py]"]
  node_writing_routes["Writing API<br/>[writing.py]"]
  node_ai_routes["AI API<br/>[ai.py]"]
  node_archive_routes["Archive API<br/>[archive.py]"]
  node_settings_routes["Settings API<br/>[settings.py]"]
  node_templates_routes["Templates API<br/>[templates.py]"]
  node_dashboard_routes["Dashboard API<br/>[dashboard.py]"]
end

subgraph group_domain["Product services"]
  node_auth_service["Auth service<br/>[auth.py]"]
  node_task_service["Tasks and projects<br/>[task.py]"]
  node_writing_service["Notes and writing<br/>[writing.py]"]
  node_archive_service["Archive service<br/>[archive.py]"]
  node_settings_service["Settings service<br/>[settings.py]"]
  node_templates_service["Templates service<br/>[templates.py]"]
end

subgraph group_ai["AI assistant"]
  node_ai_agent["AI agent<br/>[ai_agent.py]"]
  node_actions["AI action executors<br/>[actions.py]"]
  node_registry["Action registry<br/>[registry.py]"]
end

subgraph group_providers["AI providers"]
  node_gemini["Gemini adapter<br/>[gemini.py]"]
  node_grok["Grok adapter<br/>[grok.py]"]
  node_ollama["Ollama adapter<br/>[ollama.py]"]
end

subgraph group_support["Shared services"]
  node_mongo[("MongoDB")]
  node_config["Config and prompts<br/>[config_loader.py]"]
  node_schemas["Document schemas<br/>[schema_factory.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_server
node_server -->|"connects to"| node_mongo
node_auth_routes -->|"calls"| node_auth_service
node_auth_service -->|"reads and writes"| node_mongo
node_task_routes -->|"calls"| node_task_service
node_task_service -->|"reads and writes"| node_mongo
node_writing_routes -->|"calls"| node_writing_service
node_writing_service -->|"reads and writes"| node_mongo
node_archive_routes -->|"calls"| node_archive_service
node_settings_routes -->|"calls"| node_settings_service
node_templates_routes -->|"calls"| node_templates_service
node_dashboard_routes -->|"calls"| node_task_service
node_ai_routes -->|"calls"| node_ai_agent
node_ai_agent -->|"loads prompts"| node_config
node_ai_agent -->|"dispatches actions"| node_registry
node_actions -->|"registers actions"| node_registry
node_actions -->|"executes task actions"| node_task_service
node_actions -->|"executes note actions"| node_writing_service
node_ai_agent -->|"calls provider"| node_gemini
node_ai_agent -->|"calls provider"| node_grok
node_ai_agent -->|"calls provider"| node_ollama
node_task_service -->|"builds documents"| node_schemas
node_writing_service -->|"uses schemas"| node_schemas
node_templates_service -->|"loads config"| node_config
node_settings_service -->|"loads config"| node_config

click node_server "https://github.com/engabdullah3334-bot/lifeos1/blob/main/server.py"
click node_auth_routes "https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/auth.py"
click node_task_routes "https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/tasks.py"
click node_writing_routes "https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/writing.py"
click node_ai_routes "https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/ai.py"
click node_archive_routes "https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/archive.py"
click node_settings_routes "https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/settings.py"
click node_templates_routes "https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/templates.py"
click node_dashboard_routes "https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/dashboard.py"
click node_auth_service "https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/auth.py"
click node_task_service "https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/task.py"
click node_writing_service "https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/writing.py"
click node_archive_service "https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/archive.py"
click node_settings_service "https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/settings.py"
click node_templates_service "https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/templates.py"
click node_ai_agent "https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/ai_agent.py"
click node_actions "https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/actions.py"
click node_registry "https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/registry.py"
click node_gemini "https://github.com/engabdullah3334-bot/lifeos1/blob/main/api/gemini.py"
click node_grok "https://github.com/engabdullah3334-bot/lifeos1/blob/main/api/grok.py"
click node_ollama "https://github.com/engabdullah3334-bot/lifeos1/blob/main/api/ollama.py"
click node_config "https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/config_loader.py"
click node_schemas "https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/schema_factory.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_server,node_auth_routes,node_task_routes,node_writing_routes,node_ai_routes,node_archive_routes,node_settings_routes,node_templates_routes,node_dashboard_routes,node_user toneBlue
class node_auth_service,node_task_service,node_writing_service,node_archive_service,node_settings_service,node_templates_service toneAmber
class node_ai_agent,node_actions,node_registry toneMint
class node_gemini,node_grok,node_ollama toneRose
class node_mongo,node_config,node_schemas toneIndigo
```

## Components

### Web app

- [Flask server](https://github.com/engabdullah3334-bot/lifeos1/blob/main/server.py): `server.py`
- [Authentication API](https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/auth.py): `routes/auth.py`
- [Tasks API](https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/tasks.py): `routes/tasks.py`
- [Writing API](https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/writing.py): `routes/writing.py`
- [AI API](https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/ai.py): `routes/ai.py`
- [Archive API](https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/archive.py): `routes/archive.py`
- [Settings API](https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/settings.py): `routes/settings.py`
- [Templates API](https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/templates.py): `routes/templates.py`
- [Dashboard API](https://github.com/engabdullah3334-bot/lifeos1/blob/main/routes/dashboard.py): `routes/dashboard.py`

### Product services

- [Auth service](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/auth.py): `core/auth.py`
- [Tasks and projects](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/task.py): `core/task.py`
- [Notes and writing](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/writing.py): `core/writing.py`
- [Archive service](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/archive.py): `core/archive.py`
- [Settings service](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/settings.py): `core/settings.py`
- [Templates service](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/templates.py): `core/templates.py`

### AI assistant

- [AI agent](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/ai_agent.py): `core/ai_agent.py`
- [AI action executors](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/actions.py): `core/actions.py`
- [Action registry](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/registry.py): `core/registry.py`

### AI providers

- [Gemini adapter](https://github.com/engabdullah3334-bot/lifeos1/blob/main/api/gemini.py): `api/gemini.py`
- [Grok adapter](https://github.com/engabdullah3334-bot/lifeos1/blob/main/api/grok.py): `api/grok.py`
- [Ollama adapter](https://github.com/engabdullah3334-bot/lifeos1/blob/main/api/ollama.py): `api/ollama.py`

### Shared services

- **MongoDB**
- [Config and prompts](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/config_loader.py): `core/config_loader.py`
- [Document schemas](https://github.com/engabdullah3334-bot/lifeos1/blob/main/core/schema_factory.py): `core/schema_factory.py`

### Other components

- **User**

## Connections

- User → Flask server: uses (evidence: `server.py`)
- Flask server → MongoDB: connects to (evidence: `server.py`)
- Authentication API → Auth service: calls (evidence: `routes/auth.py`)
- Auth service → MongoDB: reads and writes (evidence: `core/auth.py`)
- Tasks API → Tasks and projects: calls (evidence: `routes/tasks.py`)
- Tasks and projects → MongoDB: reads and writes (evidence: `core/task.py`)
- Writing API → Notes and writing: calls (evidence: `routes/writing.py`)
- Notes and writing → MongoDB: reads and writes (evidence: `core/writing.py`)
- Archive API → Archive service: calls (evidence: `routes/archive.py`)
- Settings API → Settings service: calls (evidence: `routes/settings.py`)
- Templates API → Templates service: calls (evidence: `routes/templates.py`)
- Dashboard API → Tasks and projects: calls (evidence: `routes/dashboard.py`)
- AI API → AI agent: calls (evidence: `routes/ai.py`)
- AI agent → Config and prompts: loads prompts (evidence: `core/ai_agent.py`)
- AI agent → Action registry: dispatches actions (evidence: `core/ai_agent.py`)
- AI action executors → Action registry: registers actions (evidence: `core/actions.py`)
- AI action executors → Tasks and projects: executes task actions (evidence: `core/actions.py`)
- AI action executors → Notes and writing: executes note actions (evidence: `core/actions.py`)
- AI agent → Gemini adapter: calls provider (evidence: `core/ai_agent.py`)
- AI agent → Grok adapter: calls provider (evidence: `core/ai_agent.py`)
- AI agent → Ollama adapter: calls provider (evidence: `core/ai_agent.py`)
- Tasks and projects → Document schemas: builds documents (evidence: `core/task.py`)
- Notes and writing → Document schemas: uses schemas (evidence: `core/writing.py`)
- Templates service → Config and prompts: loads config (evidence: `core/templates.py`)
- Settings service → Config and prompts: loads config (evidence: `core/settings.py`)
