Architecture: How to handle API mocking when migrating features from gogra...
Documentation for Sessions
🏗️ Architecture: How to handle API mocking when migrating features from gogra...
Date: 2026-02-05
Time: 03:49:33 UTC
Session: editor2-89.2
Agent: backend
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
How to handle API mocking when migrating features from gograb-modules (no backend) to editor2 (has backend-api)?
Task: Fixing gograb-admin auth - removing mock API interference
🎯 Decision Made
Chosen:
Use environment-based selection (mock vs real backend)
Options Considered:
- Keep mock API from gograb-modules as-is
- Remove mock API entirely and use real backend-api
- Use environment-based selection (mock vs real backend)
💭 Reasoning
When migrating features from gograb-modules monorepo to editor2 monorepo, the mock API interceptors cause conflicts because editor2 has a real backend-api. The solution is NOT to simply remove mocks, but to implement proper environment-based API selection: (1) Development with proxy -> real backend-api via proxy, (2) Development without backend -> mock API, (3) Production -> real backend. All apps should use centralized @libs-foundational/api-config with ENVIRONMENT_PRESETS to auto-select the appropriate API mode. If backend-api is missing features needed by the frontend, implement them in backend-api rather than relying on mocks.
📁 Files Involved
apps/gograb-admin/src/app/app.config.tslibs/libs-foundational/api-config/src/lib/environment-presets.tslibs/libs-foundational/api-config/proxy.conf.json
🔗 Related
- Decision ID:
dev_1770263373235_kir4j27 - Session: 89
- Workspace: editor2
Auto-generated by MCP Smart Consolidation