Skip to content

Commit

Permalink
installation scripts added + README installation information updated
Browse files Browse the repository at this point in the history
  • Loading branch information
SLey3 committed Feb 29, 2024
1 parent 0555ec5 commit 0d09a56
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 24 deletions.
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
## Requirements
- Python 3.11.1+
- Node v20.11.0
- Node v20.11.0+

## Installation
Both steps must be completed:
1) To Install Python Requirements:
```
pip install -r requirements.txt
pip install -r dev-requirements.txt
```
1) To install requirements:
```
# For mac
chmod +x ./scripts/install.sh
./scripts/install.sh
2) To Install Node Requirements:
```
cd site
npm install
```
3) Contact me ([email protected]) for the .env file especially if your going to be on the website for testing of features (.env file is important for the site during development mode)
4) Once .env file is recieved:
# For windows
./scripts/install.bat
```
2) Contact me ([email protected]) for the .env file especially if your going to be on the website for testing of features (.env file is important for the site during development mode)
3) Once .env file is recieved:
1) place it in the **site** folder
5) To run website in development mode (meaning outside of the production url):
4) To run website in development mode (meaning outside of the production url):
1) On the terminal change directory to the **site** folder:
```
cd site
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dotenv # Development env file parser
python-dotenv # Development env file parser
49 changes: 49 additions & 0 deletions scripts/install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@echo off

echo "[SYSTEM] Running install.sh"
echo "[SYSTEM] Installing python dependencies..."
IF ! "command" "-v" "pip" (
echo "-e" "][ERROR] pip is not installed. Please install pip before running this script."
exit "1"
)
pip "install" "-r" "requirements.txt"
pip "install" "-r" "dev-requirements.txt"
echo "-e" "[SYSTEM] Python dependencies installed"
echo "[SYSTEM] Installing node dependencies..."
cd "site"
IF ! "command" "-v" "npm" (
echo "-e" "[ERROR] npm is not installed. Please install npm before running this script."
exit "1"
)
IF ! "command" "-v" "node" (
echo "-e" "[ERROR] node is not installed. Please install node before running this script."
exit "1"
)
IF "-d" "%CD%\static\node_modules" (
echo "[SYSTEM] Node modules directory installed. Manually checking for required modules... ."
echo "[SYSTEM] Checking for tailwindcss..."
IF "-d" "%CD%\static\node_modules\tailwindcss" (
echo "-e" "[SYSTEM] Tailwindcss is installed"
) ELSE (
echo "-e" "[SYSTEM] Tailwindcss is not installed. Installing tailwindcss..."
npm "install" "tailwindcss" "--prefix" "%CD%\static"
echo "-e" "[SYSTEM] Tailwindcss installed"
)
echo "[SYSTEM] Checking for flowbite..."
IF "-d" "%CD%\static\node_modules\flowbite" (
echo "-e" "[SYSTEM] Flowbite is installed"
) ELSE (
echo "-e" "[SYSTEM] Flowbite is not installed. Installing flowbite..."
npm "install" "flowbite" "--prefix" "%CD%\static"
echo "-e" "[SYSTEM] Flowbite installed"
)
echo "-e" "[SYSTEM] Node dependencies installed, installation complete "
exit "0"
) ELSE (
npm "install"
echo "-e" "[SYSTEM] Node dependencies installed"
)
echo "[SYSTEM] Moving node_modules to static folder"
echo "[SYSTEM] Running on a non-Windows system"
mv "%CD%\node_modules" "%CD%\static"
echo "-e" "[SYSTEM] Installation complete"
74 changes: 69 additions & 5 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,74 @@
#!/bin/bash
echo "[SYSTEM] Running install.sh"

if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || "$OSTYPE" == "win32" ]]; then
echo "[SYSTEM] Running on Windows"
move ./node_modules ./static
# Install the dependencies
echo "[SYSTEM] Installing python dependencies..."


# check if pip is installed
if ! command -v pip &> /dev/null; then
echo -e "\033[31m][ERROR] pip is not installed. Please install pip before running this script.\033[0m"
exit 1
fi

pip install -r requirements.txt
pip install -r dev-requirements.txt


echo -e "\033[32m[SYSTEM] Python dependencies installed\033[0m"

echo "[SYSTEM] Installing node dependencies..."

cd site

# Check if npm is installed
if ! command -v npm &> /dev/null; then
echo -e "\033[31m[ERROR] npm is not installed. Please install npm before running this script.\033[0m"
exit 1
fi

# Check if node is installed
if ! command -v node &> /dev/null; then
echo -e "\033[31m[ERROR] node is not installed. Please install node before running this script.\033[0m"
exit 1
fi

# check for node_modules folder in static
if [ -d "./static/node_modules" ]; then
echo "[SYSTEM] Node modules directory installed. Manually checking for required modules... ."

echo "[SYSTEM] Checking for tailwindcss..."

if [ -d "./static/node_modules/tailwindcss" ]; then
echo -e "\033[32m[SYSTEM] Tailwindcss is installed\033[0m"
else
echo -e "\033[31m[SYSTEM] Tailwindcss is not installed. Installing tailwindcss...\033[0m"
npm install tailwindcss --prefix ./static
echo -e "\033[32m[SYSTEM] Tailwindcss installed\033[0m"
fi

echo "[SYSTEM] Checking for flowbite..."

if [ -d "./static/node_modules/flowbite" ]; then
echo -e "\033[32m[SYSTEM] Flowbite is installed\033[0m"
else
echo -e "\033[31m[SYSTEM] Flowbite is not installed. Installing flowbite...\033[0m"
npm install flowbite --prefix ./static
echo -e "\033[32m[SYSTEM] Flowbite installed\033[0m"
fi

echo -e "\033[32m[SYSTEM] Node dependencies installed, installation complete \033[0m"
exit 0
else
echo "[SYSTEM] Running on a non-Windows system"
mv ./node_modules ./static
npm install

echo -e "\033[32m[SYSTEM] Node dependencies installed\033[0m"
fi

# move node_modules to static folder
echo "[SYSTEM] Moving node_modules to static folder"

echo "[SYSTEM] Running on a non-Windows system"
mv ./node_modules ./static

echo -e "\033[32m[SYSTEM] Installation complete\033[0m"
3 changes: 0 additions & 3 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
"Addie Gage",
"Kendall Leonard"
],
"scripts": {
"prepare": "../scripts/install.sh"
},
"dependencies": {
"flowbite": "^2.3.0",
"tailwindcss": "^3.4.1"
Expand Down

0 comments on commit 0d09a56

Please sign in to comment.