尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗A Tinder-style movie discovery app. Swipe right to like, left to skip, up to mark as watched. The more you swipe, the smarter it gets — FilmDice learns your taste and injects a personalized ⭐ For You recommendation every 10 cards.
Built with a FastAPI backend and a Next.js frontend, backed by The Movie Database (TMDB) API. Installable as a PWA on Android.
| Swipe | Action | Effect |
|---|---|---|
| Right | Like | Added to liked list; permanent exclusion from future picks |
| Left | Skip | Soft skip; movie may resurface after suppression window |
| Up | Watched | Logged as watched; suppressed for 90 days |
localStorage UUID — no sign-in required| Filter | Options |
|---|---|
| Sort | Popularity · Highest Rated · Newest First |
| Region | 51 countries across all continents, or Any Region |
| Genres | All TMDB genres (multi-select pills) |
| Decade | 1960s – 2020s (multi-select) |
| Rating | Dual-handle slider 0 – 10 |
| Content Rating | G · PG · PG-13 · R · NC-17 |
| Max Runtime | Any · 90m · 120m · 150m · 180m |
| Streaming Only | Toggle — only shows movies on a subscription service |
pool_pre_ping=True keeps DB connections resilient across Docker restarts| Layer | Technology |
|---|---|
| Frontend | Next.js 16 (App Router), Tailwind CSS v4, TypeScript |
| Auth | Auth.js v5 (NextAuth) with Google OAuth |
| Backend | FastAPI, Python 3.13 |
| Database | PostgreSQL (Docker), SQLAlchemy async, asyncpg |
| HTTP Client | httpx (shared async client) |
| External API | The Movie Database (TMDB) v3/v4 |
| Containerization | Docker Compose |
FilmDice/
├── start.ps1 # One-command startup (Windows)
├── stop.ps1 # Stops all services
├── movie-randomizer-backend/ # FastAPI API
│ ├── app/
│ │ ├── main.py # Routes
│ │ ├── schemas.py # Pydantic models
│ │ ├── models.py # SQLAlchemy ORM
│ │ ├── services.py # Preference scoring logic
│ │ ├── tmdb_client.py # TMDB API client
│ │ ├── db.py # Async DB session
│ │ └── config.py # Environment config
│ ├── docker-compose.yml
│ └── requirements.txt
│
└── movie-randomizer-frontend/ # Next.js app
├── next.config.example.ts # Config template (copy to next.config.ts)
├── auth.ts # Auth.js v5 config (Google OAuth)
├── app/
│ ├── page.tsx # Discover page (swipe UI)
│ ├── watchlist/ # Liked + Watched tabs
│ └── api/auth/ # Auth.js route handler
├── components/
│ ├── MovieCard.tsx # Swipeable card (left/right/up)
│ ├── FilterPanel.tsx # Slide-out filter drawer
│ ├── DiceLoader.tsx # Loading animation
│ ├── RangeSlider.tsx # Dual-handle slider
│ ├── TrailerModal.tsx # YouTube embed modal
│ ├── Navbar.tsx # Sign in/out + navigation
│ ├── Providers.tsx # SessionProvider wrapper
│ └── ErrorBoundary.tsx # Top-level error fallback
├── hooks/
│ └── useSwipe.ts # Pointer-events swipe hook (left/right/up)
└── lib/
├── api.ts # API functions
├── types.ts # Shared TypeScript types
└── userId.ts # Anonymous user ID (localStorage)
git clone https://github.com/cbryant3/filmdice.git
cd filmdice
.\start.ps1
The script checks prerequisites, creates the Python venv, installs dependencies, starts PostgreSQL via Docker, and opens the backend and frontend in separate terminals.
To also expose the app on your local WiFi (for phone access):
.\start.ps1 -Network
This detects your machine's IP, patches the frontend config, and starts both services bound to 0.0.0.0. Open http://<your-ip>:3000 on any device on the same network.
Backend — create movie-randomizer-backend/.env:
TMDB_API_KEY=your_tmdb_api_key_here
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/moviedb
Get a free TMDB API key at themoviedb.org/settings/api.
cd movie-randomizer-backend
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # macOS/Linux
pip install -r requirements.txt
docker compose up -d
python -m uvicorn app.main:app --reload
API docs: http://localhost:8000/docs
Frontend — copy the config template and create .env.local:
cp movie-randomizer-frontend/next.config.example.ts movie-randomizer-frontend/next.config.ts
Create movie-randomizer-frontend/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000
AUTH_SECRET=your_random_secret_here
AUTH_GOOGLE_ID=your_google_client_id
AUTH_GOOGLE_SECRET=your_google_client_secret
Get Google credentials at console.cloud.google.com — add http://localhost:3000/api/auth/callback/google as an authorized redirect URI.
cd movie-randomizer-frontend
npm install
npm run dev
App: http://localhost:3000
.\start.ps1 -Networkhttp://<your-ip>:3000 in Chrome on your Android device| Method | Endpoint | Description |
|---|---|---|
POST | /random-movie | Get a filtered random movie |
POST | /for-you | Get a preference-matched movie |
POST | /interactions | Record a like / skip / watch |
DELETE | /interactions/{user_id}/{movie_id} | Remove from history |
GET | /users/{user_id}/history | Interaction history |
GET | /users/{user_id}/preferences | Learned genre/decade scores |
GET | /genres | All TMDB genre IDs and names |
GET | /movies/{id} | Full metadata for a single movie |
Every push runs the full test suite on GitHub Actions (.github/workflows/ci.yml).
Backend (movie-randomizer-backend/tests, pytest): 48 tests against a real PostgreSQL database, with TMDB replaced by an in-memory fake. Covers rolling and filters, repeat suppression, swipes and lists, undo, For You, Delete my data, the one-year cleanup, the public stats, CORS rules, and rate limits.
cd movie-randomizer-backend
pip install -r requirements-dev.txt
TEST_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/filmdice_test python -m pytest
Frontend (movie-randomizer-frontend/e2e, Playwright): 39 browser tests, each run at phone and desktop size, against a production build with the backend mocked. Covers swiping and gestures, undo, filters, cold-start / error / rate-limit screens, Liked and Watched with details, info pages, Delete my data, the stats page, and no sideways scrolling.
cd movie-randomizer-frontend
npm run typecheck && npm run lint
npx playwright install chromium
npm run test:e2e