Skip to content

Commit

Permalink
Merge pull request #63 from deepraj21/main
Browse files Browse the repository at this point in the history
added setup batch file to automate the local installation
  • Loading branch information
deepraj21 authored Oct 21, 2024
2 parents 28966b9 + 2881da2 commit bbe9a7a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ Enter into the root directory.
```bash
cd devhub
```
You can use `setup.bat` to automate the installation and running process of the webapp. (make sure to make `.env` in server and populate it with the data)

```bash
./setup.bat
```
### Manual Installation

Open two terminal for server and client and enter into the directories.
```bash
## 1st terminal for server
Expand Down
8 changes: 8 additions & 0 deletions server/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# this is an example .env content. make sure to make a .env and populate it with your original data

GOOGLE_API_KEY=
SECRET_KEY=
NEO4J_URI=
NEO4J_USER=
NEO4J_PASSWORD=
MONGODB_URI=
27 changes: 27 additions & 0 deletions setup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@echo off

REM Check and setup backend virtual environment if not exists
IF NOT EXIST server\venv (
echo Setting up backend virtual environment...
python -m venv server\venv
)
call server\venv\Scripts\activate

REM Install backend dependencies
pip install -r server\requirements.txt
if %errorlevel% neq 0 exit /b %errorlevel%

REM Start backend
start cmd /k "cd server && flask run"

REM Check and setup frontend node modules if not exists
IF NOT EXIST client\node_modules (
echo Setting up frontend node modules...
pushd client
npm install --force
if %errorlevel% neq 0 popd & exit /b %errorlevel%
popd
)

REM Start frontend
start cmd /k "cd client && npm run dev"

0 comments on commit bbe9a7a

Please sign in to comment.