Development
OwnTube is a pnpm workspace with a Next.js web app, a Node.js gateway and two Expo apps. The web app and the gateway run locally without Docker, on Node.js 24 or later.
Repository layout
| Path | Contents |
|---|---|
apps/web | Next.js 15 app: pages, tRPC API, Auth.js, Drizzle with SQLite, the recommender and background jobs. |
apps/gateway | The YouTube gateway: metadata, manifests, media, captions and images. |
packages/youtube | YouTube client code used by the gateway. |
packages/playback, packages/contracts | Shared playback logic and the types exchanged between web app and gateway. |
apps/tv | Apple TV, Android TV and Fire TV app (Expo, react-native-tvos). Installed separately. |
apps/ios | iPhone and iPad shell (Expo). Installed separately. |
feeds/ | The public podcast feeds server and WebSub hub. |
hooks/ | Example hook scripts. |
Run locally
corepack enable && corepack prepare pnpm@9.15.9 --activate
pnpm install
cp apps/web/.env.example apps/web/.env # set AUTH_SECRET and GATEWAY_SIGNING_KEY
pnpm run db:migrate
pnpm dev
Start the gateway with the same GATEWAY_SIGNING_KEY in another terminal:
GATEWAY_SIGNING_KEY=… pnpm dev:gateway
The web app looks for the gateway at http://localhost:8080 by default. Open http://localhost:3000.
Scripts
| Command | What it does |
|---|---|
pnpm dev | Next.js dev server |
pnpm build, pnpm start | Production build and server |
pnpm lint, pnpm format | Biome check and format |
pnpm typecheck | TypeScript |
pnpm test | Vitest unit tests |
pnpm test:e2e | Playwright end-to-end tests |
pnpm db:generate, pnpm db:migrate | Create and apply database migrations |
Contributing
Issues and pull requests are welcome on GitHub. Read CONTRIBUTING.md first. Run pnpm lint, pnpm typecheck and pnpm test before opening a pull request.
OwnTube is MIT licensed. It started as a fork of JasonBeucher/owntube.