DRKM Blueprint System

Active

Environments

Development, CI, and production environments

Active·Owner: rafa·2026-04-04

Environment Overview

The system operates in three distinct environments with different characteristics and purposes.

Production Environment

| Property | Value | |---|---| | Hostname | blueprint.darkmattersystems.com (TBD) | | Platform | Cloudflare Pages | | Source | main branch | | Deploy trigger | Push to main | | Build time | ~30-60 seconds | | Uptime SLA | 99.95% (Cloudflare) | | Caching | Full HTTP caching, instant invalidation on deploy | | Availability | Global edge locations | | Cost | Minimal (~$5-20/month) | | Monitoring | Cloudflare analytics, broken link checks |

Purpose: Live documentation site for all stakeholders. Always represents current main branch.

Access: Anyone with internet access can view. Only GitHub contributors can modify (via PR/merge).

Recovery: Rollback via git revert HEAD, redeploy in 60 seconds.

Development Environment

| Property | Value | |---|---| | Run command | npm run dev | | Port | localhost:3000 | | Platform | Local Next.js dev server | | Source | Local file system (any branch) | | Hot reload | Enabled (instant refresh on file change) | | Type checking | Real-time (TypeScript errors in browser) | | Build artifacts | In-memory, not persisted | | Database | None (all content is static files) | | Authentication | None required |

Purpose: Local development and testing. Used by developers when editing content or code.

Features:

  • Hot module reloading — save file, see changes instantly
  • Full error messages in browser console
  • Fast iteration without build wait time
  • Can test against any Git branch

Access: Only the developer's local machine (not network accessible by default).

CI/CD Environment

| Property | Value | |---|---| | Platform | GitHub Actions | | Trigger | Every push to any branch, every PR | | Execution time | ~60 seconds | | Environment | Ubuntu runner (latest) | | Node.js version | 20.x (pinned) | | npm version | 9.x+ | | Access | GitHub only, no network access | | Artifacts | Built static files, deployed if main branch | | Secrets | Cloudflare Pages deployment token |

Purpose: Automated testing and deployment. Validates every change before deploying to production.

Workflow:

  • 1. Developer pushes code
  • 2. GitHub Actions runs workflow
  • 3. Type checking, validation, build, optimization
  • 4. If main branch: deploy to Cloudflare Pages
  • 5. If feature branch: run tests only, no deploy

Failure handling: Failed builds prevent deployment. Developer must fix and re-push.

Environment Promotion Flow

Local Development (any branch)
    ↓
Push to GitHub
    ↓
CI runs tests/build (all branches)
    ↓
If main branch:
    ↓
Deploy to Production (Cloudflare Pages)
    ↓
Live for all users

Feature branches build and test in CI but never deploy to production.

Configuration Management

| Setting | Dev | CI | Production | |---|---|---|---| | API endpoints | local/stub | staging | production | | Analytics enabled | off | off | on | | Error tracking | off | off | on | | Cache headers | no cache | no cache | full cache | | CSP headers | permissive | strict | strict |

Configuration is managed via Next.js environment variables (.env.local for dev, GitHub secrets for CI).

Rollback and Recovery

Immediate rollback (any environment):

bash
git revert HEAD
git push

CI re-deploys within 60 seconds

Manual deployment (if needed):

bash
npm ci
npm run build
npm run export

Upload static folder to Cloudflare Pages

Failure scenarios:

  • Build fails: Fix code, re-push, redeploy
  • Cloudflare Pages down: Static files cached at edge, users still see last version
  • Git history corrupted: Restore from GitHub remote

All failures have recovery paths under 5 minutes.