Files
defrag/README.md
2025-12-12 03:28:42 +01:00

115 lines
2.2 KiB
Markdown

Hier is je **extreme short, sharp, architectural** versie — volledig gecomprimeerd, professioneel, helder.
Bron verwerkt uit je bestand
---
# Disk Reorganizer — Architectural Summary
## Core Outcome
Migration from **SQLite → PostgreSQL** completed.
System is now **network-capable**, **auditable**, **scalable**, and offers **real-time operational telemetry**.
---
## Architecture
### Database Layer (PostgreSQL)
* Central DB: `disk_reorganizer_db`
* User: `disk_reorg_user`
* Tables: `files`, `operations`
* Features: indexes, triggers, conflict-upserts, audit fields
* Deployment: SQL + Windows/Linux setup scripts
### Application Layer
* Python driver migrated to **psycopg2**
* Unified DB config + connection pooling
* Refactored CRUD + batch commits
* Robust error handling + transactional execution
### Operational Layer
* **Dynamic in-screen logging** during indexing + migration
* File/sec, GB processed, ETA, success/error counters
* Clean single-line, non-spamming UI updates
---
## Workflow
1. **Setup**
```json
{
"host": "192.168.1.159",
"port": 5432,
"database": "disk_reorganizer_db",
"user": "disk_reorg_user",
"password": "heel-goed-wachtwoord"
}
```
```bash
./setup_database.sh # or setup_database.bat
pip install -r requirements.txt
```
2. **Index**
```bash
python src/main.py index "D:\\" disk_d
```
3. **Plan**
```bash
python src/main.py plan disk_d disk_e
```
4. **Dry-Run**
```bash
python src/main.py execute plan.json --dry-run
```
5. **Execute**
```bash
python src/main.py execute plan.json
```
6. **Report**
```bash
python src/main.py report
```
---
## Guarantees
* No destructive actions by default
* Originals preserved
* Every action logged in DB
* Error-resilient, continues safely
* Suitable for millions of file records
---
## Failure Points to Check
* PostgreSQL reachable on 5432
* Correct credentials
* Disk permissions
* Python + psycopg2 installed
---
## Essence
A lean, safe, high-visibility disk migration tool running on a proper relational backbone, engineered for clarity, scale, and operational certainty.
Wil je ook een **ultrakorte executive one-pager** of een **diagram-versie**?