3.4 KiB
3.4 KiB
Setup Checklist
Before You Start
- Docker and Docker Compose installed
- TMDB API key obtained (see TMDB_SETUP.md)
- Git/Gitea repository initialized
Local Development Setup
-
Configure Environment:
cp backend/.env.example backend/.env -
Edit
backend/.env:- Set
TMDB_API_KEYto your actual TMDB API key - Change
JWT_SECRETif desired (optional for dev) - Verify database settings match docker-compose.yml
- Set
-
Start Services:
docker compose up --build -
Verify:
- App accessible at http://localhost:4000
- Can register a new account
- Can search for shows/movies
- Database initialized successfully (check logs)
Production Deployment
-
Prepare Environment Variables:
Create a production
.envfile with:PORT=80 JWT_SECRET=<strong-random-secret> DB_HOST=db DB_USER=root DB_PASSWORD=<strong-database-password> DB_NAME=whats_the_point TMDB_API_KEY=<your-tmdb-key> -
Base64 encode your
.envfor Gitea:# On Linux/Mac: cat .env | base64 -w 0 # On Windows PowerShell: [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes((Get-Content .env -Raw))) -
Configure Gitea Secrets:
PROD_ENV- Base64 encoded environment filePORTAINER_TOKEN- Your Portainer API token
-
Update
prod-compose.yml:- Verify volume paths match your system
- Update image registry URL if needed
- Verify port mappings
-
Verify Gitea Workflow:
- Check
.gitea/workflows/rebuild-prod.yaml - Update
IMAGE_TAGwith your registry URL - Update
ENDPOINT_NAMEto match your Portainer endpoint - Update
STACK_NAMEif desired
- Check
-
Deploy:
- Push to main branch
- Monitor Gitea Actions
- Check Portainer for successful deployment
- Verify app is accessible on production domain/IP
Post-Deployment
- Test registration and login
- Create a test challenge
- Invite a friend (test email/username search)
- Make and validate predictions
- Check leaderboards
- Test on mobile devices
Troubleshooting
Database Connection Issues
- Check if database container is running:
docker ps - Check database logs:
docker logs <db-container-name> - Verify DB credentials in environment variables
TMDB API Not Working
- Verify API key is correct in
.env - Check TMDB API status: https://www.themoviedb.org/
- Review backend logs for API errors
Frontend Not Loading
- Check if backend is serving static files
- Verify frontend built successfully (check Docker logs)
- Clear browser cache
Docker Build Failures
- Ensure all dependencies are in package.json files
- Check Dockerfile syntax
- Verify node_modules are not in build context (.dockerignore)
Maintenance
Database Backups
# Backup
docker exec <db-container> mysqldump -u root -p<password> whats_the_point > backup.sql
# Restore
docker exec -i <db-container> mysql -u root -p<password> whats_the_point < backup.sql
Viewing Logs
# Docker Compose (dev)
docker compose logs -f web
docker compose logs -f db
# Production (Portainer)
# Use Portainer UI to view logs
Updating
- Pull latest changes from repository
- Push to main branch (triggers Gitea workflow)
- Workflow automatically rebuilds and redeploys