Proxy Pool Startup Scripts
File List
- start_backend.bat - Start backend service
- start_frontend.bat - Start frontend service
- stop_all.bat - Stop all services
Quick Start
Start Services Separately
- Backend: Double-click
start_backend.bat - Frontend: Double-click
start_frontend.bat
Stop Services
Double-click stop_all.bat to stop all services
Script Features
Smart Process Management
- Automatically detect and stop running processes
- Prevent duplicate startup of multiple instances
- Automatically clean up port conflicts
Log Management
- All output written to log files
- Backend log:
backend.log - Frontend log:
frontend.log - Logs include timestamps for troubleshooting
PID Management
- Automatically record process ID to PID files
- Facilitates subsequent service stopping
- Automatically clean up PID files after process stops
Port Cleanup
- Automatically detect and clean up port conflicts
- Backend port: 3000
- Frontend port: 8080
Access Addresses
After successful startup:
- Backend API: http://localhost:3000
- Frontend UI: http://localhost:8080
Manual Operations
View Logs
# View backend log
type backend.log
# View frontend log
type frontend.log
Manual Stop Process
# View PID file content
type backend.pid
type frontend.pid
# Stop process using PID
taskkill /F /PID <ProcessID>
Check Port Usage
# Check backend port
netstat -ano | findstr :3000
# Check frontend port
netstat -ano | findstr :8080
Log Examples
backend.log
[13:30:15.00] ========================================
[13:30:15.00] Starting backend service...
INFO: Started server process [12345]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:3000
frontend.log
[13:30:20.00] ========================================
[13:30:20.00] Starting frontend service...
VITE v5.0.0 ready in 1234 ms
➜ Local: http://localhost:8080/
➜ Network: use --host to expose
Notes
- First-time frontend startup: If dependencies are not installed, the script will automatically run
npm install - Virtual environment: Ensure backend uses Python virtual environment (venv)
- Firewall: Ensure firewall allows ports 3000 and 8080
- Antivirus: Some antivirus software may block scripts, need to add to whitelist
Troubleshooting
Backend Won't Start
- Check if Python virtual environment is correctly installed
- View
backend.loglog file - Confirm port 3000 is not in use
- Check if dependency packages are complete:
venv\Scripts\pip list
Frontend Won't Start
- Check if Node.js is installed:
node --version - View
frontend.loglog file - Confirm port 8080 is not in use
- Manually install dependencies: Enter frontend directory and run
npm install
Process Won't Stop
- Manually find process:
tasklist | findstr python - Force stop:
taskkill /F /IM python.exe - Check port:
netstat -ano | findstr :3000
Advanced Usage
Modify Ports
- Backend: Modify port number in
api_server.py - Frontend: Modify port number in
vite.config.js - After modification, need to sync update port checking logic in scripts
Custom Log Location
- Modify
LOG_FILEvariable in scripts - Ensure directory exists and has write permissions
Technical Support
If you encounter issues, please check:
- Log files (backend.log, frontend.log)
- PID files (backend.pid, frontend.pid)
- Port usage (netstat -ano)
- Process list (tasklist)