Skip to content

๐Ÿ–ฅ Local Development Environment Setup

This guide provides comprehensive instructions for setting up your local development environment for the DexaMinds platform.

๐Ÿš€ Prerequisites

Hardware Requirements

  • CPU: Quad-core 2.5 GHz or better
  • RAM: 16GB minimum (32GB recommended)
  • Storage: 50GB free space
  • OS: macOS 12+, Windows 10/11, or Linux

Required Software

  1. Git - Download
  2. Docker Desktop - Download
  3. Node.js (v18 LTS) - Download
  4. Python (3.9+) - Download
  5. Windsurf IDE - Download

๐Ÿ›  Installation Steps

1. Clone the Repository

git clone git@github.com:dexaminds/dexaminds.git
cd dexaminds

2. Configure Environment

Create a .env file in the project root with the following content:

# Backend Configuration
DEBUG=True
SECRET_KEY=your-secret-key-here
ALLOWED_HOSTS=localhost,127.0.0.1

# Database Configuration
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=dexaminds

# Frontend Configuration
NEXT_PUBLIC_API_URL=http://localhost:8000

3. Start Services

Database Services

# Start PostgreSQL and Redis
docker-compose up -d postgres redis

4. Backend Setup

# Navigate to backend directory
cd backend

# Create and activate virtual environment
python -m venv venv
# Windows: .\venv\Scripts\activate
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run migrations
python manage.py migrate

# Create admin user (follow prompts)
python manage.py createsuperuser

# Start development server
python manage.py runserver

5. Frontend Setup

# In a new terminal, navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

๐Ÿ” Verify Your Setup

  1. Frontend: Open http://localhost:3000
  2. Backend API: Open http://localhost:8000/api/
  3. Admin Panel: http://localhost:8000/admin/

๐Ÿงช Running Tests

Backend Tests

cd backend
pytest

Frontend Tests

cd frontend
npm test

๐Ÿ›  Common Setup Issues

Port Conflicts

If you encounter port conflicts:

# Find processes using a port (Linux/Mac)
lsof -i :8000

# Kill the process (replace <PID> with actual process ID)
kill -9 <PID>

# On Windows
netstat -ano | findstr :8000
taskkill /PID <PID> /F

Database Issues

If the database fails to start:

# Stop and remove containers with volumes
docker-compose down -v

# Start services again
docker-compose up -d postgres redis

๐Ÿ”„ Updating Your Environment

  1. Update Repository bash git pull origin main

  2. Update Dependencies ```bash # Frontend cd frontend npm install

# Backend cd ../backend source venv/bin/activate pip install -r requirements.txt ```

  1. Run Migrations bash python manage.py migrate

๐Ÿงฐ Development Tools

  • ESLint - JavaScript/TypeScript linting
  • Prettier - Code formatting
  • Python - Python support
  • Docker - Container management
  • GitLens - Git integration

Useful Commands

Database Management

# Start database services
docker-compose up -d postgres redis

# View database logs
docker-compose logs -f postgres

# Access PostgreSQL shell
PGPASSWORD=postgres psql -h localhost -U postgres -d dexaminds

Virtual Environment

# Activate virtual environment
# Windows: .\venv\Scripts\activate
source venv/bin/activate

# Install new package
pip install package-name
pip freeze > requirements.txt

๐Ÿค Getting Help

If you encounter any issues:

  1. Check the Debugging Guide

  2. Search the documentation

  3. Contact the Engineering Team at engineering-support@dexaminds.com

  4. Open a GitHub issue for bugs or feature requests