Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Description
This PR implements a complete AI-powered audio/video dubbing feature using Murf.ai integration. Users can upload audio or video files and dub them into 21 different languages while preserving the original voice characteristics. The feature includes real-time progress tracking via Server-Sent Events (SSE), media storage with Supabase, and credit-based billing.
Key Features:
useDubbing) for clean state management🎯 Type of Change
🔗 Related Issue
Closes #14
🧪 Testing
📋 Checklist
📸 Screenshots (if applicable)
Create Dub Page:
Dubbing Detail Page:
🔧 Technical Details
Backend Architecture (
apps/api)New Files:
dubbing.module.ts- NestJS module registrationdubbing.controller.ts- REST endpoints with SSE streamingdubbing.service.ts- Core business logic and Murf.ai integrationAPI Endpoints:
POST/api/v1/dubbingGET/api/v1/dubbingGET/api/v1/dubbing/:idGET/api/v1/dubbing/status/:projectIdDELETE/api/v1/dubbing/:idDubbing Flow:
Frontend Architecture (
apps/web)New Files:
hooks/useDubbing.ts- Custom hook managing all dubbing stateapp/dashboard/dubbing/new/page.tsx- Create dubbing pageapp/dashboard/dubbing/[id]/page.tsx- Dubbing detail pagelib/api/getDubbings.ts- API client functionsState Management:
Shared Package (
packages/validations)Supported Languages: English, Chinese, Dutch, Finnish, French, German, Greek, Hindi, Croatian, Indonesian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Romanian, Russian, Slovak, Spanish, Turkish
🚀 Deployment Notes
Environment Variables Required:
Database Changes:
dubbing_projectstable with new columns:is_video(boolean)media_name(string)Supabase Storage:
dubbing_mediabucket for both original and dubbed files🔍 Review Notes
Please focus on:
dubbing.service.ts- exponential backoff and cleanup on disconnectuseDubbinghook - especially EventSource error handlingupdate_user_creditsRPC📊 Performance Impact
The SSE polling uses exponential backoff (5s → 20s max) to reduce API calls while maintaining responsiveness.
🔒 Security Considerations
No security implications
Security improvement
Potential security concern (explain below)
All endpoints protected with
SupabaseAuthGuardUser isolation enforced via
user_idchecks in all queriesMedia URLs are public but use random UUIDs for obfuscation
Commits in this PR:
601177e- Update UI with custom hook and upload audio/video file to supabase storagedf60d71- Add backend controller for audio and video dubbing route + controller with murf.ai19fb79a- Update frontend pages (list, create, detail), add styling, tabs, loading states627feef- Add media naming and original media preview to dubbing