This project now uses centralized server configuration to avoid hardcoding the server IP address in multiple files.
The main configuration is stored in config.env:
# Server Configuration
SERVER_IP=<your_server_ip>
BACKEND_PORT=8000
FRONTEND_PORT=3000
# Backend URL (automatically constructed from SERVER_IP and BACKEND_PORT)
VITE_BACKEND_URL=http://<your_server_ip>:8000To change the server IP address, simply update the SERVER_IP variable in config.env:
# Edit config.env
SERVER_IP=your.new.server.ip
VITE_BACKEND_URL=http://your.new.server.ip:8000The following files now reference the centralized configuration:
-
Backend Settings (
backend/src/intern_bot/settings/settings.py)- CORS configuration uses
SERVER_IPandFRONTEND_PORT
- CORS configuration uses
-
Docker Compose Files (
docker-compose.yml,docker-compose.dev.yml)- Frontend environment uses
VITE_BACKEND_URLwith fallback
- Frontend environment uses
-
Frontend Configuration (
frontend/vite.config.ts)- Proxy target uses
VITE_BACKEND_URLenvironment variable
- Proxy target uses
-
Nginx Configuration (
frontend/nginx.conf)- Server name uses
SERVER_IPwith fallback
- Server name uses
-
Setup Script (
setup.sh)- Loads configuration from
config.envand uses it for setup
- Loads configuration from
The following environment variables are used:
SERVER_IP: The main server IP addressBACKEND_PORT: Backend service port (default: 8000)FRONTEND_PORT: Frontend service port (default: 3000)VITE_BACKEND_URL: Complete backend URL for frontend
All configurations include fallback values to ensure the application works even if the configuration file is missing:
- Default
SERVER_IP:<your_server_ip> - Default
VITE_BACKEND_URL:http://<your_server_ip>:8000
- For Development: Update
config.envand run./setup.sh - For Production: Set environment variables or update
config.envbefore deployment - For Docker: Environment variables are automatically loaded from
config.envif present