Skip to main content

Installation

This guide will help you install and set up Aida Platform on your system.

Prerequisites

Before installing Aida Platform, ensure you have the following:

System Requirements

  • Node.js: Version 18.0 or higher
  • npm: Version 8.0 or higher (comes with Node.js)
  • PostgreSQL: Version 13 or higher (for local database)
  • Git: For cloning the repository

Optional Dependencies

  • Docker: For containerized deployment
  • Redis: For caching and real-time features
  • Cisco Switch Access: For network integration
  • Building Automation Systems: For full functionality

Installation Methods

  1. Clone the Repository

    git clone https://github.com/aida-platform/aida-platform.git
    cd aida-platform
  2. Install Dependencies

    # Install frontend dependencies
    npm install

    # Install backend dependencies
    cd backend
    npm install
    cd ..
  3. Environment Configuration

    # Copy environment template
    cp env.example .env.development

    # Edit configuration
    nano .env.development
  4. Database Setup

    # Start PostgreSQL (if not running)
    sudo systemctl start postgresql

    # Create database
    createdb aida_platform

    # Run migrations
    cd backend
    npx prisma migrate dev
    npx prisma db seed
    cd ..
  5. Start Development Servers

    # Terminal 1: Frontend
    npm run dev

    # Terminal 2: Backend
    cd backend
    npm run dev

Method 2: Docker Setup

  1. Clone and Navigate

    git clone https://github.com/aida-platform/aida-platform.git
    cd aida-platform
  2. Environment Configuration

    cp env.example .env
    # Edit .env with your configuration
  3. Start with Docker Compose

    docker-compose up -d

Method 3: Production Deployment

For production deployment, see our Production Deployment Guide.

Environment Configuration

Required Environment Variables

Create a .env.development file with the following variables:

# Frontend Configuration
VITE_API_BASE_URL=http://localhost:8000/api
VITE_WS_URL=ws://localhost:8000/ws
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key

# Backend Configuration
LOCAL_DATABASE_URL=postgresql://aida_user:aida_password@localhost:5432/aida_platform
JWT_SECRET=your_jwt_secret_key
PORT=8000

# Optional: Supabase Configuration
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key

Database Configuration

PostgreSQL Setup

# Install PostgreSQL (Ubuntu/Debian)
sudo apt update
sudo apt install postgresql postgresql-contrib

# Create database and user
sudo -u postgres psql
CREATE DATABASE aida_platform;
CREATE USER aida_user WITH PASSWORD 'aida_password';
GRANT ALL PRIVILEGES ON DATABASE aida_platform TO aida_user;
\q

Prisma Configuration

# Generate Prisma client
cd backend
npx prisma generate

# Run migrations
npx prisma migrate dev

# Seed database
npx prisma db seed

Verification

After installation, verify your setup:

  1. Check Frontend

  2. Check Backend

  3. Check Database

    cd backend
    npx prisma studio
    # Should open Prisma Studio at http://localhost:5555

Default Credentials

After seeding, you'll have access to:

  • Local Admin Account:
    • Username: admin
    • Email: admin@aida-platform.local
    • Password: admin123

⚠️ Important: Change the default admin password after first login!

Troubleshooting

Common Issues

  1. Port Already in Use

    # Check what's using the port
    lsof -i :5173
    lsof -i :8000

    # Kill the process
    kill -9 <PID>
  2. Database Connection Failed

    # Check PostgreSQL status
    sudo systemctl status postgresql

    # Start PostgreSQL
    sudo systemctl start postgresql
  3. Permission Denied

    # Fix npm permissions
    sudo chown -R $(whoami) ~/.npm
  4. Module Not Found

    # Clear npm cache and reinstall
    npm cache clean --force
    rm -rf node_modules package-lock.json
    npm install

Getting Help

If you encounter issues:

  1. Check the Troubleshooting Guide
  2. Search existing GitHub Issues
  3. Join our Discord Community
  4. Contact Support

Next Steps

Once installation is complete:

  1. Quick Start Guide - Get your first building online
  2. Configuration Guide - Customize your setup
  3. Architecture Overview - Understand the system
  4. API Reference - Start integrating

Installation complete! 🎉 You're ready to start building with Aida Platform.