Dev Setup
This page walks you through setting up a complete local CleverThis development environment. The local stack runs the Next.js webapp, the FastAPI server, and all backing services (PostgreSQL, Redis) via Docker Compose.
Prerequisites
| Tool | Minimum version | Install |
|---|---|---|
| Node.js | 20 LTS | nodejs.org or nvm |
| pnpm | 9 | npm install -g pnpm |
| Python | 3.11 | python.org or pyenv |
| nox | 2024.x | pip install nox |
| Docker + Docker Compose | Docker 24+ | docker.com |
Clone and install
git clone https://github.com/cleverthis/cleverthis.git
cd cleverthis
# Install JS dependencies (webapp + tooling)
pnpm install
# Install Python dev dependencies
pip install nox
nox -s install # installs the Python packages in editable mode with dev extras
Start backing services
docker compose up -d postgres redis
This starts PostgreSQL on port 5432 and Redis on port 6379 with default dev credentials.
Run database migrations
nox -s migrate
Start the development servers
In one terminal, start the FastAPI server:
nox -s dev-api
In another terminal, start the Next.js webapp:
pnpm dev
The webapp is now available at http://localhost:3000. The API server runs on http://localhost:8000.
Environment variables
Copy .env.example to .env.local and fill in the required values:
cp .env.example .env.local
At minimum, set DATABASE_URL, REDIS_URL, NEXTAUTH_SECRET, and at least one LLM provider key (e.g. OPENAI_API_KEY).
A one-command docker compose up setup that starts everything (webapp, API, backing services) together with hot reload is being added.