6140ecd3ba
refactor: split worker into bootstrap, event_loop, sweep modules
...
main.rs: 234 → 55 lines, just config + spawn + await.
bootstrap.rs: DI wiring, returns WorkerServices struct.
event_loop.rs: event dispatch with extracted helpers
(enqueue_cmd, handle_job_completed, drain_one).
sweep.rs: fallback job drainer on interval.
2026-05-31 23:09:21 +02:00
7b5bb66b37
feat: frontend-ready backend — pagination, auto-derivatives, list endpoints, bulk ops, OpenAPI
...
Pagination: count_by_owner + count_search on AssetRepository,
timeline/search return real total count (not page len).
Auto-derivatives: worker enqueues GenerateDerivative when
ExtractMetadata job completes, closing the upload→thumbnail gap.
List endpoints: GET /albums, GET /stacks with user scoping.
ListAlbumsHandler, ListStacksHandler, find_by_owner on AssetStackRepository.
Tag filtering: tag_name field on AssetFilters, JOIN asset_tags+tags
in postgres search/count queries.
Bulk operations: POST /assets/bulk-delete, POST /assets/bulk-tag.
Album update: PUT /albums/{id} with UpdateAlbumHandler (title, description).
OpenAPI: utoipa annotations on all 47 endpoints + all request/response
schemas registered. Scalar UI at /scalar covers full API.
2026-05-31 23:06:25 +02:00
c6f82090d2
feat: auth hardening + codebase quality sweep
...
Refresh tokens: RefreshToken entity, PostgresRefreshTokenRepository,
login returns refresh token, POST /auth/refresh (rotation), POST /auth/logout,
JWT expiry 24h→1h, configurable via with_expiry().
Route protection: require_auth middleware on protected routes,
public routes split (register, login, refresh, sharing/access).
Authorization: caller_id added to ReadAssetFileQuery, ReadDerivativeQuery,
GetStackQuery, DeleteStackCommand with ownership checks. Admin-only gates
on processing, storage, sidecar, duplicates handlers.
Quality fixes: visibility filtering bypass in search(), unwrap panics in
date parsing, DRY auth header parsing, centralized parsers module,
email validation via email_address crate, value objects (Username, MimeType,
RelativePath), domain events (UserCreated, UserDeleted, AlbumCreated,
TagCreated, DuplicateDetected), postgres error mapping for constraint
violations, OptionExt::or_not_found helper, in_memory_repo! macro,
GetStackQuery moved to queries, album add_entry 200→201.
2026-05-31 22:26:02 +02:00
95916cedde
feat: directory scanner plugin — walk library paths, auto-register assets
...
- DirectoryScannerPlugin: recursive directory walk via FileStoragePort
- Computes SHA256 checksums, classifies media by extension
- Registers each file via RegisterAssetHandler (triggers AssetIngested → extract_metadata pipeline)
- Reads library_path_id from job payload, looks up volume + path
- Seeded plugin + scan_directory pipeline
- Trigger via POST /jobs with { job_type: "ScanDirectory", payload: { library_path_id: "..." } }
2026-05-31 21:18:23 +02:00
f85c0cb246
feat: real XMP sidecar adapter, replaces LogSidecarWriter stubs
...
- adapters-sidecar: XmpSidecarWriter using xmp_toolkit
- Writes StructuredData → XMP with EXIF/DC/XMP namespace routing
- Reads XMP back to StructuredData
- Wired into bootstrap + worker, deleted both LogSidecarWriter stubs
2026-05-31 21:05:46 +02:00
d379f3d3c8
refactor: code smell fixes — tests, events, naming
...
- Tests for ExecutePipelineHandler (happy path, fallback, disabled skip, failure retry, not found)
- Tests for ProcessNextJobHandler (empty queue, process, drain multiple)
- DerivativeGenerated domain event + event-payload mapping + event_store aggregate
- Renamed event-payload → adapters-event-payload, event-transport → adapters-event-transport
2026-05-31 21:00:50 +02:00
e11a1a828b
refactor: use workspace deps for all internal crates, no relative paths
2026-05-31 20:48:09 +02:00
35d5baf7be
feat: thumbnail generator plugin with configurable size/format
...
- ThumbnailGeneratorPort in domain (bytes + config → resized bytes)
- adapters-thumbnail: ImageThumbnailGenerator using image crate
- ThumbnailGeneratorPlugin reads width/height/format/profile from step config
- PostgresDerivativeRepository + 012_derivatives migration
- Seeded in extract_metadata pipeline as step 2 (300x300 webp)
- Standalone generate_derivative pipeline for on-demand use
2026-05-31 20:44:55 +02:00
45669ec848
feat: real EXIF extraction via adapters-exif crate
...
- MetadataExtractorPort in domain (bytes → StructuredData)
- adapters-exif: NomExifExtractor using nom-exif, handles EXIF + TrackInfo
- Worker's MetadataExtractorPlugin delegates to port, no longer knows nom-exif
- Filters noisy binary tags (U8Array, Undefined, Unknown)
2026-05-31 20:28:50 +02:00
d1c7243f5b
feat: seed default plugins/pipelines, auto-enqueue jobs on asset ingest
...
- Migration seeds metadata_extractor, sidecar_sync, no_op plugins
- Pipelines: extract_metadata → metadata_extractor, sync_sidecar → sidecar_sync
- Worker reacts to AssetIngested → enqueues ExtractMetadata job
- Worker reacts to SidecarSyncRequested → enqueues SyncSidecar job
- Closes the ingest-to-processing loop end-to-end
2026-05-31 20:12:42 +02:00
aa09aec66b
feat: event store — persist domain events to Postgres event_log table via composite publisher
2026-05-31 18:36:10 +02:00
d022cb9068
feat: event-driven job dispatch via NATS subscription with 60s fallback sweep
2026-05-31 18:31:53 +02:00
838ed9a3f8
feat: wire NATS event publisher into bootstrap + worker
...
- Both binaries connect to NATS on startup, ensure JetStream stream
- EventPublisherAdapter<NatsTransport> replaces LogEventPublisher
- nats_url config with default nats://localhost:4222
- Deleted bootstrap's LogEventPublisher (no longer needed)
2026-05-31 11:53:51 +02:00
0e9911ebfc
feat: event infrastructure — payload, transport, NATS adapter
...
- EventPublisher now takes &DomainEvent (11 call sites + 3 impls updated)
- EventEnvelope + EventConsumer port in domain
- event-payload: serializable DomainEvent mirror with subject routing
- event-transport: generic Transport/MessageSource traits, publisher/consumer adapters
- adapters-nats: JetStream publish + durable pull consumer
2026-05-31 11:50:16 +02:00
dacfc3d453
feat: worker plugin system — domain ports, pipeline executor, built-in plugins
...
- PluginExecutor + PluginRegistry ports in domain
- ExecutePipelineCommand orchestrates job→pipeline→plugin steps
- ProcessNextJobCommand polls + executes next queued job
- InMemoryPluginRegistry, NoOp/MetadataExtractor/SidecarSync plugins
- Worker main rewritten with poll loop, factories module for DI
- Deleted template job/runner/jobs remnants
2026-05-31 11:35:05 +02:00
9aba393fde
feat: vertical slice — migrations, postgres adapters, presentation handlers, bootstrap wiring
2026-05-31 05:52:42 +02:00
c2ebca0da0
style: cargo fmt --all
2026-05-31 05:31:42 +02:00
f9cb142c3b
init: scaffold from k-template with postgres + worker
2026-05-31 03:08:38 +02:00