# aichouramine/filewizardai architecture

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

- Interactive diagram: https://gitdiagram.com/aichouramine/filewizardai
- Repository: https://github.com/aichouramine/filewizardai

## Overview

FileWizardAI organizes and renames files using content summaries, caches summaries to avoid repeat API work, and also searches files from a text query. The main workflow runs from the Angular UI through FastAPI into directory processing, cached or new AI summaries, and AI-proposed paths; users can then apply the proposed moves. Search is a separate capability that reuses summaries. The graph includes UI, API, processing, cache, and AI layers. Evidence is limited to the supplied excerpts and README; unsampled component behavior is not inferred.

Main entry points: [`backend/app/run.py`](https://github.com/aichouramine/filewizardai/blob/main/backend/app/run.py) (Workflow orchestrator), [`backend/app/server.py`](https://github.com/aichouramine/filewizardai/blob/main/backend/app/server.py) (FastAPI routes), [`frontend/src/app/app.component.ts`](https://github.com/aichouramine/filewizardai/blob/main/frontend/src/app/app.component.ts) (Main interface), [`frontend/src/app/components/search-files.component.ts`](https://github.com/aichouramine/filewizardai/blob/main/frontend/src/app/components/search-files.component.ts) (Search interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Angular interface"]
  node_app["Main interface<br/>[app.component.ts]"]
  node_folder["Folder tree"]
  node_searchui["Search interface"]
  node_service["HTTP client<br/>[data.service.ts]"]
  node_module["Angular module<br/>[app.module.ts]"]
end

subgraph group_api["HTTP API"]
  node_server["FastAPI routes<br/>[server.py]"]
end

subgraph group_processing["File processing"]
  node_run["Workflow orchestrator<br/>[run.py]"]
  node_reader["Directory reader<br/>[run.py]"]
  node_cache[("Summary cache<br/>[database.py]")]
  node_fileops["File moves<br/>[run.py]"]
end

subgraph group_ai["AI capabilities"]
  node_summarize["Content summarization<br/>[settings.py]"]
  node_organize["Path generation<br/>[settings.py]"]
  node_semantic["Query matching<br/>[settings.py]"]
end

node_user(("User"))
node_llm{{"Text and image model APIs"}}

node_user -->|"uses"| node_app
node_app -->|"requests files"| node_service
node_searchui -->|"requests matches"| node_service
node_searchui -->|"renders results"| node_folder
node_app -->|"renders tree"| node_folder
node_module -->|"declares"| node_app
node_module -->|"declares"| node_folder
node_module -->|"declares"| node_searchui
node_service -->|"sends HTTP requests"| node_server
node_server -->|"invokes workflow"| node_run
node_run -->|"loads directory"| node_reader
node_run -->|"reads and writes summaries"| node_cache
node_run -->|"requests summaries"| node_summarize
node_summarize -->|"calls model APIs"| node_llm
node_run -->|"requests proposed paths"| node_organize
node_organize -->|"calls text model"| node_llm
node_server -->|"updates files"| node_fileops
node_fileops -->|"updates cached path"| node_cache
node_server -->|"requests search"| node_run
node_run -->|"requests query matches"| node_semantic
node_semantic -->|"calls text model"| node_llm
node_user -->|"enters query"| node_searchui

click node_app "https://github.com/aichouramine/filewizardai/blob/main/frontend/src/app/app.component.ts"
click node_folder "https://github.com/aichouramine/filewizardai/blob/main/frontend/src/app/components/folder-tree.component.ts"
click node_searchui "https://github.com/aichouramine/filewizardai/blob/main/frontend/src/app/components/search-files.component.ts"
click node_service "https://github.com/aichouramine/filewizardai/blob/main/frontend/src/app/data.service.ts"
click node_module "https://github.com/aichouramine/filewizardai/blob/main/frontend/src/app/app.module.ts"
click node_server "https://github.com/aichouramine/filewizardai/blob/main/backend/app/server.py"
click node_run "https://github.com/aichouramine/filewizardai/blob/main/backend/app/run.py"
click node_reader "https://github.com/aichouramine/filewizardai/blob/main/backend/app/run.py"
click node_cache "https://github.com/aichouramine/filewizardai/blob/main/backend/app/database.py"
click node_fileops "https://github.com/aichouramine/filewizardai/blob/main/backend/app/run.py"
click node_summarize "https://github.com/aichouramine/filewizardai/blob/main/backend/app/settings.py"
click node_organize "https://github.com/aichouramine/filewizardai/blob/main/backend/app/settings.py"
click node_semantic "https://github.com/aichouramine/filewizardai/blob/main/backend/app/settings.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_app,node_folder,node_searchui,node_service,node_module,node_user toneBlue
class node_server toneAmber
class node_run,node_reader,node_cache,node_fileops,node_llm toneMint
class node_summarize,node_organize,node_semantic toneRose
```

## Components

### Angular interface

- [Main interface](https://github.com/aichouramine/filewizardai/blob/main/frontend/src/app/app.component.ts): `frontend/src/app/app.component.ts`
- [Folder tree](https://github.com/aichouramine/filewizardai/blob/main/frontend/src/app/components/folder-tree.component.ts): `frontend/src/app/components/folder-tree.component.ts`
- [Search interface](https://github.com/aichouramine/filewizardai/blob/main/frontend/src/app/components/search-files.component.ts): `frontend/src/app/components/search-files.component.ts`
- [HTTP client](https://github.com/aichouramine/filewizardai/blob/main/frontend/src/app/data.service.ts): `frontend/src/app/data.service.ts`
- [Angular module](https://github.com/aichouramine/filewizardai/blob/main/frontend/src/app/app.module.ts): `frontend/src/app/app.module.ts`

### HTTP API

- [FastAPI routes](https://github.com/aichouramine/filewizardai/blob/main/backend/app/server.py): `backend/app/server.py`

### File processing

- [Workflow orchestrator](https://github.com/aichouramine/filewizardai/blob/main/backend/app/run.py): `backend/app/run.py`
- [Directory reader](https://github.com/aichouramine/filewizardai/blob/main/backend/app/run.py): `backend/app/run.py`
- [Summary cache](https://github.com/aichouramine/filewizardai/blob/main/backend/app/database.py): `backend/app/database.py`
- [File moves](https://github.com/aichouramine/filewizardai/blob/main/backend/app/run.py): `backend/app/run.py`

### AI capabilities

- [Content summarization](https://github.com/aichouramine/filewizardai/blob/main/backend/app/settings.py): `backend/app/settings.py`
- [Path generation](https://github.com/aichouramine/filewizardai/blob/main/backend/app/settings.py): `backend/app/settings.py`
- [Query matching](https://github.com/aichouramine/filewizardai/blob/main/backend/app/settings.py): `backend/app/settings.py`

### Other components

- **User**
- **Text and image model APIs**

## Connections

- User → Main interface: uses (evidence: `README.md`)
- Main interface → HTTP client: requests files (evidence: `frontend/src/app/app.component.ts`)
- Search interface → HTTP client: requests matches (evidence: `frontend/src/app/components/search-files.component.ts`)
- Search interface → Folder tree: renders results (evidence: `frontend/src/app/components/search-files.component.ts`)
- Main interface → Folder tree: renders tree (evidence: `frontend/src/app/app.component.ts`)
- Angular module → Main interface: declares (evidence: `frontend/src/app/app.module.ts`)
- Angular module → Folder tree: declares (evidence: `frontend/src/app/app.module.ts`)
- Angular module → Search interface: declares (evidence: `frontend/src/app/app.module.ts`)
- HTTP client → FastAPI routes: sends HTTP requests (evidence: `frontend/src/app/data.service.ts`)
- FastAPI routes → Workflow orchestrator: invokes workflow (evidence: `backend/app/server.py`)
- Workflow orchestrator → Directory reader: loads directory (evidence: `backend/app/run.py`)
- Workflow orchestrator → Summary cache: reads and writes summaries (evidence: `backend/app/run.py`)
- Workflow orchestrator → Content summarization: requests summaries (evidence: `backend/app/run.py`)
- Content summarization → Text and image model APIs: calls model APIs (evidence: `backend/app/settings.py`)
- Workflow orchestrator → Path generation: requests proposed paths (evidence: `backend/app/run.py`)
- Path generation → Text and image model APIs: calls text model (evidence: `backend/app/settings.py`)
- FastAPI routes → File moves: updates files (evidence: `backend/app/server.py`)
- File moves → Summary cache: updates cached path (evidence: `backend/app/run.py`)
- FastAPI routes → Workflow orchestrator: requests search (evidence: `backend/app/server.py`)
- Workflow orchestrator → Query matching: requests query matches (evidence: `backend/app/run.py`)
- Query matching → Text and image model APIs: calls text model (evidence: `backend/app/settings.py`)
- User → Search interface: enters query (evidence: `README.md`)
