# atharva2093/fileorg architecture

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

- Interactive diagram: https://gitdiagram.com/atharva2093/fileorg
- Repository: https://github.com/atharva2093/fileorg

## Overview

FileSync is a local-first file intelligence workbench: users scan a folder, inspect content-based recommendations, choose what to apply, and can review or undo recorded operations. Its distinct stages include discovery, extraction, local model analysis, review planning, safe filesystem changes, and history; assignment question-and-answer tools are a separate capability. The README documents these responsibilities and workflow. Source excerpts do not show the API’s full route implementations, so some links reflect documented behavior rather than inspected call sites.

Main entry points: [`filesync/api.py`](https://github.com/atharva2093/fileorg/blob/main/filesync/api.py) (Local API), [`filesync/planner.py`](https://github.com/atharva2093/fileorg/blob/main/filesync/planner.py) (Review plan), [`filesync/operations.py`](https://github.com/atharva2093/fileorg/blob/main/filesync/operations.py) (Verified operations), [`filesync/assignment.py`](https://github.com/atharva2093/fileorg/blob/main/filesync/assignment.py) (Assignment workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workbench["Workbench"]
  node_web["Web workbench<br/>[app.py]"]
  node_api["Local API<br/>[api.py]"]
  node_settings["Settings<br/>[config.py]"]
end

subgraph group_intelligence["File Intelligence"]
  node_scanner["Folder scanner<br/>[scanner.py]"]
  node_extractor["Content extraction<br/>[extractor.py]"]
  node_classifier["Analysis validation<br/>[classifier.py]"]
  node_provider["Gemma provider<br/>[ai.py]"]
  node_ollama["Ollama runtime"]
end

subgraph group_organization["Organization"]
  node_domain["Domain records<br/>[models.py]"]
  node_planner["Review plan<br/>[planner.py]"]
  node_operations["Verified operations<br/>[operations.py]"]
  node_history[("SQLite history<br/>[history.py]")]
end

subgraph group_learning["Learning Tools"]
  node_assignment["Assignment workflow<br/>[assignment.py]"]
end

node_user(("User"))
node_filesystem["Selected folder"]

node_user -->|"uses"| node_web
node_web -.->|"sends requests"| node_api
node_api -.->|"loads settings"| node_settings
node_api -->|"scans folder"| node_scanner
node_scanner -->|"reads metadata"| node_filesystem
node_api -->|"builds review plan"| node_planner
node_planner -->|"extracts content"| node_extractor
node_planner -->|"analyzes files"| node_classifier
node_classifier -->|"requests analysis"| node_provider
node_provider -->|"runs inference"| node_ollama
node_api -->|"applies selection"| node_operations
node_operations -->|"copies and verifies"| node_filesystem
node_operations -->|"records operations"| node_history
node_api -->|"lists and undoes"| node_history
node_api -->|"serves questions"| node_assignment
node_assignment -->|"extracts assignment"| node_extractor
node_assignment -->|"requests answers"| node_provider
node_assignment -->|"records answer counts"| node_history
node_planner -->|"creates plan records"| node_domain
node_operations -->|"updates operation records"| node_domain

click node_web "https://github.com/atharva2093/fileorg/blob/main/frontend/app.py"
click node_api "https://github.com/atharva2093/fileorg/blob/main/filesync/api.py"
click node_settings "https://github.com/atharva2093/fileorg/blob/main/filesync/config.py"
click node_scanner "https://github.com/atharva2093/fileorg/blob/main/filesync/scanner.py"
click node_extractor "https://github.com/atharva2093/fileorg/blob/main/filesync/extractor.py"
click node_classifier "https://github.com/atharva2093/fileorg/blob/main/filesync/classifier.py"
click node_provider "https://github.com/atharva2093/fileorg/blob/main/filesync/ai.py"
click node_domain "https://github.com/atharva2093/fileorg/blob/main/filesync/models.py"
click node_planner "https://github.com/atharva2093/fileorg/blob/main/filesync/planner.py"
click node_operations "https://github.com/atharva2093/fileorg/blob/main/filesync/operations.py"
click node_history "https://github.com/atharva2093/fileorg/blob/main/filesync/history.py"
click node_assignment "https://github.com/atharva2093/fileorg/blob/main/filesync/assignment.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_web,node_api,node_settings,node_user toneBlue
class node_scanner,node_extractor,node_classifier,node_provider,node_ollama toneAmber
class node_domain,node_planner,node_operations,node_history toneMint
class node_assignment toneRose
class node_filesystem toneIndigo
```

## Components

### Workbench

- [Web workbench](https://github.com/atharva2093/fileorg/blob/main/frontend/app.py): `frontend/app.py`
- [Local API](https://github.com/atharva2093/fileorg/blob/main/filesync/api.py): `filesync/api.py`
- [Settings](https://github.com/atharva2093/fileorg/blob/main/filesync/config.py): `filesync/config.py`

### File Intelligence

- [Folder scanner](https://github.com/atharva2093/fileorg/blob/main/filesync/scanner.py): `filesync/scanner.py`
- [Content extraction](https://github.com/atharva2093/fileorg/blob/main/filesync/extractor.py): `filesync/extractor.py`
- [Analysis validation](https://github.com/atharva2093/fileorg/blob/main/filesync/classifier.py): `filesync/classifier.py`
- [Gemma provider](https://github.com/atharva2093/fileorg/blob/main/filesync/ai.py): `filesync/ai.py`
- **Ollama runtime**

### Organization

- [Domain records](https://github.com/atharva2093/fileorg/blob/main/filesync/models.py): `filesync/models.py`
- [Review plan](https://github.com/atharva2093/fileorg/blob/main/filesync/planner.py): `filesync/planner.py`
- [Verified operations](https://github.com/atharva2093/fileorg/blob/main/filesync/operations.py): `filesync/operations.py`
- [SQLite history](https://github.com/atharva2093/fileorg/blob/main/filesync/history.py): `filesync/history.py`

### Learning Tools

- [Assignment workflow](https://github.com/atharva2093/fileorg/blob/main/filesync/assignment.py): `filesync/assignment.py`

### Other components

- **User**
- **Selected folder**

## Connections

- User → Web workbench: uses (evidence: `README.md`)
- Web workbench → Local API: sends requests
- Local API → Settings: loads settings (evidence: `filesync/api.py`)
- Local API → Folder scanner: scans folder (evidence: `README.md`)
- Folder scanner → Selected folder: reads metadata (evidence: `README.md`)
- Local API → Review plan: builds review plan (evidence: `README.md`)
- Review plan → Content extraction: extracts content (evidence: `filesync/planner.py`)
- Review plan → Analysis validation: analyzes files (evidence: `filesync/planner.py`)
- Analysis validation → Gemma provider: requests analysis (evidence: `filesync/classifier.py`)
- Gemma provider → Ollama runtime: runs inference (evidence: `filesync/ai.py`)
- Local API → Verified operations: applies selection (evidence: `README.md`)
- Verified operations → Selected folder: copies and verifies (evidence: `filesync/operations.py`)
- Verified operations → SQLite history: records operations (evidence: `filesync/operations.py`)
- Local API → SQLite history: lists and undoes (evidence: `README.md`)
- Local API → Assignment workflow: serves questions (evidence: `README.md`)
- Assignment workflow → Content extraction: extracts assignment (evidence: `filesync/assignment.py`)
- Assignment workflow → Gemma provider: requests answers (evidence: `filesync/assignment.py`)
- Assignment workflow → SQLite history: records answer counts (evidence: `README.md`)
- Review plan → Domain records: creates plan records (evidence: `filesync/planner.py`)
- Verified operations → Domain records: updates operation records (evidence: `filesync/operations.py`)
