๐ฅ 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
- Git - Download
- Docker Desktop - Download
- Node.js (v18 LTS) - Download
- Python (3.9+) - Download
- 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
- Frontend: Open http://localhost:3000
- Backend API: Open http://localhost:8000/api/
- 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
-
Update Repository
bash git pull origin main
-
Update Dependencies ```bash # Frontend cd frontend npm install
# Backend cd ../backend source venv/bin/activate pip install -r requirements.txt ```
- Run Migrations
bash python manage.py migrate
๐งฐ Development Tools
Recommended Extensions
- 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:
-
Check the Debugging Guide
-
Search the documentation
-
Contact the Engineering Team at engineering-support@dexaminds.com
-
Open a GitHub issue for bugs or feature requests