Splits copyFileAsync into local vs s3 branches gated by the
TRACK_STORAGE_BACKEND flag (added in P0 d03232c8). Regular uploads
via TrackService.UploadTrack() now write to MinIO/S3 when the flag
is 's3' and a non-nil S3 service is configured, persisting the S3
object key + storage_backend='s3' on the track row atomically.
Changes:
- internal/core/track/service.go
- New S3StorageInterface (UploadStream + GetSignedURL + DeleteFile).
Narrow surface for testability; *services.S3StorageService satisfies.
- TrackService gains s3Service + storageBackend + s3Bucket fields
and a SetS3Storage setter.
- copyFileAsync is now a dispatcher; former body moved to
copyFileAsyncLocal, new copyFileAsyncS3 streams to S3 with key
tracks/<userID>/<trackID>.<ext>.
- mimeTypeForAudioExt helper.
- Stream server trigger deliberately skipped on S3 branch; wired
in Phase 2 with S3 read support.
- internal/api/routes_tracks.go: DI passes S3StorageService,
TrackStorageBackend, S3Bucket into TrackService.
- internal/core/track/service_async_test.go:
- fakeS3Storage stub (captures UploadStream payload).
- TestUploadTrack_S3Backend_UploadsToS3: end-to-end on key format,
content-type, DB row state.
- TestUploadTrack_S3Backend_NilS3Service_FallsBackToLocal:
defensive — backend='s3' + nil service must not panic.
Out of scope Phase 1: read path, transcoder. Enabling
TRACK_STORAGE_BACKEND=s3 in prod BEFORE Phase 2 ships makes S3-backed
tracks un-streamable. Keep flag 'local' until A4/A5 land.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
apps/web — Frontend React 18 + Vite 5 + TypeScript strict (source of truth for the UI)
veza-backend-api — Main Go 1.25 API service (Gin, GORM, Postgres, Redis, RabbitMQ, Elasticsearch). Handles REST, WebSocket, and chat (chat server was merged into this service in v0.502).
veza-stream-server — Rust streaming server (Axum 0.8, Tokio 1.35, Symphonia) — HLS, HTTP Range, WebSocket, gRPC
Prerequisites: Node 20 (see .nvmrc), Go, Rust, Docker. Configure .env from .env.example.
# Verify environment
make doctor
./scripts/validate-env.sh development
# Install dependencies
make install-deps
# Option A — Backend in Docker + Web local
make dev
# Option B — All apps local with hot reload (infra from docker-compose.dev.yml)
make dev-full
# Option C — Infra only, then run services manually
docker compose -f docker-compose.dev.yml up -d
make dev-web # or make dev-backend-api, make dev-stream-server
Canonical production compose file: docker-compose.prod.yml
docker compose -f docker-compose.prod.yml up -d
See make/config.mk for COMPOSE_PROD and deployment docs.
CI/CD
Badge : CI status above. Set SLACK_WEBHOOK_URL (Incoming Webhook) in repo secrets to receive Slack notifications on failure.
Disabled workflows
Storybook (chromatic.yml.disabled, storybook-audit.yml.disabled, visual-regression.yml.disabled): deferred until MSW is wired up for /api/v1/auth/me and /api/v1/logs/frontend, which currently causes ~1 400 network errors in the Storybook build. The npm scripts (storybook, build-storybook) still work locally for one-off component inspection. To reactivate in CI, fix the MSW handlers and rename the three files back to .yml.