Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NOTE: Please do not open a PR for the issue which is not yet reviewed and labell

## Setup

1. Setup Using Script (Recommended only for Windows and Debian-based OS like Ubuntu): [Guide](docs/Script_Setup_Guide.md)
1. Setup Using Script (Recommended for Windows, Debian-based OS like Ubuntu, and Fedora/RedHat-based OS): [Guide](docs/Script_Setup_Guide.md)
2. Setup Manually(Recommended for other OSes): [Guide](docs/Manual_Setup_Guide.md)

## Docs Website Setup
Expand Down
14 changes: 14 additions & 0 deletions docs/Manual_Setup_Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,26 @@ Before setting up the Python backend and sync-microservice, you need to have **M
sudo apt install -y libglib2.0-dev libgl1-mesa-glx
```

**Fedora/RedHat:**

```bash
sudo dnf install -y glib2-devel mesa-libGL
```

**Other Systems:** Consult your distribution's documentation for installation instructions.

2. **`gobject-2.0` Not Found Error:** Resolve this error by installing `libglib2.0-dev` on Debian/Ubuntu:

**Debian/Ubuntu:**

```bash
sudo apt install -y libglib2.0-dev pkg-config
```

**Fedora/RedHat:**

```bash
sudo dnf install -y glib2-devel pkgconf-pkg-config
```

For other systems, consult your distribution's documentation.
2 changes: 2 additions & 0 deletions docs/Script_Setup_Guide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Setting Up using Script

The automated setup script supports **Windows**, **Debian-based Linux (e.g., Ubuntu)**, and **Fedora/RedHat-based Linux**.

## Video Setup Guide

- [Windows](https://youtu.be/nNVAE4or280?si=j_y9Xn8Kra6tPHjw)
Expand Down
2 changes: 1 addition & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

The CONTRIBUTING.md file contains detailed instructions for:

1. **Script Setup** - Automated setup using our setup script, recommended only for Windows and Debian-based OS like Ubuntu.
1. **Script Setup** - Automated setup using our setup script, recommended for Windows, Debian-based OS like Ubuntu, and Fedora/RedHat-based OS.
2. **Manual Setup** - Step-by-step manual installation, recommended for other operating systems.
3. **Documentation Website Setup Guide**

Expand Down
12 changes: 7 additions & 5 deletions scripts/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ if (os.platform() === 'win32') {
command = 'powershell.exe';
args = ['-ExecutionPolicy', 'Bypass', '-File', psScript];
} else if (os.platform() === 'linux') {
// Check if it's Debian-based Linux
// Check if it's Debian-based or Fedora-based Linux
const debianVersionPath = '/etc/debian_version';
if (fs.existsSync(debianVersionPath)) {
// On Debian-based Linux, use the bash script
const fedoraReleasePath = '/etc/fedora-release';
const redhatReleasePath = '/etc/redhat-release';
if (fs.existsSync(debianVersionPath) || fs.existsSync(fedoraReleasePath) || fs.existsSync(redhatReleasePath)) {
// On Debian, Fedora or RedHat Linux, use the bash script
command = bashScript;
args = [];

Expand All @@ -32,13 +34,13 @@ if (os.platform() === 'win32') {
fs.chmodSync(bashScript, 0o755);
}
} else {
console.error('Unsupported Linux distribution. This setup script only supports Debian-based Linux distributions.');
console.error('Unsupported Linux distribution. This setup script only supports Debian-based and Fedora/RedHat-based Linux distributions.');
console.error('Please install system dependencies manually and run the individual setup commands.');
process.exit(1);
}
} else {
console.error(`Unsupported operating system: ${os.platform()}`);
console.error('This setup script only supports Windows and Debian-based Linux distributions.');
console.error('This setup script only supports Windows, Debian-based, and Fedora/RedHat-based Linux distributions.');
console.error('Please install system dependencies manually and run the individual setup commands.');
process.exit(1);
}
Expand Down
40 changes: 30 additions & 10 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

# Get the directory of the script and resolve the repo root
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
REPO_ROOT="$( cd "$SCRIPT_DIR/.." && pwd )"

# Colors for terminal output
RED='\033[0;31m'
GREEN='\033[0;32m'
Expand All @@ -23,7 +27,18 @@ if [ -f "/etc/debian_version" ]; then
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev

elif [ -f "/etc/fedora-release" ] || [ -f "/etc/redhat-release" ]; then
echo -e "\e[33mDetected Fedora/RedHat-based Linux. Installing dependencies...\e[0m"
sudo dnf group install -y development-tools
sudo dnf install -y \
webkit2gtk4.1-devel \
openssl-devel \
curl \
wget \
file \
libxdo-devel \
libayatana-appindicator-gtk3-devel \
librsvg2-devel
else
echo -e "\e[31mUnsupported OS: $(uname). Please install system dependencies manually.\e[0m"
exit 1
Expand Down Expand Up @@ -76,9 +91,14 @@ fi
# ---- Install Node.js and npm (if not installed) ----
if ! command -v node &> /dev/null; then
echo -e "${RED}Node.js is not installed. Installing...${NC}"
OS_TYPE=$(uname)
if [ "$OS_TYPE" = "Linux" ]; then
curl -fsSL https://deb.nodesource.com/setup_18.x | -E bash -
apt-get install -y nodejs
if [ -f "/etc/debian_version" ]; then
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
elif [ -f "/etc/fedora-release" ] || [ -f "/etc/redhat-release" ]; then
sudo dnf install -y nodejs npm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debian strictly uses Node version 18
curl -fsSL https://deb.nodesource.com/setup_18.x on line 97.

I would recommend the same for Fedora as well, to maintain consistency across distributions.

fi
elif [ "$OS_TYPE" = "Darwin" ]; then
brew install node
fi
Expand All @@ -91,30 +111,30 @@ fi

# ---- Set up the backend ----
echo -e "${YELLOW}Setting up backend...${NC}"
cd ../backend
cd "$REPO_ROOT/backend" || { echo -e "${RED}backend directory not found${NC}"; exit 1; }
rm -rf .env
python -m venv .env
source .env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
deactivate
cd ..

# ---- Set up the sync-microservice ----
echo -e "${YELLOW}Setting up sync-microservice...${NC}"
cd sync-microservice
cd "$REPO_ROOT/sync-microservice" || { echo -e "${RED}sync-microservice directory not found${NC}"; exit 1; }
rm -rf .sync-env
python -m venv .sync-env
source .sync-env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
deactivate
cd ..

# ---- Set up the frontend ----
echo -e "${YELLOW}Setting up frontend...${NC}"
cd frontend
cd "$REPO_ROOT/frontend" || { echo -e "${RED}frontend directory not found${NC}"; exit 1; }
npm install
cd src-tauri || { echo -e "${RED}src-tauri directory not found${NC}"; exit 1; }
cd "$REPO_ROOT/frontend/src-tauri" || { echo -e "${RED}src-tauri directory not found${NC}"; exit 1; }
cargo build || { echo -e "${RED}Cargo build failed in src-tauri. Please check your Tauri setup.${NC}"; exit 1; }
cd ../../
cd "$REPO_ROOT"

echo -e "${GREEN}Setup complete!${NC}, restart the terminal to apply changes."
Loading