/
gr.ev.vl
/
TestGen
Обзор
Документация
Войти
/
gr.ev.vl
/
TestGen
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master2
scripts/bd_new.cmd
781 строка
26 KB
gr.ev.vl
Initial commit
06 июн 2026, 02:41
06 июн 2026, 02:41
02fb1fb
Код
Авторство
О чём код?
@echo off chcp 1251 >nul setlocal enabledelayedexpansion :: ============================================================================= :: TestGen � ��������� ��������� � ������������� ������� :: :: ������������ ��� ������: :: STORAGE_MODE=file � �������� �� (datas/*.json) :: STORAGE_MODE=database � PostgreSQL + Redis + Celery :: ============================================================================= title TestGen � ��������� ��������� ������� set "SCRIPT_DIR=%~dp0" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%" for %%i in ("%SCRIPT_DIR%") do set "PROJECT_DIR=%%~dpi" set "PROJECT_DIR=%PROJECT_DIR:~0,-1%" set "BACKEND_DIR=%PROJECT_DIR%\backend" set "FRONTEND_DIR=%PROJECT_DIR%\frontend" set "ENV_FILE=%BACKEND_DIR%\.env" cd /d "%PROJECT_DIR%" echo. echo �==============================================================� echo � TestGen � ��������� ��������� ������� � echo � ���������� � ������� ������� � echo L==============================================================- echo. :: ============================================================================= :: 1. �������� ����������� :: ============================================================================= echo [1/12] �������� �����������... set "PYTHON_OK=0" set "NODE_OK=0" set "PSQL_OK=0" set "REDIS_OK=0" where python >nul 2>&1 if %errorlevel% equ 0 ( for /f "tokens=2" %%v in ('python --version 2^>^&1') do echo [OK] Python %%v set "PYTHON_OK=1" ) else ( echo [X] Python �� ������ ) where node >nul 2>&1 if %errorlevel% equ 0 ( for /f "tokens=2" %%v in ('node --version 2^>^&1') do echo [OK] Node.js %%v set "NODE_OK=1" ) else ( echo [X] Node.js �� ������ ) set "PSQL_PATH=" where psql >nul 2>&1 if %errorlevel% equ 0 ( echo [OK] PostgreSQL ������ ������ set "PSQL_OK=1" ) else ( :: ������� ����� psql � ����������� ����� for /d %%i in ("C:\Program Files\PostgreSQL\*\bin") do ( if exist "%%i\psql.exe" ( set "PSQL_PATH=%%i" ) ) if defined PSQL_PATH ( echo [v] ������ psql: !PSQL_PATH!\psql.exe set "PATH=!PSQL_PATH!;!PATH!" set "PG_BIN_DIR=!PSQL_PATH!" ) else ( echo [X] PostgreSQL �� ������. echo ���������� PostgreSQL 16+: https://www.postgresql.org/download/windows/ echo [!] psql �� ������ (����� ��� database-������) pause ) ) where redis-cli >nul 2>&1 if %errorlevel% equ 0 ( echo [OK] Redis ������ ������ set "REDIS_OK=1" ) else ( echo [!] redis-cli �� ������ (����� ��� database-������) ) if "%PYTHON_OK%"=="0" ( echo. echo [X] Python ����������. ���������� Python 3.12+ pause exit /b 1 ) if "%NODE_OK%"=="0" ( echo. echo [X] Node.js ����������. ���������� Node.js 20+ pause exit /b 1 ) echo. :: ============================================================================= :: 2. ����� ������ �������� :: ============================================================================= echo [2/12] ����� ������ �������� ������... echo. echo [1] �������� ����� (file) echo - ������ � datas/*.json echo - �� ������� PostgreSQL � Redis echo - ������ ����������� ��������� echo - ������������� ��� ������ ������ echo. echo [2] ����� � ������ ������ (database) echo - PostgreSQL ��� ������ echo - Redis ��� ���� � Celery echo - ������ ����������� ���������� echo - ������� ���������� PostgreSQL � Redis echo. set /p STORAGE_MODE="�������� ����� [1]: " if "%STORAGE_MODE%"=="" set "STORAGE_MODE=1" if "%STORAGE_MODE%"=="1" ( set "MODE=file" set "CACHE_MODE=file" set "TASK_MODE=sync" ) else ( set "MODE=database" set "CACHE_MODE=redis" set "TASK_MODE=celery" ) echo. echo ������ �����: %MODE% echo ���: %CACHE_MODE% echo ������: %TASK_MODE% echo. :: ============================================================================= :: 3. ��������� Backend (����������� ��������� + �����������) :: ============================================================================= echo [3/12] ��������� Backend... cd /d "%BACKEND_DIR%" if not exist ".venv\Scripts\python.exe" ( echo �������� ������������ ���������... python -m venv .venv echo [OK] ����������� ��������� �������. ) else ( echo [OK] ����������� ��������� ����������. ) call .venv\Scripts\activate.bat python -m pip install --upgrade pip --quiet 2>nul echo ��������� ������������... where uv >nul 2>&1 if %errorlevel% equ 0 ( uv sync --group dev 2>&1 ) else ( pip install fastapi uvicorn[standard] starlette sqlalchemy[asyncio] psycopg[binary] alembic pgvector redis celery pydantic pydantic-settings openai anthropic google-generativeai python-jose[cryptography] passlib[bcrypt] bcrypt httpx python-multipart structlog python-dotenv pyyaml --quiet 2>nul pip install pytest pytest-asyncio pytest-cov pytest-mock factory-boy httpx ruff mypy pre-commit ipython --quiet 2>nul ) echo [OK] ����������� �����������. echo. :: ============================================================================= :: 4. �������� .env ����� :: ============================================================================= echo [4/12] �������� .env �����... :: ��������� ������ python -c "import secrets; print(secrets.token_urlsafe(32))" > "%TEMP%\testgen_secret.tmp" set /p SECRET_KEY=<"%TEMP%\testgen_secret.tmp" del "%TEMP%\testgen_secret.tmp" >nul 2>&1 python -c "import secrets; print(secrets.token_hex(16))" > "%TEMP%\testgen_encrypt.tmp" set /p ENCRYPTION_KEY=<"%TEMP%\testgen_encrypt.tmp" del "%TEMP%\testgen_encrypt.tmp" >nul 2>&1 if "%MODE%"=="database" ( set /p DB_HOST="���� PostgreSQL [localhost]: " if "!DB_HOST!"=="" set "DB_HOST=localhost" set /p DB_PORT="���� PostgreSQL [5432]: " if "!DB_PORT!"=="" set "DB_PORT=5432" set /p DB_NAME="��� �� [testgen]: " if "!DB_NAME!"=="" set "DB_NAME=testgen" set /p DB_USER="������������ �� [testgen]: " if "!DB_USER!"=="" set "DB_USER=testgen" set /p DB_PASSWORD="������ �� [password]: " if "!DB_PASSWORD!"=="" set "DB_PASSWORD=password" set /p REDIS_HOST="���� Redis [localhost]: " if "!REDIS_HOST!"=="" set "REDIS_HOST=localhost" set /p REDIS_PORT="���� Redis [6379]: " if "!REDIS_PORT!"=="" set "REDIS_PORT=6379" echo. ) ( echo # TestGen � ������������ echo APP_NAME=TestGen echo APP_VERSION=0.1.0 echo ENVIRONMENT=development echo DEBUG=true echo LOG_LEVEL=DEBUG echo. echo # ������ echo STORAGE_MODE=%MODE% echo CACHE_MODE=%CACHE_MODE% echo TASK_MODE=%TASK_MODE% echo. echo # ������������ echo SECRET_KEY=%SECRET_KEY% echo ACCESS_TOKEN_EXPIRE_MINUTES=30 echo REFRESH_TOKEN_EXPIRE_DAYS=30 echo ENCRYPTION_KEY=%ENCRYPTION_KEY% echo. echo # ���� ������ echo DB_HOST=%DB_HOST% echo DB_PORT=%DB_PORT% echo DB_NAME=%DB_NAME% echo DB_USER=%DB_USER% echo DB_PASSWORD=%DB_PASSWORD% echo. echo # Redis echo REDIS_HOST=%REDIS_HOST% echo REDIS_PORT=%REDIS_PORT% echo REDIS_DB=0 echo. echo # ��������� echo STORAGE_PATH=./storage echo DATA_PATH=./datas echo. echo # CORS echo CORS_ORIGINS=["http://localhost:5173","http://localhost:3000"] ) > "%ENV_FILE%" echo [OK] ���� .env ������. echo. :: ============================================================================= :: 5. ��������� �� (PostgreSQL ��� file) :: ============================================================================= echo [5/12] ��������� ���� ������... cd /d "%BACKEND_DIR%" set "PYTHONPATH=%BACKEND_DIR%\src;%PYTHONPATH%" if "%MODE%"=="database" ( echo ��������� PostgreSQL... :: �������� ����������� set "PGPASSWORD=%DB_PASSWORD%" psql -h %DB_HOST% -p %DB_PORT% -U %DB_USER% -d postgres -c "SELECT 1;" >nul 2>&1 if !errorlevel! neq 0 ( echo [!] �� ������� ������������ � PostgreSQL ��� %DB_USER%. :: ������� ����� postgres psql -h %DB_HOST% -p %DB_PORT% -U postgres -d postgres -c "SELECT 1;" >nul 2>&1 if !errorlevel! neq 0 ( echo [X] PostgreSQL ����������. echo ���������, ��� ������ �������. echo ������������� �� �������� ����� (STORAGE_MODE=file). pause exit /b 1 ) echo �������� ������������ %DB_USER%... psql -h %DB_HOST% -p %DB_PORT% -U postgres -d postgres -c "CREATE USER %DB_USER% WITH PASSWORD '%DB_PASSWORD%';" 2>nul psql -h %DB_HOST% -p %DB_PORT% -U postgres -d postgres -c "ALTER USER %DB_USER% CREATEDB;" 2>nul ) :: �������� �� psql -h %DB_HOST% -p %DB_PORT% -U postgres -d postgres -t -c "SELECT 1 FROM pg_database WHERE datname='%DB_NAME%';" > "%TEMP%\db_check.tmp" 2>&1 set /p DB_EXISTS=<"%TEMP%\db_check.tmp" del "%TEMP%\db_check.tmp" >nul 2>&1 set "DB_EXISTS=!DB_EXISTS: =!" if "!DB_EXISTS!"=="1" ( echo [!] ���� ������ %DB_NAME% ��� ����������. set /p RECREATE=" �����������? (y/n) [n]: " if /i "!RECREATE!"=="y" ( psql -h %DB_HOST% -p %DB_PORT% -U postgres -d postgres -c "DROP DATABASE IF EXISTS %DB_NAME%;" 2>nul set "DB_EXISTS=0" ) ) if not "!DB_EXISTS!"=="1" ( psql -h %DB_HOST% -p %DB_PORT% -U postgres -d postgres -c "CREATE DATABASE %DB_NAME% OWNER %DB_USER% ENCODING 'UTF8';" 2>nul echo [OK] ���� ������ �������. ) :: ���������� psql -h %DB_HOST% -p %DB_PORT% -U postgres -d %DB_NAME% -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" 2>nul psql -h %DB_HOST% -p %DB_PORT% -U postgres -d %DB_NAME% -c "CREATE EXTENSION IF NOT EXISTS \"pgcrypto\";" 2>nul echo [OK] ���������� ���������. :: �������� echo ���������� ��������... call .venv\Scripts\python.exe -m alembic upgrade head 2>&1 if !errorlevel! neq 0 ( echo [!] ������ ��������. ) else ( echo [OK] �������� ���������. ) ) else ( :: �������� ����� echo ������������� �������� ��... call .venv\Scripts\python.exe -c " import sys sys.path.insert(0, 'src') from src.testgen.infrastructure.storage.file_db import init_file_db from src.testgen.config import settings db = init_file_db(settings.storage.DATA_PATH) tables = db.get_all_tables() print(f' ������ �������: {len(tables)}') for t in sorted(tables): print(f' - {t}') " 2>&1 echo [OK] �������� �� ����������������. ) echo. :: ============================================================================= :: 6. �������� Redis (������ ��� database-������) :: ============================================================================= if "%MODE%"=="database" ( echo [6/12] �������� Redis... redis-cli -h %REDIS_HOST% -p %REDIS_PORT% ping >nul 2>&1 if !errorlevel! equ 0 ( echo [OK] Redis ��������. redis-cli -h %REDIS_HOST% -p %REDIS_PORT% CONFIG SET maxmemory 256mb >nul 2>&1 redis-cli -h %REDIS_HOST% -p %REDIS_PORT% CONFIG SET maxmemory-policy allkeys-lru >nul 2>&1 echo [OK] Redis ��������. ) else ( echo [!] Redis ����������. Celery �� ����� ��������. echo ���������� Redis ��� ������������� �� TASK_MODE=sync. ) echo. ) else ( echo [6/12] �������� ����� � Redis �� ���������. echo. ) :: ============================================================================= :: 7. �������� ����������������� ������� :: ============================================================================= echo [7/12] �������� ����������������� �������... call .venv\Scripts\python.exe -c " import sys sys.path.insert(0, 'src') from src.testgen.config import settings if settings.STORAGE_MODE == 'file': from src.testgen.infrastructure.storage.file_db import get_file_db db = get_file_db(settings.storage.DATA_PATH) prompts_data = [ {'name': 'question_generation_v1', 'prompt_type': 'question_generation', 'description': '������� ��������� �������� ��������'}, {'name': 'misconception_generation_v1', 'prompt_type': 'misconception_generation', 'description': '��������� ������� �����������'}, {'name': 'distractor_generation_v1', 'prompt_type': 'distractor_generation', 'description': '��������� ������������'}, {'name': 'question_verification_v1', 'prompt_type': 'question_verification', 'description': '����������� ��������'}, {'name': 'distractor_verification_v1', 'prompt_type': 'distractor_verification', 'description': '����������� ������������'}, ] created = 0 for pdata in prompts_data: existing = db.get_by_field('prompts', 'name', pdata['name']) if not existing: prompt = db.create('prompts', {**pdata, 'is_system': True, 'is_active': True}) db.create('prompt_versions', { 'prompt_id': prompt['id'], 'version_number': 1, 'content': f'���������� �������� �������. ���: {pdata[\"prompt_type\"]}', 'variables': {}, 'response_format': {}, 'is_current': True, 'change_description': '��������� ������', }) created += 1 print(f' ������� �������: {created}') else: # Database-����� � ����� SQLAlchemy import asyncio from src.testgen.infrastructure.database.session import async_session_factory from src.testgen.domain.repositories.prompt import PromptRepository from src.testgen.domain.models.prompt import Prompt, PromptVersion async def seed(): async with async_session_factory() as session: repo = PromptRepository(session) prompts_data = [ {'name': 'question_generation_v1', 'prompt_type': 'question_generation', 'description': '������� ��������� �������� ��������'}, {'name': 'misconception_generation_v1', 'prompt_type': 'misconception_generation', 'description': '��������� ������� �����������'}, {'name': 'distractor_generation_v1', 'prompt_type': 'distractor_generation', 'description': '��������� ������������'}, {'name': 'question_verification_v1', 'prompt_type': 'question_verification', 'description': '����������� ��������'}, {'name': 'distractor_verification_v1', 'prompt_type': 'distractor_verification', 'description': '����������� ������������'}, ] created = 0 for pdata in prompts_data: existing = await repo.list(filters={'name': pdata['name']}) if not existing: prompt = await repo.create(**pdata, is_system=True, is_active=True) await session.commit() created += 1 print(f' ������� �������: {created}') asyncio.run(seed()) " 2>&1 if %errorlevel% neq 0 ( echo [!] �������������� ��� �������� �������. ) else ( echo [OK] ����������������� ������ �������. ) echo. :: ============================================================================= :: 8. �������� �������������� :: ============================================================================= echo [8/12] �������� ��������������... echo. set /p CREATE_ADMIN="������� ��������������? (y/n) [y]: " if "%CREATE_ADMIN%"=="" set "CREATE_ADMIN=y" if /i "%CREATE_ADMIN%"=="y" ( set /p ADMIN_EMAIL="Email [admin@testgen.local]: " if "!ADMIN_EMAIL!"=="" set "ADMIN_EMAIL=admin@testgen.local" set /p ADMIN_PASS="������ [Admin123!]: " if "!ADMIN_PASS!"=="" set "ADMIN_PASS=Admin123!" set /p ADMIN_NAME="��� [�������������]: " if "!ADMIN_NAME!"=="" set "ADMIN_NAME=�������������" echo. call .venv\Scripts\python.exe -c " import sys sys.path.insert(0, 'src') from src.testgen.config import settings from src.testgen.core.utils.hashing import hash_password if settings.STORAGE_MODE == 'file': from src.testgen.infrastructure.storage.file_db import get_file_db db = get_file_db(settings.storage.DATA_PATH) existing = db.get_by_field('users', 'email', '!ADMIN_EMAIL!') if existing: print(' [!] ������������ ��� ����������') else: db.create('users', { 'email': '!ADMIN_EMAIL!', 'password_hash': hash_password('!ADMIN_PASS!'), 'full_name': '!ADMIN_NAME!', 'role': 'admin', 'is_active': True, }) print(' [OK] ������������� ������') else: import asyncio from src.testgen.infrastructure.database.session import async_session_factory from src.testgen.domain.repositories.user import UserRepository async def create(): async with async_session_factory() as session: repo = UserRepository(session) existing = await repo.get_by_email('!ADMIN_EMAIL!') if existing: print(' [!] ������������ ��� ����������') else: await repo.create( email='!ADMIN_EMAIL!', password_hash=hash_password('!ADMIN_PASS!'), full_name='!ADMIN_NAME!', role='admin', is_active=True, ) await session.commit() print(' [OK] ������������� ������') asyncio.run(create()) " 2>&1 if !errorlevel! neq 0 ( echo [!] ������ �������� ��������������. ) ) else ( echo ���������. ) echo. :: ============================================================================= :: 9. �������� �������� ������ :: ============================================================================= echo [9/12] �������� �������� ������... echo. set /p SEED_DATA="��������� �������� ������ (�����, ����)? (y/n) [n]: " if /i "!SEED_DATA!"=="y" ( echo. call .venv\Scripts\python.exe -c " import sys sys.path.insert(0, 'src') from src.testgen.config import settings from src.testgen.core.utils.hashing import hash_password if settings.STORAGE_MODE == 'file': from src.testgen.infrastructure.storage.file_db import get_file_db db = get_file_db(settings.storage.DATA_PATH) teacher = db.create('users', { 'email': 'teacher@testgen.local', 'password_hash': hash_password('Teacher123!'), 'full_name': '���� ��������������', 'role': 'teacher', 'is_active': True, }) course = db.create('courses', { 'code': 'DEMO101', 'name': '���������������� ����', 'description': '���� ��� ������������', 'semester': 1, 'status': 'active', 'created_by': teacher['id'], }) db.create('passports', { 'course_id': course['id'], 'version_number': 1, 'audience_description': '�������� ����-�����', 'course_goals': '������������ � ��������', 'restrictions': '��� �����������', 'style_requirements': '�������������', 'is_active': True, 'created_by': teacher['id'], }) for level in ['knowledge', 'comprehension', 'application']: db.create('bloom_taxonomy_levels', { 'course_id': course['id'], 'level': level, 'is_enabled': True, }) topic = db.create('topics', { 'course_id': course['id'], 'name': '��������', 'order_number': 1, }) for i, name in enumerate(['������', '���������', '��������']): db.create('subtopics', { 'topic_id': topic['id'], 'name': name, 'order_number': i+1, }) print('�������� ������ ��������� (file-�����)') else: import asyncio from src.testgen.infrastructure.database.session import async_session_factory from src.testgen.domain.repositories.user import UserRepository from src.testgen.domain.repositories.course import CourseRepository from src.testgen.domain.repositories.passport import PassportRepository from src.testgen.domain.repositories.topic import TopicRepository, SubtopicRepository async def seed(): async with async_session_factory() as session: user_repo = UserRepository(session) course_repo = CourseRepository(session) passport_repo = PassportRepository(session) topic_repo = TopicRepository(session) subtopic_repo = SubtopicRepository(session) teacher = await user_repo.create( email='teacher@testgen.local', password_hash=hash_password('Teacher123!'), full_name='���� ��������������', role='teacher', is_active=True, ) course = await course_repo.create( code='DEMO101', name='���������������� ����', description='���� ��� ������������', semester=1, status='active', created_by=teacher.id, ) await passport_repo.create( course_id=course.id, version_number=1, audience_description='�������� ����-�����', course_goals='������������ � ��������', restrictions='��� �����������', style_requirements='�������������', is_active=True, created_by=teacher.id, ) for level in ['knowledge', 'comprehension', 'application']: from src.testgen.domain.models.passport import BloomTaxonomyLevel session.add(BloomTaxonomyLevel( course_id=course.id, level=level, is_enabled=True, )) topic = await topic_repo.create( course_id=course.id, name='��������', order_number=1, ) for i, name in enumerate(['������', '���������', '��������']): await subtopic_repo.create( topic_id=topic.id, name=name, order_number=i+1, ) await session.commit() print('�������� ������ ��������� (database-�����)') asyncio.run(seed()) " 2>&1 if !errorlevel! neq 0 ( echo [!] ������ �������� ������. ) else ( echo [OK] �������� ������ ���������. ) ) else ( echo ���������. ) echo. :: ============================================================================= :: 10. ��������� Frontend :: ============================================================================= echo [10/12] ��������� Frontend... cd /d "%FRONTEND_DIR%" if exist "node_modules" ( echo [OK] node_modules ����������. ) else ( echo ��������� npm-������������... call npm install echo [OK] ����������� �����������. ) echo. :: ============================================================================= :: 11. �������� ���������� :: ============================================================================= echo [11/12] �������� ����������... cd /d "%PROJECT_DIR%" echo Backend: if exist "%BACKEND_DIR%\.venv\Scripts\python.exe" ( echo [OK] ����������� ��������� ) else ( echo [!] ����������� ��������� �� ������� ) if "%MODE%"=="file" ( if exist "%BACKEND_DIR%\datas" ( echo [OK] ������ (datas/) ) else ( echo [!] ������ �� ������� ) ) else ( echo [OK] ����� database ) echo Frontend: if exist "%FRONTEND_DIR%\node_modules" ( echo [OK] node_modules ) else ( echo [!] node_modules �� ������� ) echo. :: ============================================================================= :: 12. �������� �������� ������� :: ============================================================================= echo [12/12] �������� �������� �������... :: run_backend.cmd ( echo @echo off echo chcp 65001 ^>nul echo title TestGen Backend echo cd /d "%BACKEND_DIR%" echo call .venv\Scripts\activate.bat echo set "PYTHONPATH=%BACKEND_DIR%\src;%%PYTHONPATH%%" echo echo Backend: http://localhost:8000 echo echo Docs: http://localhost:8000/api/docs echo uvicorn src.testgen.main:app --reload --host 0.0.0.0 --port 8000 echo pause ) > "%SCRIPT_DIR%\run_backend.cmd" :: run_frontend.cmd ( echo @echo off echo chcp 65001 ^>nul echo title TestGen Frontend echo cd /d "%FRONTEND_DIR%" echo echo Frontend: http://localhost:5173 echo call npm run dev echo pause ) > "%SCRIPT_DIR%\run_frontend.cmd" :: run_worker.cmd (������ ��� database-������) ( echo @echo off echo chcp 65001 ^>nul echo title TestGen Worker echo cd /d "%BACKEND_DIR%" echo call .venv\Scripts\activate.bat echo set "PYTHONPATH=%BACKEND_DIR%\src;%%PYTHONPATH%%" echo. echo for /f "usebackq tokens=1,2 delims==" %%%%a in ^(`type ".env" ^^^| findstr "TASK_MODE"`^) do set "%%%%a=%%%%b" echo if not defined TASK_MODE set "TASK_MODE=sync" echo. echo if "%%TASK_MODE%%"=="sync" ^( echo echo TASK_MODE=sync � worker �� ����� echo pause echo exit /b 0 echo ^) echo. echo echo Celery Worker echo celery -A src.testgen.tasks.celery_app worker --loglevel=info --concurrency=4 --queues=llm_high_priority,llm_low_priority,export echo pause ) > "%SCRIPT_DIR%\run_worker.cmd" :: run_all.cmd ( echo @echo off echo chcp 65001 ^>nul echo title TestGen echo. echo for /f "usebackq tokens=1,2 delims==" %%%%a in ^(`type "%BACKEND_DIR%\.env" ^^^| findstr "TASK_MODE"`^) do set "%%%%a=%%%%b" echo if not defined TASK_MODE set "TASK_MODE=sync" echo. echo echo ============================================ echo echo ������ TestGen echo echo ============================================ echo start "Backend" cmd /c "%SCRIPT_DIR%\run_backend.cmd" echo timeout /t 3 /nobreak ^>nul echo if "%%TASK_MODE%%"=="celery" start "Worker" cmd /c "%SCRIPT_DIR%\run_worker.cmd" echo timeout /t 2 /nobreak ^>nul echo start "Frontend" cmd /c "%SCRIPT_DIR%\run_frontend.cmd" echo echo Backend: http://localhost:8000 echo echo Frontend: http://localhost:5173 echo pause ) > "%SCRIPT_DIR%\run_all.cmd" echo [OK] ������� �������: echo run_backend.cmd echo run_frontend.cmd echo run_worker.cmd echo run_all.cmd :: ============================================================================= :: ���������� :: ============================================================================= echo. echo �==============================================================� echo � ��������� ���������! � echo L==============================================================- echo. echo �����: %MODE% echo. echo ������ ��� �����: echo �������������: admin@testgen.local / Admin123! if /i "%SEED_DATA%"=="y" echo �������������: teacher@testgen.local / Teacher123! echo. echo ������: echo scripts\run_all.cmd echo. echo ��� ��������: echo scripts\run_backend.cmd echo scripts\run_frontend.cmd if "%TASK_MODE%"=="celery" echo scripts\run_worker.cmd echo. pause exit /b 0