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
Section titled “Repository layout”| Path | Contents |
|---|---|
apps/web |
Next.js 15: 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 |
The YouTube client the gateway uses. |
packages/playback, packages/contracts |
Playback logic and the types shared by 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 app (Expo). Installed separately. |
feeds/ |
The public feeds server and WebSub hub. |
hooks/ |
Example hook scripts. |
site/ |
This website (Astro and Starlight). Installed separately. |
Run from source
Section titled “Run from source”corepack enable && corepack prepare pnpm@9.15.9 --activatepnpm installcp apps/web/.env.example apps/web/.env # set AUTH_SECRET and GATEWAY_SIGNING_KEYpnpm run db:migratepnpm devStart the gateway in a second terminal, with the same signing key:
GATEWAY_SIGNING_KEY=… pnpm dev:gatewayThe web app looks for the gateway at http://localhost:8080. Open http://localhost:3000.
Scripts
Section titled “Scripts”| Command | What it does |
|---|---|
pnpm dev |
Next.js dev server |
pnpm dev:gateway |
Gateway with reload on change |
pnpm build, pnpm start |
Production build and server |
pnpm lint, pnpm format |
Biome |
pnpm typecheck |
TypeScript, all packages |
pnpm test |
Vitest, all packages |
pnpm test:e2e |
Playwright |
pnpm db:generate, pnpm db:migrate |
Create and apply migrations |
Contributing
Section titled “Contributing”Issues and pull requests are welcome on GitHub. Read CONTRIBUTING.md first, and 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.