-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
127 lines (113 loc) · 3.61 KB
/
Copy pathsetup.bat
File metadata and controls
127 lines (113 loc) · 3.61 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
@echo off
REM StudyBuddi Setup Script for Windows
REM This script helps set up the development environment for new contributors
echo ======================================
echo StudyBuddi Development Setup
echo ======================================
echo.
REM Check if Node.js is installed
echo Checking prerequisites...
where node >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo [ERROR] Node.js is not installed
echo Please install Node.js from https://nodejs.org/
pause
exit /b 1
)
for /f "tokens=*" %%i in ('node --version') do set NODE_VERSION=%%i
echo [OK] Node.js %NODE_VERSION% found
REM Check if npm is installed
where npm >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo [ERROR] npm is not installed
pause
exit /b 1
)
for /f "tokens=*" %%i in ('npm --version') do set NPM_VERSION=%%i
echo [OK] npm %NPM_VERSION% found
REM Check if MySQL is installed
where mysql >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo [WARNING] MySQL is not installed or not in PATH
echo Please install MySQL from https://dev.mysql.com/downloads/installer/
) else (
echo [OK] MySQL found
)
echo.
echo ======================================
echo Installing dependencies...
echo ======================================
call npm install
if %ERRORLEVEL% NEQ 0 (
echo [ERROR] Failed to install dependencies
pause
exit /b 1
)
echo [OK] Dependencies installed successfully
echo.
echo ======================================
echo Generating HTTPS certificates...
echo ======================================
echo For cross-device WebRTC testing with camera access...
echo.
call node generate-certs.js
if %ERRORLEVEL% NEQ 0 (
echo [WARNING] Failed to generate certificates (optional)
echo You can still use HTTP with localhost
) else (
echo [OK] Certificates generated successfully
)
echo.
echo ======================================
echo Setting up environment variables...
echo ======================================
REM Create .env file if it doesn't exist
if not exist .env (
copy .env.example .env
echo [OK] Created .env file from .env.example
echo [WARNING] Please update .env with your MySQL credentials
) else (
echo [WARNING] .env file already exists, skipping...
)
echo.
echo ======================================
echo Database Setup
echo ======================================
echo To set up the database, run the following command:
echo mysql -u root -p ^< server/models/schema.sql
echo.
echo Or manually in MySQL:
echo 1. mysql -u root -p
echo 2. source server/models/schema.sql
echo.
echo ======================================
echo Setup Complete!
echo ======================================
echo.
echo Next steps:
echo 1. Update .env with your MySQL credentials
echo 2. Create the database: mysql -u root -p ^< server/models/schema.sql
echo 3. Start development: npm run dev
echo.
echo Available commands:
echo npm run dev - Start both frontend and backend (HTTP)
echo npm run dev:https:win - Start with HTTPS (cross-device testing)
echo npm run client - Start only frontend (port 3000)
echo npm run server - Start only backend (port 5000)
echo npm run build - Build for production
echo npm run generate-certs - Generate HTTPS certificates
echo.
echo Features:
echo - Real-time counter synchronization with Socket.IO
echo - Live chat messaging
echo - WebRTC peer-to-peer video matching
echo - Automatic user matchmaking
echo.
echo WebRTC Requirements:
echo - HTTPS or localhost (required for camera/microphone access)
echo - Modern browser with WebRTC support (Chrome, Firefox, Safari, Edge)
echo - Microphone and camera permissions
echo.
echo Happy coding!
echo.
pause