#!/bin/bash # Verify Archipelago Installation # This script checks if all required dependencies are properly installed set -e # Colors RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' ERRORS=0 echo "============================================" echo "Archipelago Installation Verification" echo "============================================" echo "" # Function to check command check_command() { local cmd=$1 local name=$2 local version_flag=${3:---version} if command -v "$cmd" >/dev/null 2>&1; then local version=$($cmd $version_flag 2>&1 | head -n 1) echo -e "${GREEN}✓${NC} $name: $version" return 0 else echo -e "${RED}✗${NC} $name: NOT FOUND" ERRORS=$((ERRORS + 1)) return 1 fi } # Check system tools echo "System Tools:" check_command "rustc" "Rust Compiler" "--version" check_command "cargo" "Cargo" "--version" check_command "node" "Node.js" "--version" check_command "npm" "NPM" "--version" check_command "podman" "Podman" "--version" check_command "psql" "PostgreSQL" "--version" echo "" # Check optional tools echo "Optional Tools:" check_command "brew" "Homebrew" "--version" || echo -e "${YELLOW} (Homebrew is recommended for macOS)${NC}" echo "" # Check project dependencies echo "Project Dependencies:" # Check frontend dependencies if [ -d "neode-ui/node_modules" ]; then echo -e "${GREEN}✓${NC} Frontend dependencies installed" else echo -e "${RED}✗${NC} Frontend dependencies NOT installed" echo -e "${YELLOW} Run: cd neode-ui && npm install${NC}" ERRORS=$((ERRORS + 1)) fi # Check custom app dependencies for app in did-wallet endurain morphos-server router web5-dwn; do if [ -d "apps/$app/node_modules" ]; then echo -e "${GREEN}✓${NC} $app dependencies installed" else echo -e "${YELLOW}⚠${NC} $app dependencies NOT installed" echo -e "${YELLOW} Run: cd apps/$app && npm install${NC}" fi done echo "" # Check Rust build echo "Rust Backend:" if [ -d "core/target" ]; then echo -e "${GREEN}✓${NC} Backend has been built" else echo -e "${YELLOW}⚠${NC} Backend not built yet" echo -e "${YELLOW} Run: cd core && cargo build${NC}" fi echo "" # Check Podman machine echo "Container Runtime:" if podman machine list 2>/dev/null | grep -q "Running"; then echo -e "${GREEN}✓${NC} Podman machine is running" elif podman machine list 2>/dev/null | grep -q "Stopped"; then echo -e "${YELLOW}⚠${NC} Podman machine exists but not running" echo -e "${YELLOW} Run: podman machine start${NC}" else echo -e "${YELLOW}⚠${NC} Podman machine not initialized" echo -e "${YELLOW} Run: podman machine init && podman machine start${NC}" fi echo "" # Check PostgreSQL echo "Database:" if brew services list 2>/dev/null | grep postgresql | grep -q started; then echo -e "${GREEN}✓${NC} PostgreSQL service is running" elif psql --version >/dev/null 2>&1; then echo -e "${YELLOW}⚠${NC} PostgreSQL installed but service not running" echo -e "${YELLOW} Run: brew services start postgresql@15${NC}" else echo -e "${YELLOW}⚠${NC} PostgreSQL status unknown" fi # Check if database exists if psql -lqt 2>/dev/null | cut -d \| -f 1 | grep -qw archipelago_dev; then echo -e "${GREEN}✓${NC} Development database 'archipelago_dev' exists" else echo -e "${YELLOW}⚠${NC} Development database 'archipelago_dev' not found" echo -e "${YELLOW} Run: createdb archipelago_dev${NC}" fi echo "" # Check environment files echo "Configuration:" if [ -f "core/.env" ]; then echo -e "${GREEN}✓${NC} Backend .env file exists" else echo -e "${YELLOW}⚠${NC} Backend .env file not found" echo -e "${YELLOW} Copy: cp core/.env.example core/.env${NC}" fi if [ -f "neode-ui/.env" ]; then echo -e "${GREEN}✓${NC} Frontend .env file exists" else echo -e "${YELLOW}⚠${NC} Frontend .env file not found" echo -e "${YELLOW} Copy: cp neode-ui/.env.example neode-ui/.env${NC}" fi echo "" echo "============================================" if [ $ERRORS -eq 0 ]; then echo -e "${GREEN}✓ All required dependencies are installed!${NC}" echo "" echo "You can now start the project:" echo " 1. Terminal 1: cd core && cargo run --bin archipelago" echo " 2. Terminal 2: cd neode-ui && npm run dev" echo " 3. Open http://localhost:8100" else echo -e "${RED}✗ $ERRORS required dependencies are missing${NC}" echo "" echo "Please install missing dependencies:" echo " Run: ./INSTALL.sh" echo "" echo "Or follow the manual installation guide:" echo " See: SETUP_GUIDE.md" fi echo "============================================" echo "" exit $ERRORS