2026-08-03 07:07:12 +02:00
# Songs2VID (hosted / SaaS checkout)
2026-07-12 15:40:35 +02:00
2026-08-03 07:07:12 +02:00
Create YouTube videos from an image and audio files. This tree is the **hosted SaaS** codebase (billing, credits, marketing landing).
For the **payment-free self-hosted OSS** product (no Stripe), use Gitea branch `main` / image [`atakanozban/songs2vid:latest` ](https://hub.docker.com/r/atakanozban/songs2vid ) and the docs at [docs.songs2vid.com ](https://docs.songs2vid.com ). Self-host install guides in `website/docs/` describe that OSS path.
2026-07-12 15:40:35 +02:00
## Stack
- Next.js 15 (App Router, TypeScript, Tailwind)
- PostgreSQL + Prisma
- Redis + BullMQ
2026-07-27 16:26:19 +02:00
- NextAuth (Google OAuth 2.0 with YouTube scopes)
2026-07-12 15:40:35 +02:00
- FFmpeg for video encoding
- YouTube Data API v3
2026-08-03 07:07:12 +02:00
## Editions (this SaaS tree)
2026-07-27 16:26:19 +02:00
| Edition | How | Limits |
|---------|-----|--------|
| **Hosted** (default) | Leave `S2VID_EDITION` unset | Free / Pro quotas and API gates |
2026-08-03 07:07:12 +02:00
| **Self-hosted flag** | `S2VID_EDITION=selfhosted` | No video quota, no API rate caps; playlists + API unlocked |
2026-07-27 16:26:19 +02:00
2026-08-03 07:07:12 +02:00
Prefer the published OSS image for new self-host installs. Docker Compose in this tree still sets `S2VID_EDITION=selfhosted` when you run it locally.
2026-07-27 16:26:19 +02:00
## Quick start (Docker)
1. Copy env and set Google OAuth + secrets:
```bash
cp .env.example .env
```
2. Build and run the full stack (web, worker, Postgres, Redis):
```bash
docker compose up -d --build
```
Open [http://localhost:3000 ](http://localhost:3000 ).
Add Google OAuth redirect URI: `http://localhost:3000/api/auth/callback/google` (or your public URL).
## Local development
2026-07-12 15:40:35 +02:00
1. Copy environment variables:
```bash
cp .env.example .env
```
2026-07-27 16:26:19 +02:00
2. Start Postgres and Redis only:
2026-07-12 15:40:35 +02:00
```bash
2026-07-27 16:26:19 +02:00
docker compose -f docker-compose.dev.yml up -d
2026-07-12 15:40:35 +02:00
```
2026-07-27 16:26:19 +02:00
3. Install dependencies and push the schema:
2026-07-12 15:40:35 +02:00
```bash
npm install
npm run db:push
```
4. Configure Google OAuth in [Google Cloud Console ](https://console.cloud.google.com/ ):
- Enable YouTube Data API v3
- Create OAuth 2.0 credentials
- Add redirect URI: `http://localhost:3000/api/auth/callback/google`
- Set `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` in `.env`
2026-07-27 16:26:19 +02:00
5. Optional for unlimited local use: `S2VID_EDITION=selfhosted` in `.env`
2026-07-12 15:40:35 +02:00
2026-07-27 16:26:19 +02:00
6. Start the app, worker, and docs:
2026-07-12 15:40:35 +02:00
```bash
2026-07-27 16:26:19 +02:00
npm run dev:all
2026-07-12 15:40:35 +02:00
```
2026-07-27 16:26:19 +02:00
- App: http://localhost:3000
- Docs: http://localhost:3001
2026-07-12 15:40:35 +02:00
2026-07-27 16:26:19 +02:00
Or run them separately with `npm run dev` , `npm run worker` , and `npm run docs:dev` .
## Authentication
Users sign in with Google via OAuth 2.0. The app handles YouTube channel connection automatically end users never enter API keys for YouTube.
## Self-hosted edition
Set `S2VID_EDITION=selfhosted` (Docker Compose does this by default):
- Unlimited video allowance
- API access and playlists
- Art-track layouts with blur backgrounds and fine-tuning (padding, gaps, text offsets)
- Custom watermarks (text/logo), curated or uploaded fonts
Composition details: see `website/docs/video-editing.md` (or open Video editing in the docs site after `npm run docs:dev` ).
2026-07-12 15:40:35 +02:00
## Scripts
2026-07-27 16:26:19 +02:00
- `npm run dev` - Next.js dev server
- `npm run worker` - Background job processor
- `npm run dev:all` - App (3000) + worker + docs (3001) together
- `npm run db:push` - Push Prisma schema to database
- `npm run build` - Production build
- `npm run docs:dev` - Documentation site only (Docusaurus on port 3001)
## Documentation
Docs live in `website/` (Docusaurus). API reference:
```bash
npm run docs:dev
```
Open [http://localhost:3001/docs/api/overview ](http://localhost:3001/docs/api/overview ).
The app “Full API docs” link and `/dashboard/api-docs` redirect use local docs when `NEXTAUTH_URL` is localhost (or set `NEXT_PUBLIC_DOCS_URL` ).
## Source
- Gitea: https://git.atakanozban.com/Songs2VID
- Docker Hub: https://hub.docker.com/r/atakanozban/songs2vid