-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
77 lines (67 loc) · 1.93 KB
/
start.bat
File metadata and controls
77 lines (67 loc) · 1.93 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
@echo off
echo 🧪 API Zero to Hero - Starting Local Setup
echo.
REM Check Python version
echo Checking Python version...
python --version >nul 2>&1
if errorlevel 1 (
echo ❌ Python is not installed. Please install Python 3.11 or higher.
pause
exit /b 1
)
echo ✅ Python found
echo.
REM Create virtual environment if it doesn't exist
if not exist "venv" (
echo Creating virtual environment...
python -m venv venv
echo ✅ Virtual environment created
) else (
echo ✅ Virtual environment already exists
)
echo.
REM Activate virtual environment
echo Activating virtual environment...
call venv\Scripts\activate.bat
echo ✅ Virtual environment activated
echo.
REM Install dependencies
echo Installing dependencies...
pip install -q --upgrade pip
pip install -q -r requirements.txt
echo ✅ Dependencies installed
echo.
REM Create instance directory for SQLite
if not exist "instance" (
echo Creating instance directory for database...
mkdir instance
echo ✅ Instance directory created
)
REM Check if database exists
if not exist "instance\apilab.db" (
echo 📦 No database found. Initializing...
REM Initialize database
python -c "from app import create_app, db; app = create_app(); app.app_context().push(); db.create_all(); print('✅ Database initialized')"
REM Seed database
echo 🌱 Seeding database with test data...
python seed.py
) else (
echo ✅ Database already exists at instance\apilab.db
)
echo.
REM Start the server
echo ======================================
echo 🚀 Starting API Zero to Hero...
echo ======================================
echo.
echo 📍 Local URL: http://localhost:5000
echo 📍 API Base: http://localhost:5000/api
echo 📍 Dashboard: http://localhost:5000
echo.
echo 🔑 Test Credentials:
echo Admin: admin@apilab.dev / admin123
echo User: testuser@apilab.dev / test123
echo.
echo Press Ctrl+C to stop the server
echo.
python app.py