Convention: How should frontend apps configure their API connections?

Documentation for Sessions

📏 Convention: How should frontend apps configure their API connections?

Date: 2026-02-05
Time: 03:49:43 UTC
Session: editor2-89.4
Agent: architecture
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

How should frontend apps configure their API connections?

Task: Standardizing API configuration across all frontend apps


🎯 Decision Made

Chosen:

Centralized api-config library with presets

Options Considered:

  1. Each app has its own environment config
  2. Centralized api-config library with presets
  3. Hardcoded URLs per environment

💭 Reasoning

All frontend apps (gograb-space, gograb-admin, gograb-dev, gograb-ai) MUST use @libs-foundational/api-config for DRY API configuration. Pattern: (1) Import provideApiConfig and ENVIRONMENT_PRESETS, (2) Use ...provideApiConfig(ENVIRONMENT_PRESETS.localWithProxy) in app.config.ts providers, (3) Reference shared proxy.conf.json at libs/libs-foundational/api-config/proxy.conf.json in project.json serve target, (4) AuthService from @auth-ui automatically uses API_BASE_URL token. This ensures consistent API handling across all apps and makes it easy to switch between mock/proxy/direct modes.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation