# moodyjw/angular-enterprise-blueprint architecture

> Architecture diagram of the GitHub repository moodyjw/angular-enterprise-blueprint, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/moodyjw/angular-enterprise-blueprint
- Repository: https://github.com/moodyjw/angular-enterprise-blueprint

## Overview

1. **Overall shape**
   This is an Angular 21 single-page application organized as a strict layered frontend architecture. The runtime is browser-based; there is no dedicated backend in this repo. Most “data” comes from static assets, mock strategies, or external public APIs/services.

2. **Bootstrap and application shell**
   `src/main.ts` bootstraps the app through `src/app/app.config.ts`, `app.routes.ts`, and the root `app.ts`/`app.html` component. The shell is responsible for global layout and route mounting, while feature pages are loaded lazily through Angular routing.

3. **Layered dependency boundary**
   The repo explicitly enforces:
   - **core**: application singletons and cross-cutting infrastructure
   - **features**: routed domain pages, isolated from each other
   - **shared**: reusable UI/components/utilities with no knowledge of core/features  
   This boundary is a major architectural constraint and should appear on any diagram.

4. **Core subsystem**
   `src/app/core` contains app-wide services and policy layers: auth, configuration, error handling, i18n loader/config, HTTP interceptors, analytics, SEO, logging, theme management, storage/security, and preload strategy. These are instantiated once and then consumed by routes/features.

5. **Authentication flow**
   Auth is strategy-based. The `MockAuthStrategy` in core stands in for a backend identity provider, with guards (`auth.guard`, `guest.guard`) protecting routes. Features like `auth/login` consume this core auth layer, but feature-to-feature auth coupling is intentionally avoided.

6. **Feature modules**
   `src/app/features` contains the routed business areas: home, blog, contact, modules, profile, architecture, and auth. Each feature has its own component(s) plus local service/state files, typically using SignalStore-style state management. Features are intended to be lazy-loaded and self-contained.

7. **Feature data sources**
   Several features are backed by static or semi-static content in `src/assets/data` and `src/assets/docs`:
   - blog articles and blog metadata
   - architecture/module JSON data
   - ADR documents and markdown content
   - i18n dictionaries in `src/assets/i18n`
   This means the app behaves more like a content-driven portfolio/blueprint than a CRUD app.

8. **Shared design system**
   `src/app/shared` is a large UI library of reusable, standalone components and utilities: buttons, cards, form controls, tabs, toast, tooltip, modal, layout primitives, theme picker, language switcher, etc. Storybook stories are present for many components, so the shared layer is a separately documented design system rather than just helper widgets.

9. **Cross-cutting runtime services**
   Several core services influence user-facing behavior across features:
   - **Theme service** toggles among accessible theme variants from `src/styles/themes`
   - **Transloco** handles multilingual text loading
   - **Analytics service/providers** route events to either console or Google Analytics
   - **SEO service** manages metadata
   - **Global error handling** converts runtime and HTTP failures into notifications/toasts
   - **CSRF/security services/interceptors** prepare HTTP requests for secure APIs when used  
   These are cross-cutting concerns rather than feature logic.

10. **Layout and navigation**
   Core layout components (`header`, `footer`, `main-layout`) form the persistent chrome around routed content. Shared navigation-related UI (user menu, nav dropdown, breadcrumb, language/theme controls) connects shell state to route context and user preferences.

11. **Tooling, docs, and verification pipeline**
   The repo is built around strong quality gates: Vitest unit tests, Playwright E2E, Storybook, Compodoc docs, ESLint/Prettier/Commitlint, Lighthouse CI, and CodeQL. GitHub Actions handle CI, dependency review, release automation, deployment, and performance audits. The architecture is therefore not just code structure, but also a delivery pipeline that validates boundaries, accessibility, performance, and security.

12. **Diagramming hint**
   A useful architecture diagram would show:
   - browser entry → app bootstrap → shell/layout → lazy-loaded features
   - features → core services/stores/interceptors
   - features/shared UI → static assets/i18n/data
   - core cross-cutting services → analytics, SEO, theme, auth, error notification
   - external outputs → GitHub Pages deployment, Storybook/docs, analytics provider, optional public APIs

