Surqo is a full-stack IoT + AI platform composed of a FastAPI backend, a Next.js 15 frontend, and an optional IoT simulator that stands in for physical ESP32 hardware. This guide walks you through running every layer locally — from cloning the repo to seeing live sensor data stream into your browser dashboard.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ricardomb-tech/surqo/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before starting, make sure you have the following installed and accounts ready:
- Python 3.11+ — required by the backend
- uv (Astral) — replaces pip/venv; 10–100× faster installs
- Node.js 20+ — required by the Next.js frontend
- Supabase account — free tier at supabase.com (PostgreSQL + Auth)
- Upstash Redis account — free tier at console.upstash.com (cache + alert cooldowns)
- Groq API key — free at console.groq.com (Llama 3.3 70B, 14,400 req/day)
- HiveMQ Cloud account (optional) — free at console.hivemq.cloud for MQTT; leave
HIVEMQ_HOSTempty to skip
Backend Setup
The backend is a FastAPI application managed entirely byuv. It connects to Supabase PostgreSQL, Upstash Redis, and — optionally — HiveMQ Cloud for MQTT ingestion.
Install dependencies with uv
uv sync reads pyproject.toml and creates an isolated virtual environment in one shot — no pip install or python -m venv required.Copy the example environment file and fill in your credentials
.env in your editor and populate at minimum SUPABASE_URL, SUPABASE_KEY, DATABASE_URL, REDIS_URL, and GROQ_API_KEY. See the Environment Variables reference for the full list and where to obtain each value.Start the FastAPI development server
fastapi dev command enables hot-reload automatically. Swagger UI is disabled in production (APP_ENV=production) but fully available in local development.Frontend Setup
The frontend is a Next.js 15 application using the App Router, React Server Components, and@supabase/ssr for cookie-based auth.
Create the local environment file
Next.js reads public variables from
.env.local. Create the file with the values below — replace the Supabase placeholders with your real project URL and anon key..env.local
IoT Simulator
When developing without physical ESP32 hardware, the bundled Python simulator generates realistic microclimate readings and pushes them to the backend over HTTP or MQTT.- Temperature — sinusoidal curve ranging 22 °C → 34 °C across a 24-hour period
- Humidity — inverse relationship to temperature (peaks at night, drops at midday)
- Rainfall — probabilistic events that temporarily spike humidity and soil moisture
- Solar UV index — sun-arc model peaking around solar noon