# kazepis/ngx-toaster-next architecture

> Architecture diagram of the GitHub repository kazepis/ngx-toaster-next, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kazepis/ngx-toaster-next
- Repository: https://github.com/kazepis/ngx-toaster-next

## Overview

ngx-toaster-next is an Angular toast-notification library. The main workflow is an application invoking a severity method on ToastService; the service applies configuration and duplicate/SSR checks, records the toast, and creates a host that renders accessible, dismissible toast views. Configuration providers and the sample app are included as distinct supporting capabilities. The sampled source shows these runtime relationships; other README capabilities are represented where their implementation path is clear from the tree.

Main entry points: [`projects/ngx-toaster-next/src/lib/toast.service.ts`](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toast.service.ts) (Toast service), [`projects/ngx-toaster-next/src/public-api.ts`](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/public-api.ts) (Library exports), [`projects/ngx-toaster-next/src/lib/toast-config.ts`](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toast-config.ts) (Config model), [`projects/ngx-toaster-next/src/lib/toast-host.component.ts`](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toast-host.component.ts) (Overlay host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_public["Library exports<br/>[public-api.ts]"]
end

subgraph group_runtime["Toast Runtime"]
  node_service["Toast service<br/>[toast.service.ts]"]
  node_store["Toast store<br/>[toast-store.ts]"]
  node_host["Overlay host"]
  node_view["Toast view<br/>[toast.component.ts]"]
  node_styles["Toast styles<br/>[toaster.css]"]
end

subgraph group_config["Configuration"]
  node_config_model["Config model<br/>[toast-config.ts]"]
  node_provider["Config provider"]
end

subgraph group_sample["Demo Application"]
  node_sample_entry["Sample bootstrap<br/>[main.ts]"]
  node_sample_config["Sample defaults<br/>[app.config.ts]"]
  node_sample_ui["Toast demo<br/>[app.ts]"]
end

node_application(("Angular app"))

node_application -->|"imports API"| node_public
node_application -->|"invokes"| node_service
node_public -->|"exports"| node_service
node_public -->|"exports"| node_provider
node_public -->|"exports"| node_config_model
node_service -->|"resolves settings"| node_config_model
node_service -->|"checks and adds"| node_store
node_service -->|"creates host"| node_host
node_host -->|"reads toasts"| node_store
node_host -->|"renders"| node_view
node_view -->|"dismisses toast"| node_store
node_provider -->|"merges defaults"| node_config_model
node_sample_entry -->|"bootstraps with"| node_sample_config
node_sample_entry -->|"bootstraps"| node_sample_ui
node_sample_config -->|"registers defaults"| node_provider
node_sample_ui -->|"calls severity API"| node_service
node_sample_ui -->|"reads live config"| node_config_model
node_application -->|"includes stylesheet"| node_styles

click node_public "https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/public-api.ts"
click node_service "https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toast.service.ts"
click node_store "https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toast-store.ts"
click node_host "https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toast-host.component.ts"
click node_view "https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toast.component.ts"
click node_styles "https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toaster.css"
click node_config_model "https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toast-config.ts"
click node_provider "https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toasts.providers.ts"
click node_sample_entry "https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next-sample-app/src/main.ts"
click node_sample_config "https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next-sample-app/src/app/app.config.ts"
click node_sample_ui "https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next-sample-app/src/app/app.ts"

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_public toneBlue
class node_service,node_store,node_host,node_view,node_styles toneAmber
class node_config_model,node_provider toneMint
class node_sample_entry,node_sample_config,node_sample_ui toneRose
class node_application toneIndigo
```

## Components

### Public API

- [Library exports](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/public-api.ts): `projects/ngx-toaster-next/src/public-api.ts`

### Toast Runtime

- [Toast service](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toast.service.ts): `projects/ngx-toaster-next/src/lib/toast.service.ts`
- [Toast store](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toast-store.ts): `projects/ngx-toaster-next/src/lib/toast-store.ts`
- [Overlay host](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toast-host.component.ts): `projects/ngx-toaster-next/src/lib/toast-host.component.ts`
- [Toast view](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toast.component.ts): `projects/ngx-toaster-next/src/lib/toast.component.ts`
- [Toast styles](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toaster.css): `projects/ngx-toaster-next/src/lib/toaster.css`

### Configuration

- [Config model](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toast-config.ts): `projects/ngx-toaster-next/src/lib/toast-config.ts`
- [Config provider](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next/src/lib/toasts.providers.ts): `projects/ngx-toaster-next/src/lib/toasts.providers.ts`

### Demo Application

- [Sample bootstrap](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next-sample-app/src/main.ts): `projects/ngx-toaster-next-sample-app/src/main.ts`
- [Sample defaults](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next-sample-app/src/app/app.config.ts): `projects/ngx-toaster-next-sample-app/src/app/app.config.ts`
- [Toast demo](https://github.com/kazepis/ngx-toaster-next/blob/main/projects/ngx-toaster-next-sample-app/src/app/app.ts): `projects/ngx-toaster-next-sample-app/src/app/app.ts`

### Other components

- **Angular app**

## Connections

- Angular app → Library exports: imports API (evidence: `README.md`)
- Angular app → Toast service: invokes (evidence: `README.md`)
- Library exports → Toast service: exports (evidence: `projects/ngx-toaster-next/src/public-api.ts`)
- Library exports → Config provider: exports (evidence: `projects/ngx-toaster-next/src/public-api.ts`)
- Library exports → Config model: exports (evidence: `projects/ngx-toaster-next/src/public-api.ts`)
- Toast service → Config model: resolves settings (evidence: `projects/ngx-toaster-next/src/lib/toast.service.ts`)
- Toast service → Toast store: checks and adds (evidence: `projects/ngx-toaster-next/src/lib/toast.service.ts`)
- Toast service → Overlay host: creates host (evidence: `projects/ngx-toaster-next/src/lib/toast.service.ts`)
- Overlay host → Toast store: reads toasts (evidence: `projects/ngx-toaster-next/src/lib/toast-host.component.ts`)
- Overlay host → Toast view: renders (evidence: `projects/ngx-toaster-next/src/lib/toast-host.component.ts`)
- Toast view → Toast store: dismisses toast (evidence: `projects/ngx-toaster-next/src/lib/toast-host.component.ts`)
- Config provider → Config model: merges defaults (evidence: `projects/ngx-toaster-next/src/lib/toasts.providers.ts`)
- Sample bootstrap → Sample defaults: bootstraps with (evidence: `projects/ngx-toaster-next-sample-app/src/main.ts`)
- Sample bootstrap → Toast demo: bootstraps (evidence: `projects/ngx-toaster-next-sample-app/src/main.ts`)
- Sample defaults → Config provider: registers defaults (evidence: `projects/ngx-toaster-next-sample-app/src/app/app.config.ts`)
- Toast demo → Toast service: calls severity API (evidence: `projects/ngx-toaster-next-sample-app/src/app/app.ts`)
- Toast demo → Config model: reads live config (evidence: `projects/ngx-toaster-next-sample-app/src/app/app.ts`)
- Angular app → Toast styles: includes stylesheet (evidence: `README.md`)
