Architecture: How should the git-operations NX library be structured for r...
Documentation for Sessions
🏗️ Architecture: How should the git-operations NX library be structured for r...
Date: 2026-03-23
Time: 13:47:46 UTC
Session: gspace1-251.3
Agent: angular
Confidence: 93%
Status: ✅ Documented
📋 Decision Context
Question:
How should the git-operations NX library be structured for reuse across 3 apps (gograb-dev, gograb-admin, vitto-studio) with different permission levels?
Task: S251: Git operations library architecture
🎯 Decision Made
Chosen:
3-layer architecture: (1) Models layer — types, interfaces, role-based feature flag config with 4 tiers (executive/developer/admin/user). (2) Services layer — API service (injectable baseUrl + apiKey via DI tokens), state service (30+ signals, polling, filtering), format utils. (3) Config layer — provideGitOperations() factory for each app's app.config.ts. Future: components layer for extracted sub-components.
Options Considered:
- Inline components per app (duplicated, unmaintainable)
- Shared smart component with role input (couples presentation to business logic)
- Library with DI config + role flags (chosen — cleanest separation)
💭 Reasoning
The key insight is that git operations need different UI visibility per user role: executives and developers see server metrics, cross-space filtering, and admin actions; regular users only see their own space. Rather than building 3 separate implementations, a single library with injectable config and role-based feature flags achieves: (1) single source of truth for all git API interactions, (2) each app configures independently via DI, (3) role gating is frontend-only (backend enforces actual access), (4) new features added once benefit all consuming apps. The 4-tier role map with 10 boolean feature flags gives granular control without complexity.
📁 Files Involved
libs/libs-structural/git-operations/src/lib/models/git-operations.types.tslibs/libs-structural/git-operations/src/lib/models/git-operations-role.config.tslibs/libs-structural/git-operations/src/lib/services/git-operations-api.service.tslibs/libs-structural/git-operations/src/lib/services/git-operations-state.service.tslibs/libs-structural/git-operations/src/lib/config/git-operations.providers.ts
🔗 Related
- Decision ID:
dev_1774273666678_4vzdgd5 - Session: 251
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation