A Turborepo monorepo with:
apps/web— Next.js 15 (App Router, Turbopack)apps/database— Drizzle ORM + PostgreSQLbackends/fastapi— FastAPI (Python 3.12+)
| Tool | Version | Install |
|---|---|---|
| Bun | ≥ 1.2 | curl -fsSL https://bun.sh/install | bash |
| Docker Desktop | latest | Download from docker.com |
| uv | ≥ 0.5 | curl -LsSf https://astral.sh/uv/install.sh | sh |
| Git | ≥ 2.40 | Pre-installed on Mac; winget install Git.Git on Windows |
# Install Homebrew if not present
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Bun
curl -fsSL https://bun.sh/install | bash
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh# Install Bun (PowerShell, run as Administrator)
powershell -c "irm bun.sh/install.ps1 | iex"
# Install uv (PowerShell)
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Ensure Git Bash or WSL2 is available (recommended for shell scripts)
winget install Git.GitWindows tip: For the best experience use WSL2 or Git Bash for all commands below.
git clone https://github.com/DIodide/TheForum.git
cd TheForum
# Installs all JS/TS workspace packages and sets up Husky pre-commit hooks
bun installCopy the example files and fill in your values:
# Root .env (used by docker-compose)
cp .env.example .env
# Database package .env (used by drizzle-kit CLI)
cp apps/database/.env.example apps/database/.env
# Next.js local env
cp apps/web/.env.local.example apps/web/.env.local
# FastAPI env
cp backends/fastapi/.env.example backends/fastapi/.envThe defaults in .env.example work as-is for local Docker development.
# Start PostgreSQL container in the background
bun run db:up
# Verify it's running
docker compose ps
# Check logs if needed
bun run db:logsThe database is reachable at postgresql://forum:forum_password@localhost:5432/the_forum.
# From the repo root — generates SQL migrations from schema changes
bun run db:generate # runs via turbo → apps/database
# Apply migrations
bun run db:migrate
# OR for rapid dev iteration (push schema directly, no migration files)
bun run db:pushcd apps/database
bun run db:studiocd backends/fastapi
# uv creates a .venv automatically and installs all deps
uv syncThis works identically on Mac, Linux, and Windows.
From the repo root:
bun run devThis starts (in parallel via Turborepo):
| Service | URL |
|---|---|
| Next.js (web) | http://localhost:3000 |
| FastAPI | http://localhost:8000 |
| FastAPI docs | http://localhost:8000/docs |
# Web only
cd apps/web && bun run dev
# FastAPI only
cd backends/fastapi && bun run dev
# or directly:
cd backends/fastapi && uv run uvicorn app.main:app --reload --port 8000Biome handles JS/TS linting and formatting.
# Lint + format all JS/TS files (auto-fix)
bun run check
# Format only
bun run format
# Check without fixing
bunx biome check .Pre-commit hooks run automatically on git commit (via Husky + lint-staged),
enforcing Biome on all staged JS/TS/JSON/CSS files.
For Python, use Ruff (already in dev dependencies):
cd backends/fastapi
uv run ruff check . # lint
uv run ruff format . # format# Stop the database container (data persisted in Docker volume)
bun run db:down
# Stop + destroy all data
docker compose down -vMake sure you copied the .env.example files (step 2) and that the database
container is running (bun run db:up).
Another PostgreSQL instance is running locally. Either stop it, or change
POSTGRES_PORT in your root .env (e.g. POSTGRES_PORT=5433) and update
DATABASE_URL accordingly.
Restart your terminal after installing uv so the PATH update takes effect.
On PowerShell you may need: $env:PATH += ";$env:USERPROFILE\.cargo\bin".
Run bun install again from the repo root — the prepare script re-installs
the hooks. If using WSL2, make sure you're running git from inside WSL.
Ensure Python dependencies are installed (cd backends/fastapi && uv sync)
and that uv is on your PATH.