Spaces:
Runtime error
Runtime error
|
Download DEPLOY_API.md from dreamtune7/dreamtune-api: direct link, hf CLI and curl.
- Browser
- Download file 1.46 kB
-
https://huggingface.co/spaces/dreamtune7/dreamtune-api/resolve/main/DEPLOY_API.md
- Command line
-
hf download hf://spaces/dreamtune7/dreamtune-api/DEPLOY_API.md
-
curl -L -o DEPLOY_API.md https://huggingface.co/spaces/dreamtune7/dreamtune-api/resolve/main/DEPLOY_API.md
1.46 kB
DreamTune API deploy
Best option for the APK
Deploy the backend to Render or Railway and rebuild the Android app with a public HTTPS API URL.
The APK must not use localhost:4000, because on a phone localhost means the phone itself, not your PC.
Render
- Push this project to GitHub.
- In Render, create a new Blueprint from the repository.
- Render will read
render.yamland create:dreamtune-apidreamtune-postgres
- Add secret environment variables in Render:
PUBLIC_API_URL=https://YOUR_RENDER_SERVICE.onrender.comSMTP_PASS=your_gmail_app_passwordCLOUDINARY_URL=cloudinary://API_KEY:API_SECRET@CLOUD_NAMESPOTIFY_CLIENT_ID=...SPOTIFY_CLIENT_SECRET=...
- Check:
https://YOUR_RENDER_SERVICE.onrender.com/api/health
Rebuild Android APK for the public API
Create .env.production locally:
VITE_API_URL=https://YOUR_RENDER_SERVICE.onrender.com
Then rebuild:
npm run android:debug
Or build release from Android:
npm run android:sync
cd android
gradlew.bat assembleRelease
Music and cover storage
When CLOUDINARY_URL is set, uploaded covers/audio and YouTube-downloaded audio are stored in Cloudinary.
That keeps files alive after Render redeploys.
Without Cloudinary, files fall back to local folders:
public/uploadspublic/media
Local folders are okay for development, but not reliable for production cloud hosting.