Skip to content

Latest commit

 

History

History
142 lines (108 loc) · 6.38 KB

GETTING_STARTED.md

File metadata and controls

142 lines (108 loc) · 6.38 KB

Getting Started

Prerequisites

Tool Version Purpose
Node.js 24+ Runtime
pnpm 10+ Package manager
Docker 20+ Infrastructure (PostgreSQL, Redis)
Docker Compose v2+ Service orchestration

Environment Variables

Variable Default Description
POSTGRES_USER mimir PostgreSQL user
POSTGRES_PASSWORD — PostgreSQL password (required)
POSTGRES_HOST localhost PostgreSQL host
POSTGRES_PORT 5432 PostgreSQL port
POSTGRES_DB mimir PostgreSQL database name
REDIS_HOST localhost Redis host
REDIS_PORT 6379 Redis port
DATABASE_URL (auto-constructed) Full PostgreSQL URL (overrides POSTGRES_* vars)
REDIS_URL (auto-constructed) Full Redis URL (overrides REDIS_* vars)
PORT 3001 API server port
CORS_ORIGIN http://localhost:5173 Allowed CORS origin (web app URL)
JWT_SECRET — Secret for JWT signing
SESSION_SECRET — Session encryption secret
SINDRI_CONSOLE_API_KEY — Bootstrap API key for agent registration
SINDRI_CONSOLE_URL http://localhost:3001 Console endpoint for Draupnir agents
SINDRI_BIN_PATH — Absolute path to Sindri CLI binary (optional)
SINDRI_CLI_TIMEOUT_MS 30000 Timeout for Sindri CLI commands
LOG_LEVEL info Pino log level (debug, info, warn, error)
NODE_ENV development Environment mode
AUTH_BYPASS — Set to true for dev auto-login (dev only)
BETTER_AUTH_URL http://localhost:3001 Base URL for auth callbacks
GITHUB_CLIENT_ID — GitHub OAuth client ID (optional)
GITHUB_CLIENT_SECRET — GitHub OAuth client secret (optional)
GOOGLE_CLIENT_ID — Google OAuth client ID (optional)
GOOGLE_CLIENT_SECRET — Google OAuth client secret (optional)
RESEND_API_KEY — Resend API key for magic link emails (optional)
EMAIL_FROM noreply@sindri.dev Sender address for magic link emails
METRICS_RETENTION_DAYS 30 Metrics data retention
LOGS_RETENTION_DAYS 14 Log data retention
EVENTS_RETENTION_DAYS 90 Event data retention
AUDIT_RETENTION_DAYS 365 Audit log retention

Setup

1. Clone and install

git clone https://github.com/pacphi/mimir.git
cd mimir
make install

2. Start infrastructure

This starts PostgreSQL (TimescaleDB) and Redis via Docker Compose:

make infra-up

Verify they're healthy:

make infra-status

3. Run database migrations

make db-migrate

4. Seed demo data

make db-seed

5. Start development servers

make dev

This starts both the API server (http://localhost:3001) and the web app (http://localhost:5173) in parallel.

Open http://localhost:5173 in your browser.

Authentication: For local development, set AUTH_BYPASS=true in your .env to skip OAuth setup. For setting up GitHub/Google OIDC and magic link email, see the Maintainer Guide — Authentication Setup.

Docker Compose (Full Stack)

To run everything in containers (no local Node.js required after building):

make stack-up

This starts all 4 services: PostgreSQL, Redis, API, and Web.

Other stack commands:

make stack-down      # Stop all services
make stack-logs      # Follow container logs
make stack-status    # Show container status
make stack-rebuild   # Rebuild images from scratch
make stack-nuke      # Destroy all volumes (data loss!)

Running Tests

make test            # Run all tests
make test-coverage   # Run with coverage report

Useful Commands

make ci              # Full CI pipeline (format, lint, typecheck, test, build)
make lint            # ESLint
make fmt             # Format with Prettier
make typecheck       # TypeScript type checking
make db-studio       # Open Prisma Studio (database GUI)
make db-reset        # Reset database (destroys all data)

See the Makefile for the full list of targets.

Next Steps