# abhijeetr7/angular-ngrx-nx-realworld-example-app architecture

> Architecture diagram of the GitHub repository abhijeetr7/angular-ngrx-nx-realworld-example-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhijeetr7/angular-ngrx-nx-realworld-example-app
- Repository: https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app

## Overview

1. This is an Nx monorepo for an Angular “Conduit” client, organized as one shell app plus many feature libraries. The architecture is intentionally split by domain and by responsibility, so most logic lives in reusable libs instead of the app.

2. The runtime entrypoint is `apps/conduit`. It contains the root Angular application shell (`app.component`, `app.config`, `main.ts`) plus global layout pieces like the navbar and footer. That shell mainly composes routed features and shared layout.

3. Feature work is grouped by domain:
   - `libs/auth/*` for login/register/auth state
   - `libs/articles/*` for article list, article detail, editor, comments, and markdown rendering
   - `libs/profile/*` for profile pages and profile-related article lists
   - `libs/home/*` for the home feed and tags
   - `libs/settings/*` for user settings
   These libraries are what you would draw as the main user-facing subsystems.

4. The architecture follows a “smart feature / dumb UI” split. `feature-*` libraries contain routed screens and orchestration logic, while `libs/ui/components` contains reusable presentational pieces such as the pager. The app-level navbar/footer also act as shared presentation components.

5. Server interaction is isolated in `data-access` libraries. Each domain has its own stores and services, for example `auth.store.ts`, `article.store.ts`, `articles-list.store.ts`, and `profile.store.ts`. These are the boundary between UI and API calls, and they encapsulate loading state, optimistic updates, and error handling.

6. State management is built around NgRx Signal Store rather than classic reducers/effects. Stores own the reactive state for a domain and use methods built with RxJS operators to fetch/update data. This means most screen components are thin consumers of store signals and actions.

7. Shared infrastructure lives under `libs/core`. Important sub-bounds are:
   - `core/api-types` for shared API contracts (`article`, `auth`, `comment`, `profile`, `user`)
   - `core/http-client` for API URL/token wiring and base API service
   - `core/error-handler` for global HTTP/error interception and error state
   - `core/forms` for validation/error-display helpers
   - `core/data-access` for shared state helpers like call-state tracking
   These libraries are the common foundation used by multiple domains.

8. Routing is feature-local and lazy-loaded. Feature libraries expose route definitions such as `article.routes.ts`, `profile.routes.ts`, and `article-edit.routes.ts`, and the app shell loads them on demand. Resolvers and guards live next to the features they protect, which keeps data preloading and auth checks near the route boundary.

9. The external dependency boundary is the RealWorld backend API. Authentication uses JWT-backed requests, and the app supports the expected CRUD flows for articles, comments, favorites, profiles, and settings. The frontend does not own persistence; all authoritative data comes from that API.

10. The home/article/profile flows are built from the data-access layer upward: stores fetch lists or detail records, feature components render them, and smaller child components handle list items, article metadata, comments, and tags. Pagination is a shared concern surfaced through the pager UI component and list-related stores.

11. Testing is split between unit tests in each app/lib and Playwright end-to-end tests in `apps/conduit-e2e`. The E2E suite covers auth, article lists, and article creation flows, with helper utilities for user registration/login. This gives a clear separation between isolated component/store behavior and full user journeys.

