Architecture Visualization Tool
A powerful development tool for visualizing and debugging NgRx state management in Angular applications.
Features real-time effect lifecycle tracking and performance monitoring.
This tool provides real-time monitoring and visualization of NgRx actions, state changes, and effects. It tracks effect lifecycle events (started, emitted, completed, error) and correlates actions with the effects that emitted them.
- Real-time Action Monitoring - Track all dispatched actions as they happen
- Effect Lifecycle Tracking - Monitor effect execution with start, emit, complete, and error events
- Action-Effect Correlation - See which effect emitted each action
- State Visualization - View current and previous states
- Diff Viewer - Compare state changes between actions
- Visual Indicators - Blue for user actions, orange for effect results
- Performance Tracking - Monitor reducer execution time, render timing, and state size changes
- Effects Panel - Dedicated panel showing all effect executions with duration and status
- Selector Tracking (coming soon) - Track selector invocations, cache hit rates, and recomputation metrics (APIs already implemented:
trackSelector,createTrackedSelector,SelectorTrackerService)
- ngrx-devtool - Core library package
- ngrx-devtool-ui - Standalone visualization UI
- ngrx-devtool-demo - Example implementation
Since the package is not yet published to npm, use the development setup:
git clone <repository-url>
cd ngrx-devtool
npm install
npm run buildcd dist/ngrx-devtool
npm link
# In your Angular project directory
npm link ngrx-devtoolNote: If you encounter module resolution issues, see the npm Link Issues section in Troubleshooting.
Option A: Standalone (recommended)
// app.config.ts
import { provideNgrxDevTool, createDevToolMetaReducer } from 'ngrx-devtool';
export const appConfig: ApplicationConfig = {
providers: [
provideStore(
{ /* your reducers */ },
{ metaReducers: [createDevToolMetaReducer()] }
),
provideEffects([...]),
provideNgrxDevTool({
wsUrl: 'ws://localhost:4000',
trackEffects: true,
}),
]
};Option B: NgModule with separate store module (common in large enterprise apps)
// store.module.ts
import { createDevToolMetaReducer } from 'ngrx-devtool';
@NgModule({
imports: [
StoreModule.forRoot(
{ /* your reducers */ },
{ metaReducers: [createDevToolMetaReducer()] }
),
EffectsModule.forRoot([...])
]
})
export class RootStoreModule {}
// app.config.ts
import { provideNgrxDevTool } from 'ngrx-devtool';
export const appConfig: ApplicationConfig = {
providers: [
// Don't add provideStore() here - RootStoreModule already has it
provideNgrxDevTool({
wsUrl: 'ws://localhost:4000',
trackEffects: true,
}),
]
};Warning
The createDevToolMetaReducer() must be added to the same provideStore() or StoreModule.forRoot() that initializes your store. If you're only seeing effects in the DevTool (no actions), you likely have a separate store module see Option B above.
Note: If your app fails to compile or run after this step, see the npm Link Issues section in Troubleshooting to configure preserveSymlinks.
# From the ngrx-devtool-proto directory
node dist/index.jsOpen http://localhost:3000 and start your Angular app. All actions will appear:
- Blue border = User action
- Orange border = Effect result (shows which effect emitted the action)
If you get module resolution errors after npm link, you need to enable symlink preservation.
Note: This is required for Nx/Angular monorepo projects.
Step 1: Build and link the library first:
# In the ngrx-devtool directory
ng build ngrx-devtool
cd dist/ngrx-devtool
npm link
# Then in YOUR project directory
npm link ngrx-devtoolStep 2: Configure symlink preservation:
tsconfig.json:
{
"compilerOptions": {
"preserveSymlinks": true
}
}angular.json (in build options):
{
"architect": {
"build": {
"options": {
"preserveSymlinks": true
}
}
}
}Note: After running npm install, you may need to re-run npm link ngrx-devtool.
If you see TypeScript errors like:
error TS2428: All declarations of 'ArrayContaining' must have identical type parameters
This is caused by having both @types/jest and @types/jasmine installed. Remove the one you're not using:
# If using Jest (recommended)
npm uninstall @types/jasmine
# If using Jasmine
npm uninstall @types/jestYour meta reducer is likely being overridden. Make sure createDevToolMetaReducer() is added to the StoreModule.forRoot() or provideStore() that actually initializes your store (not a duplicate).
Ensure you have:
- Added
provideNgrxDevTool({ trackEffects: true })to your providers - Called
provideEffects([...])beforeprovideNgrxDevTool()
- Ensure the DevTool server is running (
node dist/index.js) before starting your Angular app - Check that ports 3000 and 4000 are not in use by other processes
If you get EADDRINUSE: address already in use, kill the existing process:
# Kill process on port 4000
lsof -ti :4000 | xargs kill -9
# Kill process on port 3000
lsof -ti :3000 | xargs kill -9See CONTRIBUTING.md for guidelines on how to contribute to this project.

