AcevedoR / AcevedoR/rpg-maestro
Cloud-readiness: move audio file storage off local disk to object storage
- Ngôn ngữ chính
- TypeScript
- Star
- 0
- Fork
- 0
- Merge trung bình
- 16 phút
- Pull request đã merge (30 ngày)
- 7
Mô tả
## Problem
Audio files are written to and served from the local filesystem of the `audio-file-uploader` process, so the service cannot run with more than one instance.
- `apps/audio-file-uploader/src/app/app.module.ts:17` — multer `diskStorage` writes to `${FILESERVER_PATH}/uploads`
- `apps/audio-file-uploader/src/app/fileUpload/fromYoutube/UploadFromYoutubeService.ts:12` — ffmpeg output goes to the same local directory
- `apps/audio-file-uploader/src/app/fileUpload/FileUploadService.ts:27` and `UploadFromYoutubeService.ts:67` — the public URL is hand-built from `AUDIO_FILE_SERVER_BASE_URL`, i.e. there is exactly one file server
- `apps/audio-file-uploader/src/app/app.module.ts` — `ServeStaticModule` serves the bytes from the same process
A file uploaded through instance A returns 404 on instance B. A load balancer does not fix this; it requires a shared blob store.
## Proposed rework
- Stream uploads directly to object storage (GCS/S3) instead of local disk
- Serve via signed URLs or a CDN origin rather than `ServeStaticModule`
- Keep the URL shape stable, or plan a migration: tracks persisted in Firestore store an **absolute** URL, so existing rows need rewriting
## Scope note
This is one half of the ingestion rework; the other half is the job pipeline (see the related issue). Neither works behind a load balancer on its own.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Start by examining the file upload services in apps/audio-file-uploader/src/app/fileUpload/. The multer configuration in app.module.ts uses diskStorage. Research how to replace this with a storage driver for S3 or GCS. You'll need to update the URL generation logic in FileUploadService.ts and UploadFromYoutubeService.ts to use signed URLs. Check Firestore for existing track records to understand the data migration needed for absolute URLs.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- aws, docker, gcp, nodejs, typescript
- Lĩnh vực
- backend, cloud
- Loại issue
- Tái cấu trúc
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 45/100