Main entry points: [`apps/conduit`](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/apps/conduit) (Conduit app), [`libs/articles/data-access`](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/articles/data-access) (Articles store), [`libs/auth/data-access`](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/auth/data-access) (Auth store), [`apps/conduit-e2e`](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/apps/conduit-e2e) (E2E tests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_apps["Apps"]
  node_node_app_shell["Conduit app<br/>Angular shell"]
  node_node_e2e["E2E tests<br/>Playwright suite"]
end

subgraph group_group_auth["Auth"]
  node_node_auth_feature["Auth screens<br/>feature-auth"]
  node_node_auth_data[("Auth store<br/>auth data-access")]
end

subgraph group_group_articles["Articles"]
  node_node_articles_list["Article list<br/>feature-articles-list"]
  node_node_article_detail["Article page<br/>feature-article"]
  node_node_article_edit["Editor<br/>feature-article-edit"]
  node_node_articles_data[("Articles store<br/>articles data-access")]
end

subgraph group_group_profile["Profile"]
  node_node_profile_feature["Profile page<br/>feature-profile"]
  node_node_profile_data[("Profile store<br/>profile data-access")]
end

subgraph group_group_home["Home"]
  node_node_home_feature["Home feed<br/>feature-home"]
  node_node_home_store[("Home store<br/>home state")]
end

subgraph group_group_settings["Settings"]
  node_node_settings_feature["Settings page<br/>feature-settings"]
end

subgraph group_group_core["Core"]
  node_node_core_api["API types<br/>core contracts"]
  node_node_core_http[("HTTP client<br/>core transport")]
  node_node_core_error[("Error handler<br/>core errors")]
  node_node_core_forms["Forms helpers<br/>core forms"]
  node_node_core_state[("Call state<br/>core state")]
end

subgraph group_group_ui["UI"]
  node_node_ui_pager["Pager<br/>ui component"]
end

node_node_app_shell -->|"routes to"| node_node_auth_feature
node_node_app_shell -->|"routes to"| node_node_home_feature
node_node_app_shell -->|"routes to"| node_node_articles_list
node_node_app_shell -->|"routes to"| node_node_article_detail
node_node_app_shell -->|"routes to"| node_node_article_edit
node_node_app_shell -->|"routes to"| node_node_profile_feature
node_node_app_shell -->|"routes to"| node_node_settings_feature
node_node_app_shell -->|"uses"| node_node_auth_data
node_node_app_shell -->|"uses"| node_node_core_error
node_node_app_shell -->|"shares"| node_node_ui_pager
node_node_auth_feature -->|"reads/writes"| node_node_auth_data
node_node_auth_feature -->|"uses"| node_node_core_forms
node_node_auth_data -->|"calls"| node_node_core_http
node_node_auth_data -->|"models"| node_node_core_api
node_node_articles_list -->|"reads"| node_node_articles_data
node_node_articles_list -->|"uses"| node_node_ui_pager
node_node_article_detail -->|"reads/writes"| node_node_articles_data
node_node_article_detail -->|"uses"| node_node_core_forms
node_node_article_detail -->|"models"| node_node_core_api
node_node_article_edit -->|"writes"| node_node_articles_data
node_node_article_edit -->|"uses"| node_node_core_forms
node_node_articles_data -->|"calls"| node_node_core_http
node_node_articles_data -->|"tracks"| node_node_core_state
node_node_articles_data -->|"models"| node_node_core_api
node_node_profile_feature -->|"reads"| node_node_profile_data
node_node_profile_feature -->|"lists"| node_node_articles_data
node_node_profile_data -->|"calls"| node_node_core_http
node_node_profile_data -->|"models"| node_node_core_api
node_node_home_feature -->|"reads"| node_node_home_store
node_node_home_feature -->|"lists"| node_node_articles_data
node_node_home_feature -->|"uses"| node_node_ui_pager
node_node_home_store -->|"coordinates"| node_node_articles_data
node_node_settings_feature -->|"uses"| node_node_auth_data
node_node_core_error -->|"integrates"| node_node_core_http
node_node_e2e -->|"exercises"| node_node_app_shell
node_node_e2e -->|"covers"| node_node_auth_feature
node_node_e2e -->|"covers"| node_node_articles_list
node_node_e2e -->|"covers"| node_node_article_edit

click node_node_app_shell "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/apps/conduit"
click node_node_e2e "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/apps/conduit-e2e"
click node_node_auth_feature "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/auth/feature-auth"
click node_node_auth_data "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/auth/data-access"
click node_node_articles_list "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/articles/feature-articles-list"
click node_node_article_detail "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/articles/feature-article"
click node_node_article_edit "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/articles/feature-article-edit"
click node_node_articles_data "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/articles/data-access"
click node_node_profile_feature "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/profile/feature-profile"
click node_node_profile_data "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/profile/data-access"
click node_node_home_feature "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/home/feature-home"
click node_node_home_store "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/home/feature-home"
click node_node_settings_feature "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/settings/feature-settings"
click node_node_core_api "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/core/api-types"
click node_node_core_http "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/core/http-client"
click node_node_core_error "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/core/error-handler"
click node_node_core_forms "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/core/forms"
click node_node_core_state "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/core/data-access"
click node_node_ui_pager "https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/ui/components"

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_node_app_shell,node_node_e2e,node_node_core_api,node_node_core_http,node_node_core_error,node_node_core_forms,node_node_core_state toneBlue
class node_node_auth_feature,node_node_auth_data,node_node_ui_pager toneAmber
class node_node_articles_list,node_node_article_detail,node_node_article_edit,node_node_articles_data toneMint
class node_node_profile_feature,node_node_profile_data toneRose
class node_node_home_feature,node_node_home_store toneIndigo
class node_node_settings_feature toneTeal
```

## Components

### Apps

Runtime shells and end-to-end test app

- [Conduit app](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/apps/conduit): Angular shell · Root app composition, routing host, and global layout. · `apps/conduit`
- [E2E tests](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/apps/conduit-e2e): Playwright suite · End-to-end coverage for auth and article journeys. · `apps/conduit-e2e`

### Auth

Authentication feature and data access

- [Auth screens](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/auth/feature-auth): feature-auth · Login and registration routed screens. · `libs/auth/feature-auth`
- [Auth store](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/auth/data-access): auth data-access · Auth state, service, and route guard. · `libs/auth/data-access`

### Articles

Article, list, and editor flows

- [Article list](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/articles/feature-articles-list): feature-articles-list · Article feeds and list item presentation. · `libs/articles/feature-articles-list`
- [Article page](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/articles/feature-article): feature-article · Article detail, comments, metadata, and markdown rendering. · `libs/articles/feature-article`
- [Editor](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/articles/feature-article-edit): feature-article-edit · Create and edit article route flow. · `libs/articles/feature-article-edit`
- [Articles store](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/articles/data-access): articles data-access · Article and list state, services, and actions. · `libs/articles/data-access`

### Profile

Profile pages and profile-scoped article views

- [Profile page](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/profile/feature-profile): feature-profile · Profile screen and profile-bound article views. · `libs/profile/feature-profile`
- [Profile store](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/profile/data-access): profile data-access · Profile state, services, and route resolvers. · `libs/profile/data-access`

### Home

Home feed and tags

- [Home feed](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/home/feature-home): feature-home · Home feed screen, tabs, and tag sidebar. · `libs/home/feature-home`
- [Home store](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/home/feature-home): home state · Home feed orchestration and list fetching. · `libs/home/feature-home`

### Settings

User settings screen

- [Settings page](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/settings/feature-settings): feature-settings · User settings form and save flow. · `libs/settings/feature-settings`

### Core

Shared infrastructure and API contracts

- [API types](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/core/api-types): core contracts · Shared article, auth, comment, profile, and user contracts. · `libs/core/api-types`
- [HTTP client](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/core/http-client): core transport · API URL and token wiring plus base API service. · `libs/core/http-client`
- [Error handler](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/core/error-handler): core errors · Global HTTP interception and error state. · `libs/core/error-handler`
- [Forms helpers](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/core/forms): core forms · Validation, display, and error mapping helpers. · `libs/core/forms`
- [Call state](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/core/data-access): core state · Shared loading and call-state utilities. · `libs/core/data-access`

### UI

Reusable presentational components

- [Pager](https://github.com/abhijeetr7/angular-ngrx-nx-realworld-example-app/tree/main/libs/ui/components): ui component · Reusable pagination control. · `libs/ui/components`

## Connections

- Conduit app → Auth screens: routes to · Shell lazy-loads auth screens.
- Conduit app → Home feed: routes to · Shell lazy-loads the home feed.
- Conduit app → Article list: routes to · Shell lazy-loads article list views.
- Conduit app → Article page: routes to · Shell lazy-loads article detail pages.
- Conduit app → Editor: routes to · Shell lazy-loads editor flow.
- Conduit app → Profile page: routes to · Shell lazy-loads profile pages.
- Conduit app → Settings page: routes to · Shell lazy-loads settings page.
- Conduit app → Auth store: uses · Shell wiring depends on auth guard/state.
- Conduit app → Error handler: uses · App config installs global error handling.
- Conduit app → Pager: shares · Shell composes shared presentation pieces.
- Auth screens → Auth store: reads/writes · Login and register interact with auth state.
- Auth screens → Forms helpers: uses · Forms and validation helpers support auth screens.
- Auth store → HTTP client: calls · Auth service uses shared HTTP client.
- Auth store → API types: models · Auth state is typed with shared contracts.
- Article list → Articles store: reads · List views consume article list store.
- Article list → Pager: uses · Pagination is rendered through shared pager.
- Article page → Articles store: reads/writes · Detail page loads article and comments, then updates favorites/comments.
- Article page → Forms helpers: uses · Comment input and validation rely on shared form helpers.
- Article page → API types: models · Article, comment, and profile contracts shape the page.
- Editor → Articles store: writes · Editor uses article store and resolver-backed loading.
- Editor → Forms helpers: uses · Editor form validation uses shared helpers.
- Articles store → HTTP client: calls · Article services talk to the API through shared transport.
- Articles store → Call state: tracks · Stores use shared call-state utilities.
- Articles store → API types: models · Article state is built from shared contracts.
- Profile page → Profile store: reads · Profile page consumes profile store and resolvers.
- Profile page → Articles store: lists · Profile pages reuse article list data.
- Profile store → HTTP client: calls · Profile service uses shared HTTP client.
- Profile store → API types: models · Profile state uses shared contracts.
- Home feed → Home store: reads · Home UI is driven by home store state.
- Home feed → Articles store: lists · Feed data is fetched through article list state.
- Home feed → Pager: uses · Home feed pagination uses the shared pager.
- Home store → Articles store: coordinates · Home store builds on article list fetching behavior.
- Settings page → Auth store: uses · Settings screen relies on authenticated user state.
- Error handler → HTTP client: integrates · Error handling sits at the HTTP boundary.
- E2E tests → Conduit app: exercises · End-to-end flows run against the app shell.
- E2E tests → Auth screens: covers · Auth journeys are validated end to end.
- E2E tests → Article list: covers · Article list browsing is validated end to end.
- E2E tests → Editor: covers · Article creation flow is validated end to end.
