2.3 KiB
2.3 KiB
Frontend Configuration Guide
Overview
The frontend uses two configuration files to support both local development and production deployment:
config.js- Production configuration (ALWAYS committed to git)config.local.js- Local development configuration (NEVER committed to git)
How It Works
The index.html loads both files in order:
- First loads
config.js(production config) - Then loads
config.local.js(if it exists, overrides production config)
In production, only config.js exists, so production settings are used.
In development, config.local.js overrides the production settings to point to localhost.
Local Development Setup
config.local.js is already created and configured to point to:
- Frontend:
http://localhost:3000 - Backend:
http://localhost:5010
This file is listed in .gitignore and will NOT be committed to git.
Production Deployment
config.js contains production settings:
- Frontend:
https://brandtechsandbox.oliver.solutions/video-query/ - Backend:
https://brandtechsandbox.oliver.solutions/video_query_back
When deploying to production:
- Only
config.jsis deployed (config.local.js is excluded) - The application automatically uses production URLs
- No manual configuration changes needed
Important Notes
- ✅ DO commit
config.js(production config) - ❌ DO NOT commit
config.local.js(local dev config) - The
.gitignorefile ensuresconfig.local.jsis never accidentally committed - If you need to modify production URLs, edit
config.js - If you need to modify local development URLs, edit
config.local.js
Troubleshooting
"Backend is not reachable" in local development
- Check that backend is running:
ps aux | grep "python.*run.py" - Verify backend is listening on port 5010:
ss -tulpn | grep 5010 - Check
config.local.jshas correct URLs - Clear browser cache and hard reload (Ctrl+Shift+R or Cmd+Shift+R)
Changes to config not taking effect
- Hard reload the browser (Ctrl+Shift+R or Cmd+Shift+R)
- Check browser console for config loading messages
- Verify the correct config file is being loaded
CORS errors in browser console
This means the frontend and backend URLs don't match. Check:
config.local.js(orconfig.js) has correct backend URL- Backend CORS settings in
backend/app.pyinclude your frontend URL