- Create .gitea/workflows/ci.yml with 4 sequential jobs - lint: Run ESLint on root configuration - test-backend: Run backend Vitest tests with SQLite - test-frontend: Run frontend Vitest tests - test-e2e: Run Playwright E2E tests (bloqueante) - E2E job automates server startup + Playwright test execution - Configure Gitea Secrets for IGDB, RAWG, TheGamesDB API keys - Add artifact upload for Playwright reports on failure - Update SECURITY.md with CI/CD Secrets setup instructions - Update docs/API_KEYS.md with production Gitea workflow guide - Add tests/gitea-workflow.spec.ts with 12 validation tests - Workflow triggers on push/PR to main and develop branches
3.9 KiB
Obtaining API Keys
This guide explains how to get credentials for each metadata service.
IGDB (Internet Game Database)
IGDB uses OAuth 2.0 via Twitch. Steps:
- Go to Twitch Developer Console
- Sign in with your Twitch account (create one if needed)
- Click "Create Application"
- Name: "Quasar" (or your app name)
- Category: Select relevant category
- Accept terms, click Create
- You'll see:
- Client ID — Copy this
- Click "New Secret" to generate Client Secret — Copy this
- Go to Settings → OAuth Redirect URLs
- Add:
http://localhost:3000/oauth/callback(development) - For production:
https://yourdomain.com/oauth/callback
- Add:
- In your
.envfile:IGDB_CLIENT_ID=your_client_id IGDB_CLIENT_SECRET=your_client_secret - Start Quasar, it will use IGDB automatically
Rate Limit: 4 requests/second
RAWG (Rawg.io)
RAWG has a simpler API Key approach:
- Go to RAWG Settings
- Sign up if needed, then login
- Find "API Key" section
- Click "Create new key" (if needed) or copy existing key
- In your
.envfile:RAWG_API_KEY=your_api_key_here - Start Quasar
Rate Limit: 20 requests/second (free tier)
Note: RAWG requires attribution in UI (include "Powered by RAWG" somewhere visible)
TheGamesDB (thegamesdb.net)
TheGamesDB uses a simple API Key:
- Go to TheGamesDB API
- Find "API Key" section (free registration required)
- Register or login
- Copy your API key
- In your
.envfile:THEGAMESDB_API_KEY=your_api_key_here - Start Quasar
Rate Limit: 1 request/second (free tier)
Testing Without Real Keys
For development/testing:
- Leave API keys as
your_*_herein.env.local - Quasar will gracefully degrade and show limited metadata
- Frontend will still work with manual game entry
Production Deployment
For production:
- Generate new keys on each service (don't reuse dev keys)
- Store keys in Gitea Secrets (for automated CI/CD pipelines)
- Or use environment variables on your hosting provider
- Rotate keys every 3 months
- Monitor rate limits in service dashboards
Gitea Actions CI/CD Setup
To enable automated testing with API keys in Gitea Actions:
1. Store Secrets in Gitea
Navigate to your repository settings:
https://your-gitea-instance/your-org/quasar/settings/secrets/actions
Add these secrets:
IGDB_CLIENT_ID(from Twitch Developer Console)IGDB_CLIENT_SECRET(from Twitch Developer Console)RAWG_API_KEY(from RAWG settings)THEGAMESDB_API_KEY(from TheGamesDB API)
2. Workflow Configuration
The .gitea/workflows/ci.yml workflow automatically:
- ✅ Installs dependencies
- ✅ Runs linting checks
- ✅ Executes backend tests (Vitest)
- ✅ Executes frontend tests (Vitest)
- ✅ Starts backend + frontend servers
- ✅ Runs E2E tests (Playwright) with real metadata APIs
- ✅ Uploads test reports on failure
3. Testing Flow
- Push code to
mainordevelop - Gitea Actions picks up the
.gitea/workflows/ci.yml - Secrets are injected as
IGDB_CLIENT_ID,IGDB_CLIENT_SECRET,RAWG_API_KEY,THEGAMESDB_API_KEY - E2E tests fetch real metadata from APIs (using injected secrets)
- Build fails if any test fails (prevents broken code)
4. Local Development
For local testing, use .env.local:
IGDB_CLIENT_ID=your_local_id
IGDB_CLIENT_SECRET=your_local_secret
RAWG_API_KEY=your_local_key
THEGAMESDB_API_KEY=your_local_key
Note: CI/CD uses Gitea Secrets (not .env files), so never commit real credentials.
Troubleshooting
"IGDB_CLIENT_ID not found" → Check .env file exists and has correct format
"429 Too Many Requests" → Rate limit exceeded, wait and retry
"Invalid API Key" → Copy key exactly (no spaces), verify it's active on service website