Cinema companion monorepo — track movies and shows, build watchlists, and share with friends.
apps/web): TanStack Start on Cloudflare Workers, Better Auth, Postgres (Hyperdrive), TMDB proxyapps/mobile): Expo SDK 56, TanStack DB + expo-sqlite persistence, manual sync gluepackages/db): Shared Drizzle Postgres schema and types| Layer | Technology | Purpose |
|---|---|---|
| Live metadata | TMDB via /api/tmdb/* |
Posters, ratings, discover, search |
| Server library | Postgres + Drizzle | Source of truth for watchlists, watched, social |
| Client library | TanStack DB + SQLite | Offline-first local replica on device |
| Glue | Manual REST (/api/library/*) |
Pull snapshot, push rows — you extend as needed |
| Auth | Better Auth + Postgres | Email/password and Google OAuth |
cd cinefam
pnpm install
cp apps/web/.dev.vars.example apps/web/.dev.vars
cp apps/mobile/.env.example apps/mobile/.env
Start Postgres locally (example):
docker run -d --name cinefam-pg -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=cinefam -p 5432:5432 postgres:16
Run migrations:
pnpm --filter web db:generate
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/cinefam pnpm --filter web db:migrate
pnpm --filter web dev
Opens at http://localhost:3072
pnpm --filter mobile start
Set EXPO_PUBLIC_API_URL to your web dev server.
| Method | Path | Description |
|---|---|---|
| GET | /api/library/snapshot |
Full library pull for authenticated user |
| GET | /api/library/watchlists |
List watchlists |
| POST | /api/library/watchlists |
Create or upsert watchlist |
| DELETE | /api/library/watchlists/:id |
Delete watchlist |
Mobile calls syncLibraryFromServer() in apps/mobile/src/lib/sync/library-api.ts to hydrate local TanStack DB collections.
| Command | Description |
|---|---|
pnpm dev |
Start all dev servers |
pnpm check-types |
Typecheck all packages |
pnpm quality |
Lint + format check |
pnpm --filter web deploy |
Build and deploy web to Cloudflare |