Skip to content

Latest commit

Β 

History

History
92 lines (91 loc) Β· 6.18 KB

File metadata and controls

92 lines (91 loc) Β· 6.18 KB

Project Structure

phaze/
β”œβ”€β”€ src/phaze/                  # Application package
β”‚   β”œβ”€β”€ config.py               # Pydantic settings (env vars)
β”‚   β”œβ”€β”€ constants.py            # File categories, extension map, tuning constants
β”‚   β”œβ”€β”€ database.py             # Async SQLAlchemy engine + session factory
β”‚   β”œβ”€β”€ main.py                 # FastAPI app factory with lifespan
β”‚   β”œβ”€β”€ models/                 # SQLAlchemy ORM models
β”‚   β”‚   β”œβ”€β”€ base.py             #   DeclarativeBase + TimestampMixin
β”‚   β”‚   β”œβ”€β”€ file.py             #   FileRecord + FileState enum
β”‚   β”‚   β”œβ”€β”€ scan_batch.py       #   ScanBatch progress tracking
β”‚   β”‚   β”œβ”€β”€ metadata.py         #   FileMetadata (audio tags)
β”‚   β”‚   β”œβ”€β”€ analysis.py         #   AnalysisResult (BPM, key, mood, style)
β”‚   β”‚   β”œβ”€β”€ fingerprint.py      #   FingerprintResult (per-engine)
β”‚   β”‚   β”œβ”€β”€ proposal.py         #   RenameProposal + ProposalStatus
β”‚   β”‚   β”œβ”€β”€ execution.py        #   ExecutionLog (audit trail)
β”‚   β”‚   β”œβ”€β”€ tracklist.py        #   Tracklist + TracklistVersion + TracklistTrack
β”‚   β”‚   └── file_companion.py   #   FileCompanion (companion-media join)
β”‚   β”œβ”€β”€ routers/                # API + UI endpoints
β”‚   β”‚   β”œβ”€β”€ health.py           #   GET /health
β”‚   β”‚   β”œβ”€β”€ scan.py             #   File discovery scan
β”‚   β”‚   β”œβ”€β”€ pipeline.py         #   Pipeline dashboard + processing triggers
β”‚   β”‚   β”œβ”€β”€ proposals.py        #   Proposal review + approval UI
β”‚   β”‚   β”œβ”€β”€ execution.py        #   Batch execution + SSE progress
β”‚   β”‚   β”œβ”€β”€ preview.py          #   Directory tree preview
β”‚   β”‚   β”œβ”€β”€ duplicates.py       #   Duplicate resolution UI
β”‚   β”‚   β”œβ”€β”€ tracklists.py       #   Tracklist management UI
β”‚   β”‚   └── companion.py        #   Companion file association
β”‚   β”œβ”€β”€ schemas/                # Pydantic request/response models
β”‚   β”‚   β”œβ”€β”€ scan.py             #   Scan API schemas
β”‚   β”‚   └── companion.py        #   Companion/duplicate schemas
β”‚   β”œβ”€β”€ services/               # Business logic
β”‚   β”‚   β”œβ”€β”€ ingestion.py        #   File discovery, hashing, bulk upsert
β”‚   β”‚   β”œβ”€β”€ metadata.py         #   Tag extraction via mutagen
β”‚   β”‚   β”œβ”€β”€ analysis.py         #   BPM/key/mood via essentia
β”‚   β”‚   β”œβ”€β”€ fingerprint.py      #   Multi-engine fingerprint orchestrator
β”‚   β”‚   β”œβ”€β”€ proposal.py         #   LLM calling + context building
β”‚   β”‚   β”œβ”€β”€ proposal_queries.py #   Proposal queries + pagination
β”‚   β”‚   β”œβ”€β”€ execution.py        #   Copy-verify-delete with audit logging
β”‚   β”‚   β”œβ”€β”€ execution_queries.py#   Execution log queries + pagination
β”‚   β”‚   β”œβ”€β”€ companion.py        #   Companion file association
β”‚   β”‚   β”œβ”€β”€ dedup.py            #   Duplicate detection + resolution
β”‚   β”‚   β”œβ”€β”€ collision.py        #   Destination path collision detection
β”‚   β”‚   β”œβ”€β”€ pipeline.py         #   Pipeline stats + file state queries
β”‚   β”‚   β”œβ”€β”€ tracklist_scraper.py#   1001Tracklists web scraper
β”‚   β”‚   └── tracklist_matcher.py#   Fuzzy match tracklists to files
β”‚   β”œβ”€β”€ tasks/                  # SAQ async background jobs
β”‚   β”‚   β”œβ”€β”€ worker.py           #   SAQ settings + startup/shutdown
β”‚   β”‚   β”œβ”€β”€ functions.py        #   process_file (full pipeline per file)
β”‚   β”‚   β”œβ”€β”€ metadata_extraction.py # extract_file_metadata
β”‚   β”‚   β”œβ”€β”€ fingerprint.py      #   fingerprint_file (multi-engine)
β”‚   β”‚   β”œβ”€β”€ proposal.py         #   generate_proposals (batch LLM)
β”‚   β”‚   β”œβ”€β”€ execution.py        #   execute_approved_batch
β”‚   β”‚   β”œβ”€β”€ scan.py             #   scan_live_set (fingerprint matching)
β”‚   β”‚   β”œβ”€β”€ tracklist.py        #   scrape/search/refresh tracklists
β”‚   β”‚   β”œβ”€β”€ pool.py             #   ProcessPoolExecutor for CPU work
β”‚   β”‚   └── session.py          #   Session utilities
β”‚   β”œβ”€β”€ prompts/                # LLM prompt templates
β”‚   └── templates/              # Jinja2 HTML templates (HTMX + Tailwind)
β”‚       β”œβ”€β”€ pipeline/           #   Pipeline dashboard
β”‚       β”œβ”€β”€ proposals/          #   Proposal approval UI
β”‚       β”œβ”€β”€ execution/          #   Execution dashboard + audit log
β”‚       β”œβ”€β”€ duplicates/         #   Duplicate resolution UI
β”‚       β”œβ”€β”€ tracklists/         #   Tracklist management UI
β”‚       └── preview/            #   Directory tree preview
β”œβ”€β”€ services/                   # Fingerprint microservices
β”‚   β”œβ”€β”€ audfprint/              #   Landmark-based fingerprinting
β”‚   └── panako/                 #   Tempo-robust fingerprinting
β”œβ”€β”€ tests/                      # Test suite (85%+ coverage)
β”‚   β”œβ”€β”€ conftest.py             #   Fixtures + test DB setup
β”‚   β”œβ”€β”€ test_models/            #   ORM model tests
β”‚   β”œβ”€β”€ test_routers/           #   Endpoint integration tests
β”‚   β”œβ”€β”€ test_services/          #   Business logic unit tests
β”‚   └── test_tasks/             #   SAQ job tests
β”œβ”€β”€ alembic/                    # Database migrations (async template)
β”‚   └── versions/               #   Migration scripts (001-008)
β”œβ”€β”€ .github/workflows/          # CI/CD pipelines
β”‚   β”œβ”€β”€ ci.yml                  #   Main orchestrator
β”‚   β”œβ”€β”€ code-quality.yml        #   Pre-commit hooks
β”‚   β”œβ”€β”€ tests.yml               #   Pytest + Codecov
β”‚   └── security.yml            #   pip-audit, bandit, Semgrep, Trivy
β”œβ”€β”€ scripts/                    # Utility scripts
β”‚   └── download-models.sh      #   Download essentia ML models
β”œβ”€β”€ docker-compose.yml          # Service orchestration
β”œβ”€β”€ docker-compose.override.yml # Local development overrides
β”œβ”€β”€ Dockerfile                  # Multi-stage build (API + worker)
β”œβ”€β”€ justfile                    # Developer commands
β”œβ”€β”€ pyproject.toml              # Project config + tool settings
└── uv.lock                     # Frozen dependency versions