# 2746267826/pim-platform architecture

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

- Interactive diagram: https://gitdiagram.com/2746267826/pim-platform
- Repository: https://github.com/2746267826/pim-platform

## Overview

PIM is a self-hosted personal information hub that collects PC and phone activity, processes it into deterministic summaries, and presents those conclusions for review and planning. The main flow is client collection and upload → server-side domain processing and storage → Web or Android views. The graph also covers calendar planning, files and notes, AI/MCP, and operations. Some capabilities are documented in the README but their implementation was not sampled; those links are based on documentation, and uncertain internal wiring is omitted.

Main entry points: [`src/Pim.Api/Program.cs`](https://github.com/2746267826/pim-platform/blob/master/src/Pim.Api/Program.cs) (API host), [`src/Pim.Api/Endpoints/TodayEndpoints.cs`](https://github.com/2746267826/pim-platform/blob/master/src/Pim.Api/Endpoints/TodayEndpoints.cs) (Today view API), [`src/modules/Pim.Module.Calendar/Services/SchedulingEngine.cs`](https://github.com/2746267826/pim-platform/blob/master/src/modules/Pim.Module.Calendar/Services/SchedulingEngine.cs) (Schedule engine), [`src/modules/Pim.Module.Files`](https://github.com/2746267826/pim-platform/tree/master/src/modules/Pim.Module.Files) (File services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Collection clients"]
  node_android["Android app"]
  node_pc["Windows tracker"]
  node_extension["Browser extension"]
end

subgraph group_server["PIM server"]
  node_api["API host<br/>[Program.cs]"]
  node_today["Today view API<br/>[TodayEndpoints.cs]"]
  node_mcp["MCP service"]
  node_ops["Operations<br/>[Operations]"]
end

subgraph group_domains["Domain services"]
  node_mobile_ingest["Mobile ingest"]
  node_mobile_queries["Mobile analytics"]
  node_location_queries["Location queries"]
  node_calendar["Calendar domain"]
  node_scheduler["Schedule engine"]
  node_pc_domain["PC activity domain"]
  node_files["File services<br/>[Pim.Module.Files]"]
  node_quicknotes["Quick Notes"]
  node_ai["AI gateway<br/>[AiGateway.cs]"]
end

subgraph group_experience["User experience"]
  node_web["Web app"]
  node_mobile_ui["Android views"]
end

subgraph group_integrations["External services"]
  node_database[("PostgreSQL")]
  node_onedrive["Microsoft OneDrive"]
  node_observability["Monitoring tools"]
end

node_person(("PIM user"))

node_person -->|"uses"| node_android
node_person -->|"uses"| node_web
node_android -->|"uploads activity"| node_api
node_pc -->|"reports events"| node_api
node_extension -->|"syncs tabs"| node_api
node_api -->|"dispatches upload"| node_mobile_ingest
node_mobile_ingest -->|"writes batches"| node_database
node_mobile_queries -->|"reads activity"| node_database
node_location_queries -->|"reads location"| node_database
node_pc_domain -->|"stores records"| node_database
node_calendar -->|"reads and writes"| node_database
node_scheduler -->|"reads tasks and events"| node_database
node_scheduler -->|"generates plans"| node_calendar
node_api -->|"maps endpoints"| node_today
node_today -->|"serves conclusions"| node_web
node_today -->|"serves conclusions"| node_mobile_ui
node_mobile_ui -->|"requests summaries"| node_api
node_files -->|"reads and writes files"| node_onedrive
node_files -->|"stores metadata"| node_database
node_quicknotes -->|"stores attachments"| node_onedrive
node_ai -->|"records usage"| node_database
node_ai -.->|"provides AI capability"| node_mcp
node_mcp -->|"dispatches requests"| node_api
node_ops -->|"inspects system data"| node_database
node_observability -.->|"collects telemetry"| node_api

click node_android "https://github.com/2746267826/pim-platform/tree/master/src/client-android/app/src/main/java/com/pim/app"
click node_api "https://github.com/2746267826/pim-platform/blob/master/src/Pim.Api/Program.cs"
click node_mobile_ingest "https://github.com/2746267826/pim-platform/blob/master/src/modules/Pim.Module.Mobile/Services/MobileUsageIngestService.cs"
click node_mobile_queries "https://github.com/2746267826/pim-platform/blob/master/src/modules/Pim.Module.Mobile/Services/MobileUsageQueryService.cs"
click node_location_queries "https://github.com/2746267826/pim-platform/blob/master/src/modules/Pim.Module.Mobile/Services/MobileLocationQueryService.cs"
click node_calendar "https://github.com/2746267826/pim-platform/tree/master/src/modules/Pim.Module.Calendar"
click node_scheduler "https://github.com/2746267826/pim-platform/blob/master/src/modules/Pim.Module.Calendar/Services/SchedulingEngine.cs"
click node_pc_domain "https://github.com/2746267826/pim-platform/tree/master/src/modules/Pim.Module.PcTracker"
click node_today "https://github.com/2746267826/pim-platform/blob/master/src/Pim.Api/Endpoints/TodayEndpoints.cs"
click node_web "https://github.com/2746267826/pim-platform/tree/master/src/client-web"
click node_mobile_ui "https://github.com/2746267826/pim-platform/tree/master/src/client-android/app/src/main/java/com/pim/app/ui"
click node_files "https://github.com/2746267826/pim-platform/tree/master/src/modules/Pim.Module.Files"
click node_quicknotes "https://github.com/2746267826/pim-platform/blob/master/src/modules/Pim.Module.QuickNotes/Services/OneDriveQuickNoteObjectStorage.cs"
click node_ai "https://github.com/2746267826/pim-platform/blob/master/src/Pim.Infrastructure/Ai/AiGateway.cs"
click node_mcp "https://github.com/2746267826/pim-platform/blob/master/src/modules/Pim.Module.Mcp/Services/McpInProcessPipeline.cs"
click node_ops "https://github.com/2746267826/pim-platform/tree/master/src/Pim.Infrastructure/Operations"

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_android,node_pc,node_extension,node_person toneBlue
class node_api,node_today,node_mcp,node_ops toneAmber
class node_mobile_ingest,node_mobile_queries,node_location_queries,node_calendar,node_scheduler,node_pc_domain,node_files,node_quicknotes,node_ai toneMint
class node_web,node_mobile_ui toneRose
class node_database,node_onedrive,node_observability toneIndigo
```

## Components

### Collection clients

- [Android app](https://github.com/2746267826/pim-platform/tree/master/src/client-android/app/src/main/java/com/pim/app): `src/client-android/app/src/main/java/com/pim/app`
- **Windows tracker**
- **Browser extension**

### PIM server

- [API host](https://github.com/2746267826/pim-platform/blob/master/src/Pim.Api/Program.cs): `src/Pim.Api/Program.cs`
- [Today view API](https://github.com/2746267826/pim-platform/blob/master/src/Pim.Api/Endpoints/TodayEndpoints.cs): `src/Pim.Api/Endpoints/TodayEndpoints.cs`
- [MCP service](https://github.com/2746267826/pim-platform/blob/master/src/modules/Pim.Module.Mcp/Services/McpInProcessPipeline.cs): `src/modules/Pim.Module.Mcp/Services/McpInProcessPipeline.cs`
- [Operations](https://github.com/2746267826/pim-platform/tree/master/src/Pim.Infrastructure/Operations): `src/Pim.Infrastructure/Operations`

### Domain services

- [Mobile ingest](https://github.com/2746267826/pim-platform/blob/master/src/modules/Pim.Module.Mobile/Services/MobileUsageIngestService.cs): `src/modules/Pim.Module.Mobile/Services/MobileUsageIngestService.cs`
- [Mobile analytics](https://github.com/2746267826/pim-platform/blob/master/src/modules/Pim.Module.Mobile/Services/MobileUsageQueryService.cs): `src/modules/Pim.Module.Mobile/Services/MobileUsageQueryService.cs`
- [Location queries](https://github.com/2746267826/pim-platform/blob/master/src/modules/Pim.Module.Mobile/Services/MobileLocationQueryService.cs): `src/modules/Pim.Module.Mobile/Services/MobileLocationQueryService.cs`
- [Calendar domain](https://github.com/2746267826/pim-platform/tree/master/src/modules/Pim.Module.Calendar): `src/modules/Pim.Module.Calendar`
- [Schedule engine](https://github.com/2746267826/pim-platform/blob/master/src/modules/Pim.Module.Calendar/Services/SchedulingEngine.cs): `src/modules/Pim.Module.Calendar/Services/SchedulingEngine.cs`
- [PC activity domain](https://github.com/2746267826/pim-platform/tree/master/src/modules/Pim.Module.PcTracker): `src/modules/Pim.Module.PcTracker`
- [File services](https://github.com/2746267826/pim-platform/tree/master/src/modules/Pim.Module.Files): `src/modules/Pim.Module.Files`
- [Quick Notes](https://github.com/2746267826/pim-platform/blob/master/src/modules/Pim.Module.QuickNotes/Services/OneDriveQuickNoteObjectStorage.cs): `src/modules/Pim.Module.QuickNotes/Services/OneDriveQuickNoteObjectStorage.cs`
- [AI gateway](https://github.com/2746267826/pim-platform/blob/master/src/Pim.Infrastructure/Ai/AiGateway.cs): `src/Pim.Infrastructure/Ai/AiGateway.cs`

### User experience

- [Web app](https://github.com/2746267826/pim-platform/tree/master/src/client-web): `src/client-web`
- [Android views](https://github.com/2746267826/pim-platform/tree/master/src/client-android/app/src/main/java/com/pim/app/ui): `src/client-android/app/src/main/java/com/pim/app/ui`

### External services

- **PostgreSQL**
- **Microsoft OneDrive**
- **Monitoring tools**

### Other components

- **PIM user**

## Connections

- PIM user → Android app: uses
- PIM user → Web app: uses
- Android app → API host: uploads activity
- Windows tracker → API host: reports events
- Browser extension → API host: syncs tabs
- API host → Mobile ingest: dispatches upload
- Mobile ingest → PostgreSQL: writes batches
- Mobile analytics → PostgreSQL: reads activity
- Location queries → PostgreSQL: reads location
- PC activity domain → PostgreSQL: stores records
- Calendar domain → PostgreSQL: reads and writes
- Schedule engine → PostgreSQL: reads tasks and events
- Schedule engine → Calendar domain: generates plans
- API host → Today view API: maps endpoints
- Today view API → Web app: serves conclusions
- Today view API → Android views: serves conclusions
- Android views → API host: requests summaries
- File services → Microsoft OneDrive: reads and writes files
- File services → PostgreSQL: stores metadata
- Quick Notes → Microsoft OneDrive: stores attachments
- AI gateway → PostgreSQL: records usage
- AI gateway → MCP service: provides AI capability
- MCP service → API host: dispatches requests
- Operations → PostgreSQL: inspects system data
- Monitoring tools → API host: collects telemetry
