OwnTube

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

PathContents
apps/webNext.js 15 app: pages, tRPC API, Auth.js, Drizzle with SQLite, the recommender and background jobs.
apps/gatewayThe YouTube gateway: metadata, manifests, media, captions and images.
packages/youtubeYouTube client code used by the gateway.
packages/playback, packages/contractsShared playback logic and the types exchanged between web app and gateway.
apps/tvApple TV, Android TV and Fire TV app (Expo, react-native-tvos). Installed separately.
apps/iosiPhone 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

CommandWhat it does
pnpm devNext.js dev server
pnpm build, pnpm startProduction build and server
pnpm lint, pnpm formatBiome check and format
pnpm typecheckTypeScript
pnpm testVitest unit tests
pnpm test:e2ePlaywright end-to-end tests
pnpm db:generate, pnpm db:migrateCreate 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.