Architecture: How should the git-operations library be architected for reu...
Documentation for Sessions
🏗️ Architecture: How should the git-operations library be architected for reu...
Date: 2026-03-21
Time: 16:47:51 UTC
Session: gspace1-253.4
Agent: angular
Confidence: 93%
Status: ✅ Documented
📋 Decision Context
Question:
How should the git-operations library be architected for reuse across gograb-dev, gograb-admin, and vitto-studio with role-based access control?
Task: S251: Build reusable git-operations NX library
🎯 Decision Made
Chosen:
Created @libs-structural/git-operations as a standalone NX library with 3 layers: models (types + role config), services (API client + state manager + format utils), and config (provideGitOperations() factory). Role filtering via GitOpsFeatureFlags mapped to 4 tiers (executive/developer/admin/user). State managed via injectable singleton with signals. Each consuming app provides its own baseUrl and apiKey via DI, then sets the role tier to control visibility.
Options Considered:
- Inline component per app (duplicated, unmaintainable)
- Shared smart component with role input (couples presentation to business logic)
- NGXS store (over-engineering for this scope, signals are simpler)
💭 Reasoning
The git operations UI needs to be used in 3 apps with different permission levels: gograb-dev (developers, full access), gograb-admin (admins, limited write ops), and vitto-studio (users, scoped to their universe). Hardcoding the UI in one app would require duplication. An NX library with injectable config and role-based feature flags achieves: (1) single source of truth for types, API calls, and state logic; (2) app-specific customization via DI providers; (3) role-based UI gating without backend coupling (backend enforces actual access, frontend just hides UI). The 4-tier role map (executive/developer/admin/user) with 10 boolean feature flags gives fine-grained control without complexity. State service uses Angular signals for zero-overhead reactivity.
📁 Files Involved
libs/libs-structural/git-operations/src/index.tslibs/libs-structural/git-operations/src/lib/models/git-operations-role.config.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_1774111671403_0kmixf8 - Session: 253
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation