Frontend (install once if you haven't):
cd frontend
npm install
npm startBackend (dev server):
cd server\index.js
node index.jsBuild frontend and serve (production):
cd frontend
npm run build
npm run serveDocker build for frontend (from repo root):
docker build -f frontend/dockerfile/Dockerfile -t storyforge-frontend:latest frontend
docker run -p 3000:3000 storyforge-frontend:latestQuick start
-
Install dependencies and ensure ffmpeg is available. On Windows you can install a static build (BtbN) and add it to PATH, or set
FFMPEG_PATHbefore starting the server. -
Start the local mock server (from repo root):
$env:FFMPEG_PATH='C:\path\to\ffmpeg.exe' # optional if ffmpeg on PATH
npm run server- Verify the dev flow (uploads + sample video):
npm run verifyCI
- A GitHub Action
verify-dev-flow.ymlis provided to run the verification script in CI. It installs ffmpeg and runsnpm run verify.
Production notes
- Docker: a
Dockerfilefor the server exists atserver/index.js/Dockerfile. Build withdocker build -t storyforge-backend ./server/index.jsand run withdocker run -p 5000:5000 -e PORT=5000 storyforge-backend. - Process manager:
ecosystem.config.jsis included for PM2 cluster mode. Example:
npm install -g pm2
pm2 start ecosystem.config.js
pm2 status- Monitoring:
/metricsendpoint exposes Prometheus metrics (process, GC, HTTP durations). Configure Prometheus to scrape it.
Queue & Redis
- This project includes a basic Bull queue in
server/index.js/queue.jsfor export jobs. It expects Redis available atREDIS_URL(defaults toredis://127.0.0.1:6379). - To run Redis locally on Windows, use Docker:
docker run -p 6379:6379 redis. - Enqueue an export via the API (
/export/youtubeor/export/download) and check job status at/export/status/:id.
YouTube OAuth & setup
- To enable real YouTube uploads you must create a Google Cloud project and OAuth credentials (Web application). Set the following environment variables in your
.envor process env:YOUTUBE_CLIENT_IDYOUTUBE_CLIENT_SECRETYOUTUBE_REDIRECT_URI(e.g.,http://localhost:5000/youtube/callback)
- Obtain the consent URL from
/youtube/auth, visit it, allow access, and Google will redirect to/youtube/callback?code=...which the server will exchange and persist tokens toserver/index.js/youtube_tokens.json.