# 38260/local-project-archive-desktop architecture

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

- Interactive diagram: https://gitdiagram.com/38260/local-project-archive-desktop
- Repository: https://github.com/38260/local-project-archive-desktop

## Overview

Tracelight is a local-first project archive: users add a project path or scan a root, the backend discovers and parses project metadata, and the UI presents searchable dashboards and project details backed by a local SQLite archive. Project records also support notes, changelogs, screenshots, launchers, run history, and export/restore; Git summaries power commit and activity views. A separate desktop shell wraps the local web app with a native window and tray. Relationships are grounded in README statements and SOURCE INDEX references; unsampled feature details are represented at subsystem level.

Main entry points: [`app/routers/projects.py`](https://github.com/38260/local-project-archive-desktop/blob/main/app/routers/projects.py) (Project archive API), [`app/routers/scanner.py`](https://github.com/38260/local-project-archive-desktop/blob/main/app/routers/scanner.py) (Scan and import API), [`app/main.py`](https://github.com/38260/local-project-archive-desktop/blob/main/app/main.py) (FastAPI application), [`app/static/js/common.js`](https://github.com/38260/local-project-archive-desktop/blob/main/app/static/js/common.js) (Browser UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Local entry points"]
  node_browser["Browser UI<br/>[common.js]"]
  node_desktop["Desktop shell<br/>[desktop.py]"]
  node_autostart["OS startup integration<br/>[autostart.py]"]
end

subgraph group_web["Web application"]
  node_api["FastAPI application<br/>[main.py]"]
  node_projectapi["Project archive API<br/>[projects.py]"]
  node_scanapi["Scan and import API<br/>[scanner.py]"]
  node_settingsapi["Settings API<br/>[settings.py]"]
  node_dashboard["Dashboard<br/>[dashboard.js]"]
  node_projectui["Project detail UI<br/>[project.js]"]
  node_settingsui["Settings UI<br/>[settings.js]"]
end

subgraph group_domain["Project workflows"]
  node_discovery["Project discovery<br/>[scanner.py]"]
  node_duplicate["Duplicate detection<br/>[duplicates.py]"]
  node_launch["Launch management<br/>[launcher.py]"]
  node_runhistory["Captured runs<br/>[runlog.py]"]
end

subgraph group_insights["Parsing and insights"]
  node_parser["Project parser<br/>[parser.py]"]
  node_git["Git insights<br/>[gitinfo.py]"]
  node_markdown["Markdown rendering<br/>[render.py]"]
  node_flowchart["Workflow diagrams<br/>[flowchart.py]"]
end

subgraph group_persistence["Local persistence"]
  node_sqlite[("Project archive database<br/>[db.py]")]
  node_settingsstore["Settings store<br/>[settings_store.py]"]
end

node_user(("Local user"))
node_localprojects["Local project folders"]

node_user -->|"uses"| node_browser
node_user -->|"opens"| node_desktop
node_browser -->|"requests"| node_api
node_desktop -->|"hosts"| node_api
node_api -->|"routes"| node_projectapi
node_api -->|"routes"| node_scanapi
node_api -->|"routes"| node_settingsapi
node_browser -->|"renders"| node_dashboard
node_browser -->|"renders"| node_projectui
node_browser -->|"renders"| node_settingsui
node_scanapi -->|"starts scan"| node_discovery
node_scanapi -->|"checks candidates"| node_duplicate
node_scanapi -->|"parses imports"| node_parser
node_projectapi -->|"checks duplicates"| node_duplicate
node_projectapi -->|"parses projects"| node_parser
node_projectapi -->|"reads Git data"| node_git
node_projectapi -->|"renders content"| node_markdown
node_projectapi -->|"manages launchers"| node_launch
node_projectapi -->|"records runs"| node_runhistory
node_parser -->|"reads repository"| node_git
node_parser -->|"renders README"| node_markdown
node_projectapi -->|"uses workflow diagrams"| node_flowchart
node_projectapi -->|"reads and writes"| node_sqlite
node_scanapi -->|"imports records"| node_sqlite
node_runhistory -->|"stores run history"| node_sqlite
node_api -->|"initializes archive"| node_sqlite
node_sqlite -->|"configures backups"| node_settingsstore
node_settingsapi -->|"updates preferences"| node_settingsstore
node_projectapi -->|"reads project files"| node_localprojects
node_scanapi -->|"imports from paths"| node_localprojects
node_git -->|"reads repository history"| node_localprojects
node_settingsapi -->|"controls startup"| node_autostart
node_desktop -->|"offers tray setting"| node_autostart

click node_browser "https://github.com/38260/local-project-archive-desktop/blob/main/app/static/js/common.js"
click node_desktop "https://github.com/38260/local-project-archive-desktop/blob/main/desktop.py"
click node_api "https://github.com/38260/local-project-archive-desktop/blob/main/app/main.py"
click node_projectapi "https://github.com/38260/local-project-archive-desktop/blob/main/app/routers/projects.py"
click node_scanapi "https://github.com/38260/local-project-archive-desktop/blob/main/app/routers/scanner.py"
click node_settingsapi "https://github.com/38260/local-project-archive-desktop/blob/main/app/routers/settings.py"
click node_dashboard "https://github.com/38260/local-project-archive-desktop/blob/main/app/static/js/dashboard.js"
click node_projectui "https://github.com/38260/local-project-archive-desktop/blob/main/app/static/js/project.js"
click node_settingsui "https://github.com/38260/local-project-archive-desktop/blob/main/app/static/js/settings.js"
click node_discovery "https://github.com/38260/local-project-archive-desktop/blob/main/app/services/scanner.py"
click node_duplicate "https://github.com/38260/local-project-archive-desktop/blob/main/app/services/duplicates.py"
click node_launch "https://github.com/38260/local-project-archive-desktop/blob/main/app/services/launcher.py"
click node_runhistory "https://github.com/38260/local-project-archive-desktop/blob/main/app/services/runlog.py"
click node_parser "https://github.com/38260/local-project-archive-desktop/blob/main/app/services/parser.py"
click node_git "https://github.com/38260/local-project-archive-desktop/blob/main/app/services/gitinfo.py"
click node_markdown "https://github.com/38260/local-project-archive-desktop/blob/main/app/services/render.py"
click node_flowchart "https://github.com/38260/local-project-archive-desktop/blob/main/app/services/flowchart.py"
click node_sqlite "https://github.com/38260/local-project-archive-desktop/blob/main/app/db.py"
click node_settingsstore "https://github.com/38260/local-project-archive-desktop/blob/main/app/services/settings_store.py"
click node_autostart "https://github.com/38260/local-project-archive-desktop/blob/main/app/services/autostart.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_browser,node_desktop,node_autostart,node_user toneBlue
class node_api,node_projectapi,node_scanapi,node_settingsapi,node_dashboard,node_projectui,node_settingsui toneAmber
class node_discovery,node_duplicate,node_launch,node_runhistory toneMint
class node_parser,node_git,node_markdown,node_flowchart toneRose
class node_sqlite,node_settingsstore,node_localprojects toneIndigo
```

## Components

### Local entry points

- [Browser UI](https://github.com/38260/local-project-archive-desktop/blob/main/app/static/js/common.js): `app/static/js/common.js`
- [Desktop shell](https://github.com/38260/local-project-archive-desktop/blob/main/desktop.py): `desktop.py`
- [OS startup integration](https://github.com/38260/local-project-archive-desktop/blob/main/app/services/autostart.py): `app/services/autostart.py`

### Web application

- [FastAPI application](https://github.com/38260/local-project-archive-desktop/blob/main/app/main.py): `app/main.py`
- [Project archive API](https://github.com/38260/local-project-archive-desktop/blob/main/app/routers/projects.py): `app/routers/projects.py`
- [Scan and import API](https://github.com/38260/local-project-archive-desktop/blob/main/app/routers/scanner.py): `app/routers/scanner.py`
- [Settings API](https://github.com/38260/local-project-archive-desktop/blob/main/app/routers/settings.py): `app/routers/settings.py`
- [Dashboard](https://github.com/38260/local-project-archive-desktop/blob/main/app/static/js/dashboard.js): `app/static/js/dashboard.js`
- [Project detail UI](https://github.com/38260/local-project-archive-desktop/blob/main/app/static/js/project.js): `app/static/js/project.js`
- [Settings UI](https://github.com/38260/local-project-archive-desktop/blob/main/app/static/js/settings.js): `app/static/js/settings.js`

### Project workflows

- [Project discovery](https://github.com/38260/local-project-archive-desktop/blob/main/app/services/scanner.py): `app/services/scanner.py`
- [Duplicate detection](https://github.com/38260/local-project-archive-desktop/blob/main/app/services/duplicates.py): `app/services/duplicates.py`
- [Launch management](https://github.com/38260/local-project-archive-desktop/blob/main/app/services/launcher.py): `app/services/launcher.py`
- [Captured runs](https://github.com/38260/local-project-archive-desktop/blob/main/app/services/runlog.py): `app/services/runlog.py`

### Parsing and insights

- [Project parser](https://github.com/38260/local-project-archive-desktop/blob/main/app/services/parser.py): `app/services/parser.py`
- [Git insights](https://github.com/38260/local-project-archive-desktop/blob/main/app/services/gitinfo.py): `app/services/gitinfo.py`
- [Markdown rendering](https://github.com/38260/local-project-archive-desktop/blob/main/app/services/render.py): `app/services/render.py`
- [Workflow diagrams](https://github.com/38260/local-project-archive-desktop/blob/main/app/services/flowchart.py): `app/services/flowchart.py`

### Local persistence

- [Project archive database](https://github.com/38260/local-project-archive-desktop/blob/main/app/db.py): `app/db.py`
- [Settings store](https://github.com/38260/local-project-archive-desktop/blob/main/app/services/settings_store.py): `app/services/settings_store.py`

### Other components

- **Local user**
- **Local project folders**

## Connections

- Local user → Browser UI: uses (evidence: `README.md`)
- Local user → Desktop shell: opens (evidence: `README.md`)
- Browser UI → FastAPI application: requests (evidence: `README.md`)
- Desktop shell → FastAPI application: hosts (evidence: `README.md`)
- FastAPI application → Project archive API: routes (evidence: `app/main.py`)
- FastAPI application → Scan and import API: routes (evidence: `app/main.py`)
- FastAPI application → Settings API: routes (evidence: `app/main.py`)
- Browser UI → Dashboard: renders (evidence: `README.md`)
- Browser UI → Project detail UI: renders (evidence: `README.md`)
- Browser UI → Settings UI: renders (evidence: `README.md`)
- Scan and import API → Project discovery: starts scan (evidence: `app/routers/scanner.py`)
- Scan and import API → Duplicate detection: checks candidates (evidence: `app/routers/scanner.py`)
- Scan and import API → Project parser: parses imports (evidence: `app/routers/scanner.py`)
- Project archive API → Duplicate detection: checks duplicates (evidence: `app/routers/projects.py`)
- Project archive API → Project parser: parses projects (evidence: `app/routers/projects.py`)
- Project archive API → Git insights: reads Git data (evidence: `app/routers/projects.py`)
- Project archive API → Markdown rendering: renders content (evidence: `app/routers/projects.py`)
- Project archive API → Launch management: manages launchers (evidence: `app/routers/projects.py`)
- Project archive API → Captured runs: records runs (evidence: `app/routers/projects.py`)
- Project parser → Git insights: reads repository (evidence: `app/services/parser.py`)
- Project parser → Markdown rendering: renders README (evidence: `app/services/parser.py`)
- Project archive API → Workflow diagrams: uses workflow diagrams (evidence: `app/routers/projects.py`)
- Project archive API → Project archive database: reads and writes (evidence: `app/routers/projects.py`)
- Scan and import API → Project archive database: imports records (evidence: `app/routers/scanner.py`)
- Captured runs → Project archive database: stores run history (evidence: `app/services/runlog.py`)
- FastAPI application → Project archive database: initializes archive (evidence: `app/main.py`)
- Project archive database → Settings store: configures backups (evidence: `app/db.py`)
- Settings API → Settings store: updates preferences (evidence: `app/routers/settings.py`)
- Project archive API → Local project folders: reads project files (evidence: `README.md`)
- Scan and import API → Local project folders: imports from paths (evidence: `README.md`)
- Git insights → Local project folders: reads repository history (evidence: `README.md`)
- Settings API → OS startup integration: controls startup (evidence: `app/routers/settings.py`)
- Desktop shell → OS startup integration: offers tray setting (evidence: `desktop.py`)
