Installation Guide
This comprehensive guide covers everything you need to set up Film Fanatic with all features enabled, including authentication and cloud synchronization.Prerequisites
Required Software
Node.js 20+
pnpm Package Manager
Film Fanatic uses pnpm for dependency management.Install pnpm:Verify installation:
Git
Required API Keys and Accounts
TMDB API Access Token (Required)
TMDB API Access Token (Required)
The Movie Database (TMDB) provides all movie and TV show data.Setup Steps:
- Create a free account at themoviedb.org
- Navigate to Settings → API
- Request an API key (select “Developer” for non-commercial use)
- Copy the API Read Access Token (v4 auth, not the v3 API Key)
The access token is a long Bearer token that starts with
eyJ. This is different from the shorter v3 API key.Convex Account (Optional for development)
Convex Account (Optional for development)
Convex powers the real-time backend and cloud sync.Setup Steps:
- Sign up at convex.dev
- Create a new project
- Run
npx convex devin your project to link it - Copy the deployment URL and deploy key from the dashboard
Clerk Account (Optional for development)
Clerk Account (Optional for development)
Clerk provides secure authentication and user management.Setup Steps:
- Sign up at clerk.com
- Create a new application
- Choose your authentication methods (Email, Google, etc.)
- Copy the publishable key and secret key from the dashboard
- Configure the Clerk issuer URL in Convex settings
Installation Process
Step 1: Clone the Repository
Clone Film Fanatic from the official GitHub repository:Step 2: Install Dependencies
Install all required npm packages:- Framework: TanStack Start, React 19, Nitro
- Backend: Convex client and React Query integration
- Auth: Clerk React SDK
- UI: Tailwind CSS 4.0, Radix UI, shadcn/ui components
- Dev tools: Biome, TypeScript, Vite
The first installation may take 2-3 minutes depending on your internet connection.
Step 3: Environment Configuration
Create a.env.local file in the project root with your API keys and configuration:
Step 4: Set Up Convex (Optional)
If you’re using Convex for backend functionality:- Prompt you to log in to Convex
- Link your local project to your Convex deployment
- Deploy the schema and functions from the
/convexdirectory - Start watching for changes
Step 5: Configure Clerk + Convex Integration (Optional)
If using both Clerk and Convex:-
In Clerk Dashboard:
- Go to your application settings
- Copy your issuer URL (usually
https://<your-domain>.clerk.accounts.dev)
-
In
.env.local: -
In Convex Dashboard:
- Go to Settings → Environment Variables
- Add
CLERK_ISSUER_URLwith the same value
convex/auth.config.ts:
Step 6: Start Development
Launch the full development environment:- Vite dev server on
http://localhost:3000(frontend) - Convex dev (backend functions with hot reload)
Project Structure Overview
Understanding the codebase structure:Database Schema
Film Fanatic uses Convex with the following schema (defined inconvex/schema.ts):
Users Table
Watch Items Table
Episode Progress Table
Build for Production
When you’re ready to deploy:- Run TypeScript type checking
- Build the Vite bundle with optimizations:
- Terser minification
- Code splitting (vendor, tanstack, convex, clerk chunks)
- Tree shaking
- Console removal in production
.output/ directory.
Troubleshooting
Convex deployment fails
Convex deployment fails
Issue:
npx convex dev fails with authentication errorsSolutions:- Ensure you’re logged in:
npx convex login - Check your Convex dashboard has the correct project
- Verify
CONVEX_DEPLOY_KEYin.env.localmatches your project - Try
npx convex dev --onceto force a single deployment
Clerk authentication not working
Clerk authentication not working
Issue: Sign in/up buttons don’t work or return errorsSolutions:
- Verify both
VITE_CLERK_PUBLISHABLE_KEYandCLERK_SECRET_KEYare set - Check that your Clerk application is in development mode
- Ensure
CONVEX_CLERK_ISSUER_URLmatches your Clerk domain exactly - Restart the dev server after changing environment variables
- Check Clerk dashboard → Sessions → Settings for allowed domains
TMDB images not loading
TMDB images not loading
Issue: Movie posters and images show broken image placeholdersSolutions:
- Verify
VITE_TMDB_ACCESS_TOKENis the v4 Read Access Token (not v3 API key) - Check the token hasn’t expired
- Ensure
VITE_TMDB_API_URL=https://api.themoviedb.org/3is set correctly - Test the API directly:
TypeScript errors on build
TypeScript errors on build
Issue:
pnpm build fails with TypeScript errorsSolutions:- Run
pnpm checkto see all type errors - Ensure all dependencies are installed:
pnpm install - Clear TypeScript cache:
rm -rf node_modules/.vite - Check
tsconfig.jsonis correctly configured - Update TypeScript:
pnpm add -D typescript@latest
Port conflicts
Port conflicts
Issue: Port 3000 is already in useSolutions:
- Change the port in
package.json: - Or kill the process using port 3000:
Module resolution errors
Module resolution errors
Issue: Import errors like
Cannot find module '@/components/...'Solutions:- Verify
tsconfig.jsonhas the path alias: - Check
vite.config.tsincludesvite-tsconfig-pathsplugin - Restart your IDE/editor TypeScript server
- Clear cache:
rm -rf node_modules/.vite
Development Scripts Reference
All available npm scripts frompackage.json:
| Command | Description |
|---|---|
pnpm dev | Start both Vite and Convex dev servers in parallel |
pnpm dev:vite | Start only the Vite frontend dev server (port 3000) |
pnpm dev:convex | Start only the Convex backend dev server |
pnpm build | Type check and build for production |
pnpm serve | Build and start production server |
pnpm vite:serve | Preview production build locally |
pnpm format | Format code with Biome |
pnpm lint | Lint code with Biome (max 20 diagnostics) |
pnpm lint:fix | Auto-fix linting issues |
pnpm check | Run Biome check and TypeScript type checking |
pnpm check:fix | Auto-fix all checkable issues |
Next Steps
Configuration
Customize themes, features, and settings
Development Guide
Learn about the codebase architecture
API Integration
Working with TMDB and Convex APIs
Configuration
Configure environment variables and services
