Local dev stack improvements

- Extend docker-compose.dev.yml with optional monitoring profile
  (Prometheus, Grafana, Loki) via --profile monitoring
- Align dev PostgreSQL with production: pg_stat_statements + init scripts
- Add scripts/seed.ts with idempotent Berlin test data (user, route, activity)
- Add pnpm db:seed and pnpm dev:reset scripts
- Simplify CI e2e job: replace manual docker run + BRouter setup with
  docker compose up --wait; add db:seed step
- Improve scripts/dev.sh: Docker check, --wait health checks, --monitoring
  flag, seed step
- Add scripts/reset-dev.sh to wipe and restart the local stack
- Add .env.development.example with documented local defaults

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-05-17 20:49:06 +02:00
parent d7b3c7c1a5
commit 10e0a8d41a
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
10 changed files with 209 additions and 105 deletions

26
scripts/reset-dev.sh Executable file
View file

@ -0,0 +1,26 @@
#!/bin/bash
set -euo pipefail
PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
cd "$PROJECT_DIR"
if ! docker info > /dev/null 2>&1; then
echo "Error: Docker is not running. Please start Docker and try again."
exit 1
fi
echo "=== Resetting dev environment ==="
echo "This will stop all containers and wipe all local data volumes."
echo ""
read -r -p "Are you sure? [y/N] " confirm
if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then
echo "Aborted."
exit 0
fi
echo "Stopping containers and removing volumes..."
docker compose -f docker-compose.dev.yml --profile monitoring down -v 2>/dev/null || \
docker compose -f docker-compose.dev.yml down -v
echo "✓ Done. Run 'pnpm dev:full' to start fresh."