Architecture: How should all API configurations (backend-api, backend-ai-a...

Documentation for Sessions

🏗️ Architecture: How should all API configurations (backend-api, backend-ai-a...

Date: 2026-01-28
Time: 16:51:18 UTC
Session: editor2-72.79
Agent: backend
Confidence: 100%
Status: ✅ Documented


📋 Decision Context

Question:

How should all API configurations (backend-api, backend-ai-api, backend-docs-api) be consolidated for the monorepo?

Task: Not specified


🎯 Decision Made

Chosen:

Created @libs-foundational/api-config library with: 1) API_BASE_URL for backend-api, 2) AI_API_URL for backend-ai-api, 3) DOCS_API_URL for backend-docs-api, 4) API_CONFIG object token, 5) provideApiConfig() and provideApiConfigWithMock() helper functions. Updated core-angular, core-properties, command-center, and mcp.service to re-export from api-config for backward compatibility. Updated environment files to include docsApiUrl. Updated docs-api.service.ts to use DOCS_API_URL token.

Options Considered:

  1. Keep scattered token definitions across libraries
  2. Create single token file in core-angular
  3. Create dedicated @libs-foundational/api-config library

💭 Reasoning

A dedicated api-config library provides: 1) Single source of truth for all API URLs, 2) No circular dependency issues (api-config has no deps on other libs), 3) Smart environment detection with localhost fallbacks, 4) Clean provider helpers for app.config.ts, 5) Easy to add future APIs (just add new tokens), 6) Backward compatibility via re-exports from old locations.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation