-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# Checking for all required dependencies | ||
command -v git >/dev/null 2>&1 || { echo "Git is required. Please install Git."; exit 1; } | ||
command -v node >/dev/null 2>&1 || { echo "Node.js is required. Please install Node.js."; exit 1; } | ||
command -v npm >/dev/null 2>&1 || { echo "npm is required. Please install npm."; exit 1; } | ||
command -v uvicorn >/dev/null 2>&1 || { echo "Installing Uvicorn..."; pip install uvicorn; } | ||
|
||
cd setup/frontend || { echo "Failed to navigate to frontend directory"; exit 1; } | ||
|
||
echo "Installing and building npm packages and files..." | ||
npm install | ||
npm run build | ||
|
||
cd ../.. | ||
|
||
# Start the FastAPI server | ||
PORT=${1:-8800} | ||
echo "Starting the FastAPI server on port $PORT..." | ||
uvicorn setup.backend.app.main:app --reload --port "$PORT" & | ||
|
||
sleep 2 | ||
|
||
OS=${2:-linux} | ||
|
||
if [[ "$OS" == "macos" ]]; then | ||
open "http://localhost:$PORT" | ||
else | ||
xdg-open "http://localhost:$PORT" | ||
fi | ||
|
||
echo "Setup complete! Access the application at http://localhost:$PORT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters