From 711ad6fb70e9dbb3933b352067deafc35cc14882 Mon Sep 17 00:00:00 2001 From: Jeet Debnath Date: Thu, 26 Mar 2026 11:29:06 +0530 Subject: [PATCH] Create start-all.bat --- start-all.bat | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 start-all.bat diff --git a/start-all.bat b/start-all.bat new file mode 100644 index 0000000..3fc82e9 --- /dev/null +++ b/start-all.bat @@ -0,0 +1,67 @@ +@echo off +REM Grateful Journal - Start All Services (Windows) +REM Runs MongoDB, FastAPI backend, and Vite frontend in one command + +setlocal enabledelayedexpansion + +REM Color codes for output +set "GREEN=[92m" +set "YELLOW=[93m" +set "RED=[91m" +set "RESET=[0m" + +echo. +echo Starting Grateful Journal... +echo. + +REM Check if MongoDB is running on port 27017 +echo Checking MongoDB... +netstat -ano | findstr :27017 >nul +if !errorlevel! equ 0 ( + echo MongoDB already running on port 27017 +) else ( + echo MongoDB is not running. Please start MongoDB first. + echo You can start MongoDB using: + echo - MongoDB Compass GUI + echo - mongod.exe from command line + echo - MongoDB service (if installed as service^) + echo. + pause + exit /b 1 +) + +echo. + +REM Start Backend (FastAPI with Python venv) +echo Starting FastAPI backend... +if not exist "venv\Scripts\activate.bat" ( + echo Python venv not found. Creating virtual environment... + python -m venv venv + call venv\Scripts\activate.bat + pip install -r backend\requirements.txt +) else ( + call venv\Scripts\activate.bat +) + +start "Grateful Journal Backend" cmd /k "cd /d %CD% && venv\Scripts\python backend\main.py" +echo Backend running on http://localhost:8001 +timeout /t 2 /nobreak + +echo. + +REM Start Frontend (Vite) +echo Starting Vite frontend... +start "Grateful Journal Frontend" cmd /k "cd /d %CD% && npm run dev -- --port 8000" +echo Frontend running on http://localhost:8000 +timeout /t 2 /nobreak + +echo. +echo All services started! +echo. +echo Frontend: http://localhost:8000 +echo Backend: http://localhost:8001 +echo API Docs: http://localhost:8001/docs +echo. +echo To stop services, close the command windows or press Ctrl+C in each window. +echo. +pause