forked from pretorin-ai/simple-crm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.bat
More file actions
100 lines (83 loc) · 2.34 KB
/
dev.bat
File metadata and controls
100 lines (83 loc) · 2.34 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
@echo off
REM Simple CRM Development Launcher for Windows
REM This script starts both the backend and frontend services
echo.
echo ========================================
echo Starting Simple CRM Development Environment
echo ========================================
echo.
REM Check if Python is installed
python --version >nul 2>&1
if errorlevel 1 (
echo Error: Python is not installed. Please install Python 3.8+ first.
pause
exit /b 1
)
REM Check if Node.js is installed
node --version >nul 2>&1
if errorlevel 1 (
echo Error: Node.js is not installed. Please install Node.js first.
pause
exit /b 1
)
REM Backend setup
echo Setting up backend...
cd backend
REM Create virtual environment if it doesn't exist
if not exist "venv" (
echo Creating Python virtual environment...
python -m venv venv
)
REM Activate virtual environment
call venv\Scripts\activate.bat
REM Install backend dependencies if needed
if not exist "venv\.installed" (
echo Installing backend dependencies...
pip install -q -r requirements.txt
type nul > venv\.installed
)
REM Check for .env file
if not exist ".env" (
echo No .env file found. Copying from .env.example...
copy .env.example .env
echo Please update SECRET_KEY in backend\.env for production use!
)
REM Start backend in background
echo Starting backend server on http://localhost:8000...
start /B python run.py > ..\backend.log 2>&1
cd ..
REM Frontend setup
echo Setting up frontend...
REM Install frontend dependencies if needed
if not exist "node_modules" (
echo Installing frontend dependencies...
call npm install
)
REM Check for .env.local file
if not exist ".env.local" (
echo No .env.local file found. Copying from .env.local.example...
copy .env.local.example .env.local
)
REM Give backend a moment to start
timeout /t 2 /nobreak >nul
echo.
echo ========================================
echo Simple CRM is starting!
echo ========================================
echo.
echo Frontend: http://localhost:5173
echo Backend: http://localhost:8000
echo API Docs: http://localhost:8000/docs
echo.
echo Demo Login:
echo Email: demo@pretorin.com
echo Password: demo123
echo.
echo Press Ctrl+C to stop all services
echo ========================================
echo.
REM Start frontend (this will run in foreground)
call npm run dev
echo.
echo Services stopped
pause