-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-dev-server.bat
More file actions
50 lines (41 loc) · 1.15 KB
/
start-dev-server.bat
File metadata and controls
50 lines (41 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
@echo off
chcp 65001 >nul
echo ===== Real-time Voting System Development Environment =====
REM Environment variables
set DB_HOST=localhost
set DB_PORT=13306
set DB_USER=voteuser
set DB_PASSWORD=votepassword
set DB_NAME=votingdb
set REDIS_ADDR=localhost:16379
set REDIS_PASSWORD=redispassword
set REDIS_DB=0
set REDIS_MOCK=false
REM High concurrency config
set ENABLE_RATE_LIMIT=true
set GLOBAL_RATE_LIMIT=100
set USER_RATE_LIMIT=10
REM Server config
set SERVER_PORT=8090
set API_PREFIX=/api
REM Start middleware services (MySQL and Redis)
echo Starting middleware services...
docker-compose -f docker-compose-dev.yml up -d mysql redis
REM Wait for middleware to start
echo Waiting for middleware to start...
timeout /t 5 /nobreak >nul
REM Start backend server
echo Starting backend server...
cd backend
start cmd /k "go run main.go"
cd ..
REM Start frontend development server
echo Starting frontend development server...
cd frontend
start cmd /k "npm install && npm start"
cd ..
echo ===== All services started =====
echo Frontend dev server: http://localhost:3000
echo Backend API server: http://localhost:8090/api
echo Press any key to close this window...
pause >nul