managarten/docs
Wuesteon aab8c73a9c feat: add multi-layered runtime config protection system
Add comprehensive defense system to prevent runtime config bugs across all projects:

## 1. Enhanced ESLint Rules
- Added @typescript-eslint/no-floating-promises (error)
  Catches: fetch(`${getAuthUrl()}/api`) without await
- Added @typescript-eslint/no-misused-promises (error)
  Catches: Promises in conditionals and logical expressions
- Added @typescript-eslint/require-await (warn)
  Ensures async functions actually use await

## 2. Validation Script (scripts/validate-runtime-config.mjs)
Automated checker that scans all web apps for:
-  Required files (runtime.ts, docker-entrypoint.sh, Dockerfile)
-  Window injection patterns (window.__PUBLIC_*)
-  Build-time env usage in stores/api (import.meta.env.PUBLIC_*)
-  Missing await on async config functions
- ⚠️  Docker entrypoint best practices

Usage: pnpm validate:runtime-config

## 3. Comprehensive Documentation (docs/RUNTIME_CONFIG.md)
Complete implementation guide covering:
- Why runtime configuration is needed
- Step-by-step implementation guide
- Common patterns (API clients, auth stores)
- Anti-patterns to avoid
- Migration checklist
- ESLint protection details

## Benefits
- Prevents "[object Promise]" in API URLs (staging bug)
- Catches missing await at lint time
- Validates all apps automatically
- Clear documentation for new projects
- Can run in CI/CD

## Future Work
- Add to pre-push hook (optional)
- Create project generator/template
- Shared runtime config package

This prevents the class of bugs we just fixed in manacore-web where
getAuthUrl() was called without await, causing ERR_CONNECTION_REFUSED
on staging.
2025-12-16 00:28:57 +01:00
..
architecture docs(architecture): add Workspace Orchestrator architecture decision 2025-12-12 03:48:11 +01:00
central-services feat(splitscreen): add split-screen feature for multi-app side-by-side view 2025-12-12 13:00:26 +01:00
daily-reports feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
optimizable feat(contacts): integrate contacts into Todo and Calendar apps 2025-12-11 18:14:35 +01:00
pr-reviews docs(pr-reviews): add code review for PR #14 2025-12-10 21:12:06 +01:00
test-examples style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
BACKEND_ARCHITECTURE.md Feat: New project chat, uload refactor (postgress), hosting plans, uload landingpage 2025-11-25 13:01:41 +01:00
CHANGELOG_2025-11-24.md feat: add i18n localization with language switcher to all web apps 2025-11-25 01:41:25 +01:00
CI_CD_SETUP.md first implementation 2025-11-27 17:26:18 +01:00
DATABASE_MIGRATIONS.md feat(db): add production-safe migration system with advisory locks 2025-12-09 02:13:11 +01:00
DEPENDENCY_ALIGNMENT.md style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
DEPLOYMENT.md feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
DEPLOYMENT_ARCHITECTURE.md feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
DEPLOYMENT_DIAGRAMS.md feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
DEPLOYMENT_HETZNER.md docs: add Hetzner deployment guide and update lockfile 2025-11-27 14:47:35 +01:00
DEPLOYMENT_RUNBOOKS.md feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
DEVELOPMENT_SCRIPTS.md style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
DOCKER_GUIDE.md style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
DOCKER_SETUP_ANALYSIS.md 🔒️ feat(auth): centralize JWT validation and add deployment docs 2025-12-01 20:44:45 +01:00
ENV_AUDIT_SUMMARY.md fix(ci): build shared packages before tests and fix formatting 2025-12-01 23:15:00 +01:00
ENV_BACKEND_MATRIX.md fix(ci): build shared packages before tests and fix formatting 2025-12-01 23:15:00 +01:00
ENV_CONFIGURATION_AUDIT.md fix(ci): build shared packages before tests and fix formatting 2025-12-01 23:15:00 +01:00
ENVIRONMENT_VARIABLES.md 🧑‍💻 chore: add centralized environment variable system 2025-11-26 13:08:50 +01:00
GIT_WORKFLOW.md docs: update git workflow - keep individual commits 2025-12-10 21:12:06 +01:00
HETZNER_DEPLOYMENT_SUMMARY.md fix(ci): build shared packages before tests and fix formatting 2025-12-01 23:15:00 +01:00
HETZNER_PRODUCTION_GUIDE.md fix(ci): build shared packages before tests and fix formatting 2025-12-01 23:15:00 +01:00
I18N.md Feat: New project chat, uload refactor (postgress), hosting plans, uload landingpage 2025-11-25 13:01:41 +01:00
LOCAL_DEVELOPMENT.md 🧑‍💻 dx: add automatic database setup and dev:*:full commands 2025-12-08 14:38:18 +01:00
MANADECK_POSTGRES_MIGRATION.md fix(db): use TEXT for user_id columns across entire codebase 2025-12-09 16:30:51 +01:00
PROJECT_OVERVIEW.md style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
PWA_GUIDE.md feat(todo): add PWA support with offline capabilities 2025-12-09 14:40:42 +01:00
README_ENV_AUDIT.md fix(ci): build shared packages before tests and fix formatting 2025-12-01 23:15:00 +01:00
RUNTIME_CONFIG.md feat: add multi-layered runtime config protection system 2025-12-16 00:28:57 +01:00
SELF-HOSTING-GUIDE.md feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
SETUP_TEMPLATES.md docs: add setup templates and checklists for recurring tasks 2025-12-09 01:00:02 +01:00
SHARED_PACKAGES_ROADMAP.md style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
STAGING_DEPLOYMENT_ISSUES.md docs: comprehensive staging deployment troubleshooting guide 2025-12-08 23:11:01 +01:00
STAGING_SETUP.md docs: add comprehensive staging environment setup guide 2025-12-10 03:35:28 +01:00
SVELTE_CHECK_ISSUES.md ️ fix: resolve all svelte-check a11y warnings across web apps 2025-12-15 19:09:01 +01:00
TESTING.md first implementation 2025-11-27 17:26:18 +01:00
TESTING_IMPLEMENTATION_GUIDE.md first implementation 2025-11-27 17:26:18 +01:00
TESTING_SUMMARY.md style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
ULOAD-DEPLOYMENT.md feat: major update with network graphs, themes, todo extensions, and more 2025-12-10 02:37:46 +01:00
USER_SETTINGS.md feat(auth): add centralized user settings synced across all apps 2025-12-03 00:09:47 +01:00