- Docker v20.10+ — Install Guide
- Docker Compose v2+ — Install Guide
- Git — Install Guide
- 4GB RAM minimum, 8GB recommended
# 1. Clone the repository
git clone https://github.com/rudra496/EdgeBrain.git
cd EdgeBrain
# 2. Start everything
docker compose up --build -d
# 3. Wait for services to initialize (~30 seconds)
# 4. Open the dashboard
open http://localhost:3000That's it! The system will:
- Start PostgreSQL with initialized tables
- Start Redis for event queuing
- Start Mosquitto MQTT broker
- Start the FastAPI backend
- Start the device simulator (generates sensor data)
- Start the React dashboard
# Check all containers are running
docker compose ps
# Expected: 6 services (postgres, redis, mosquitto, backend, simulator, frontend)
# Check API health
curl http://localhost:8000/api/v1/health
# Check sensor data is flowing
curl http://localhost:8000/api/v1/devices
# View API documentation
open http://localhost:8000/docs| Service | URL | Description |
|---|---|---|
| Dashboard | http://localhost:3000 | React web UI |
| API Docs | http://localhost:8000/docs | Swagger/OpenAPI |
| API | http://localhost:8000 | REST + WebSocket |
| MQTT | localhost:1883 | Mosquitto broker |
| WebSocket MQTT | localhost:9001 | MQTT over WS |
If you prefer running services natively:
# PostgreSQL
docker run -d --name edgebrain-pg \
-e POSTGRES_USER=edgebrain -e POSTGRES_PASSWORD=edgebrain -e POSTGRES_DB=edgebrain \
-p 5432:5432 postgres:16-alpine
# Redis
docker run -d --name edgebrain-redis -p 6379:6379 redis:7-alpine
# Mosquitto
docker run -d --name edgebrain-mqtt -p 1883:1883 -p 9001:9001 \
-v $(pwd)/docker/mosquitto.conf:/mosquitto/config/mosquitto.conf \
eclipse-mosquitto:2psql postgresql://edgebrain:edgebrain@localhost:5432/edgebrain -f docker/init.sqlcd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Set environment
export DATABASE_URL=postgresql://edgebrain:edgebrain@localhost:5432/edgebrain
export REDIS_URL=redis://localhost:6379/0
export MQTT_HOST=localhost
export MQTT_PORT=1883
uvicorn app.main:app --reload --port 8000cd device-simulator
pip install paho-mqtt==2.0.0
python simulator.pycd frontend
npm install
npm start| Variable | Default | Description |
|---|---|---|
DATABASE_URL |
postgresql://edgebrain:edgebrain@postgres:5432/edgebrain |
PostgreSQL connection |
REDIS_URL |
redis://redis:6379/0 |
Redis connection |
MQTT_HOST |
mosquitto |
MQTT broker host |
MQTT_PORT |
1883 |
MQTT broker port |
DEBUG |
true |
Debug mode |
Edit backend/app/ai/rules.py to add custom thresholds or create a new strategy class.
Add a new SimulatedDevice in device-simulator/simulator.py:
SimulatedDevice("room-3-sensor-humidity", "humidity"),docker compose logs backend
# Common: PostgreSQL not ready yet. Docker Compose handles this with healthcheck.# Check simulator is running
docker compose logs simulator
# Check MQTT connection
docker compose logs backend | grep MQTT# Ensure backend is running
curl http://localhost:8000/api/v1/health
# Check CORS — default allows all origins in dev modedocker compose down -v # Removes volumes too
docker compose up --build -d