Main entry points: [`src/app/app.routes.ts`](https://github.com/moodyjw/angular-enterprise-blueprint/blob/main/src/app/app.routes.ts) (Routes), [`src/app/shared/components`](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/shared/components) (UI kit), [`src/app/app.config.ts`](https://github.com/moodyjw/angular-enterprise-blueprint/blob/main/src/app/app.config.ts) (App config), [`src/app/core/services`](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/core/services) (Core services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_src_main(("main.ts<br/>bootstrap<br/>[main.ts]"))
  node_app_config["App config<br/>bootstrap config<br/>[app.config.ts]"]
  node_app_routes["Routes<br/>routing<br/>[app.routes.ts]"]
  node_app_shell["App shell<br/>root component<br/>[app.ts]"]
end

subgraph group_core["Core"]
  node_core_layout["Layout<br/>chrome"]
  node_core_auth["Auth<br/>security"]
  node_core_services["Core services<br/>cross-cutting services"]
  node_core_i18n["i18n<br/>translation setup"]
  node_core_interceptors["Interceptors<br/>http policy"]
  node_core_error["Errors<br/>error handling"]
end

subgraph group_features["Features"]
  node_feature_home["Home<br/>dashboard feature"]
  node_feature_blog["Blog<br/>content feature"]
  node_feature_modules["Modules<br/>catalog feature"]
  node_feature_profile["Profile"]
  node_feature_arch["Architecture<br/>docs feature"]
  node_feature_auth["Login<br/>auth feature"]
  node_feature_contact["Contact"]
end

subgraph group_shared["Shared"]
  node_shared_ui["UI kit<br/>component library"]
  node_shared_services["Shared services<br/>utility services"]
  node_shared_utils["Utilities<br/>helpers"]
end

subgraph group_content["Content"]
  node_assets_data[("Static content<br/>assets")]
  node_styles_themes["Themes<br/>styling system"]
end

subgraph group_delivery["Delivery"]
  node_delivery_ci["CI/CD<br/>automation<br/>[workflows]"]
  node_delivery_quality["Quality tools<br/>verification toolchain<br/>[package.json]"]
end

node_src_main -->|"boots"| node_app_config
node_app_config -->|"registers"| node_app_routes
node_app_config -->|"provides"| node_core_auth
node_app_config -->|"provides"| node_core_services
node_app_config -->|"provides"| node_core_i18n
node_app_config -->|"provides"| node_core_interceptors
node_app_config -->|"provides"| node_core_error
node_app_shell -->|"uses"| node_core_layout
node_app_routes -->|"lazy loads"| node_feature_home
node_app_routes -->|"lazy loads"| node_feature_blog
node_app_routes -->|"lazy loads"| node_feature_modules
node_app_routes -->|"lazy loads"| node_feature_profile
node_app_routes -->|"lazy loads"| node_feature_arch
node_app_routes -->|"lazy loads"| node_feature_auth
node_app_routes -->|"lazy loads"| node_feature_contact
node_feature_auth -->|"consumes"| node_core_auth
node_feature_home -->|"consumes"| node_core_services
node_feature_blog -->|"reads"| node_assets_data
node_feature_modules -->|"reads"| node_assets_data
node_feature_profile -->|"consumes"| node_core_services
node_feature_arch -->|"reads"| node_assets_data
node_feature_contact -->|"consumes"| node_core_services
node_core_layout -->|"composes"| node_shared_ui
node_feature_home -->|"uses"| node_shared_ui
node_feature_blog -->|"uses"| node_shared_ui
node_feature_modules -->|"uses"| node_shared_ui
node_feature_profile -->|"uses"| node_shared_ui
node_feature_contact -->|"uses"| node_shared_ui
node_feature_arch -->|"uses"| node_shared_ui
node_shared_ui -->|"depends on"| node_shared_services
node_shared_ui -->|"styled by"| node_styles_themes
node_core_services -->|"toggles"| node_styles_themes
node_core_services -->|"sources"| node_assets_data
node_core_i18n -->|"loads"| node_assets_data
node_core_error -->|"notifies"| node_shared_services
node_delivery_ci -->|"gates"| node_delivery_quality

click node_src_main "https://github.com/moodyjw/angular-enterprise-blueprint/blob/main/src/main.ts"
click node_app_config "https://github.com/moodyjw/angular-enterprise-blueprint/blob/main/src/app/app.config.ts"
click node_app_routes "https://github.com/moodyjw/angular-enterprise-blueprint/blob/main/src/app/app.routes.ts"
click node_app_shell "https://github.com/moodyjw/angular-enterprise-blueprint/blob/main/src/app/app.ts"
click node_core_layout "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/core/layout"
click node_core_auth "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/core/auth"
click node_core_services "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/core/services"
click node_core_i18n "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/core/i18n"
click node_core_interceptors "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/core/interceptors"
click node_core_error "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/core/error-handling"
click node_shared_ui "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/shared/components"
click node_shared_services "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/shared/services"
click node_shared_utils "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/shared/utilities"
click node_feature_home "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/features/home"
click node_feature_blog "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/features/blog"
click node_feature_modules "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/features/modules"
click node_feature_profile "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/features/profile"
click node_feature_arch "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/features/architecture"
click node_feature_auth "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/features/auth"
click node_feature_contact "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/features/contact"
click node_assets_data "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/assets"
click node_styles_themes "https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/styles/themes"
click node_delivery_ci "https://github.com/moodyjw/angular-enterprise-blueprint/blob/main/.github/workflows"
click node_delivery_quality "https://github.com/moodyjw/angular-enterprise-blueprint/blob/main/package.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_src_main,node_app_config,node_app_routes,node_app_shell toneBlue
class node_core_layout,node_core_auth,node_core_services,node_core_i18n,node_core_interceptors,node_core_error toneAmber
class node_feature_home,node_feature_blog,node_feature_modules,node_feature_profile,node_feature_arch,node_feature_auth,node_feature_contact toneMint
class node_shared_ui,node_shared_services,node_shared_utils toneRose
class node_assets_data,node_styles_themes toneIndigo
class node_delivery_ci,node_delivery_quality toneTeal
```

## Components

### Runtime

Browser entry, bootstrap, routing, and shell

- [main.ts](https://github.com/moodyjw/angular-enterprise-blueprint/blob/main/src/main.ts): bootstrap · Browser entry point that starts Angular and wires app config · `src/main.ts`
- [App config](https://github.com/moodyjw/angular-enterprise-blueprint/blob/main/src/app/app.config.ts): bootstrap config · Provides application-wide providers and startup wiring · `src/app/app.config.ts`
- [Routes](https://github.com/moodyjw/angular-enterprise-blueprint/blob/main/src/app/app.routes.ts): routing · Top-level route map with lazy feature loading · `src/app/app.routes.ts`
- [App shell](https://github.com/moodyjw/angular-enterprise-blueprint/blob/main/src/app/app.ts): root component · Root component and template that host the global layout · `src/app/app.ts`

### Core

Singleton services, policy, and cross-cutting infrastructure

- [Layout](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/core/layout): chrome · Persistent header, footer, and main layout around routed content · `src/app/core/layout`
- [Auth](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/core/auth): security · Strategy-based auth, guards, and auth state · `src/app/core/auth`
- [Core services](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/core/services): cross-cutting services · Analytics, architecture data, logging, security, SEO, storage, and theme services · `src/app/core/services`
- [i18n](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/core/i18n): translation setup · Transloco loader and configuration for multilingual content · `src/app/core/i18n`
- [Interceptors](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/core/interceptors): http policy · HTTP error and CSRF request handling · `src/app/core/interceptors`
- [Errors](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/core/error-handling): error handling · Global error handler and notification bridge · `src/app/core/error-handling`

### Features

Lazy routed business areas

- [Home](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/features/home): dashboard feature · Landing/dashboard routed feature with local state and service · `src/app/features/home`
- [Blog](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/features/blog): content feature · Blog list and detail pages backed by static article data · `src/app/features/blog`
- [Modules](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/features/modules): catalog feature · Module listing and detail views backed by JSON content · `src/app/features/modules`
- [Profile](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/features/profile): profile feature · Profile and stats view with feature-local state and service · `src/app/features/profile`
- [Architecture](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/features/architecture): docs feature · Architecture and ADR viewer driven by authored docs/data · `src/app/features/architecture`
- [Login](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/features/auth): auth feature · Guest-facing login screen that consumes core auth · `src/app/features/auth`
- [Contact](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/features/contact): contact feature · Contact page with local state and service integration · `src/app/features/contact`

### Shared

Reusable UI, services, and utilities

- [UI kit](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/shared/components): component library · Reusable standalone components, controls, and navigation primitives · `src/app/shared/components`
- [Shared services](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/shared/services): utility services · Toast and unique-id helpers used across the UI · `src/app/shared/services`
- [Utilities](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/app/shared/utilities): helpers · Generic debounce, throttle, and validation helpers · `src/app/shared/utilities`

### Content

Static assets and authored content

- [Static content](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/assets): assets · JSON, markdown, i18n, docs, images, and resume assets · `src/assets`
- [Themes](https://github.com/moodyjw/angular-enterprise-blueprint/tree/main/src/styles/themes): styling system · Theme tokens and accessible color variants · `src/styles/themes`

### Delivery

Tests, docs, Storybook, and CI

- [CI/CD](https://github.com/moodyjw/angular-enterprise-blueprint/blob/main/.github/workflows): automation · GitHub Actions workflows for test, deploy, security, and release · `.github/workflows`
- [Quality tools](https://github.com/moodyjw/angular-enterprise-blueprint/blob/main/package.json): verification toolchain · Vitest, Playwright, Storybook, ESLint, Lighthouse, and docs tooling · `package.json`

## Connections

- main.ts → App config: boots · Main initializes the app through shared configuration
- App config → Routes: registers · App config provides routing and feature loading
- App config → Auth: provides · Registers auth and route-guard infrastructure
- App config → Core services: provides · Wires singleton app services and policies
- App config → i18n: provides · Sets up translation loading and locale config
- App config → Interceptors: provides · Installs HTTP policy layers
- App config → Errors: provides · Connects global error handling
- App shell → Layout: uses · Root shell renders persistent chrome
- Routes → Home: lazy loads · Primary routed landing feature
- Routes → Blog: lazy loads · Blog routes are loaded on demand
- Routes → Modules: lazy loads · Modules routes are loaded on demand
- Routes → Profile: lazy loads · Profile routes are loaded on demand
- Routes → Architecture: lazy loads · Architecture routes are loaded on demand
- Routes → Login: lazy loads · Auth routes are loaded on demand
- Routes → Contact: lazy loads · Contact routes are loaded on demand
- Login → Auth: consumes · Login screen uses core auth strategy and guards
- Home → Core services: consumes · Dashboard feature pulls from core services and stores
- Blog → Static content: reads · Blog content comes from static JSON and markdown
- Modules → Static content: reads · Module catalog is driven by static JSON content
- Profile → Core services: consumes · Profile feature uses core data and runtime services
- Architecture → Static content: reads · Architecture viewer reads docs and architecture data
- Contact → Core services: consumes · Contact feature uses shared runtime services
- Layout → UI kit: composes · Shell chrome is built from reusable UI primitives
- Home → UI kit: uses · Features compose shared UI components
- Blog → UI kit: uses · Blog pages use shared cards, lists, and navigation UI
- Modules → UI kit: uses · Modules pages use shared display and navigation controls
- Profile → UI kit: uses · Profile view uses reusable cards and charts
- Contact → UI kit: uses · Contact page uses form and feedback components
- Architecture → UI kit: uses · Architecture viewer uses shared reading and layout UI
- UI kit → Shared services: depends on · UI components rely on toast and identifier helpers
- UI kit → Themes: styled by · Shared components consume the theme system
- Core services → Themes: toggles · Theme service switches accessible theme variants
- Core services → Static content: sources · Architecture, analytics, and content services read static assets
- i18n → Static content: loads · Translation dictionaries are stored in assets
- Errors → Shared services: notifies · Errors are surfaced through shared toast behavior
- CI/CD → Quality tools: gates · CI workflows run tests, linting, docs, E2E, and audits
