How anishbhandarkar/angular-ngrx-crud works
What this project is (type + purpose)
This is a client-only Angular SPA demonstrating CRUD for “courses” using NgRx Store. Per README: no backend, no NgRx Effects, no HTTP layer. All data lives in the in-memory client state managed by NgRx.
• Angular component tree + routing
• NgRx data flow loop: Component → dispatch(Action) → Reducer → Store(state) → Selector → Component
• Optional UI library (Angular Material) only as a “UI dependency,” not a system component
File tree to architectural building blocks
From the tree, the core architecture is:
Runtime entry + composition
• src/main.ts — bootstraps Angular
• src/index.html — SPA host page
• src/app/app.module.ts — root module; place where Store is typically configured
• src/app/app-routing.module.ts — routes (navigation boundaries)
• src/app/app.component.* — shell/root layout component
Feature UI components (courses domain)
• src/app/course/ — likely list / container component for courses
• src/app/course-card/ — presentational component for a single course
• src/app/course-edit/ — create/edit form component
NgRx Store (the “backend replacement” inside the client)
• src/app/store/app.reducer.ts — root reducer composition
• src/app/store/index.ts — re-exports / wiring
• src/app/store/courses/
• course.model.ts — course entity type
• course.action.ts — CRUD actions (Add/Update/Delete/etc.)
• course.reducer.ts — how actions mutate state
• course.selector.ts — read-model selectors for components
• angular.json, package.json — Angular CLI build + dependencies
User → Angular Components
• User clicks Add/Update/Delete, types in form fields, navigates routes.
Components → Store via Actions
• CourseComponent / CourseEditComponent dispatch actions from course.action.ts
Store → Reducers → New State
• The Store routes the action to course.reducer.ts (and via app.reducer.ts if composed)
Components ← Store via Selectors (observable streams)
• Components select data using course.selector.ts
Presentational vs container component flow
• CourseComponent passes course data down to CourseCardComponent via @Input()
• CourseCardComponent emits UI events up via @Output() (edit/delete)
Routing navigation
• Router sends user between list and edit views
Architectural patterns to highlight (specific to this codebase)
• Unidirectional data flow (NgRx)
• State as a single source of truth (client-only)
• Feature slice (courses) with:
• actions (commands)
• reducers (state transitions)
• selectors (queries)
• Smart/container vs dumb/presentational split
• CourseComponent (smart) vs CourseCardComponent (presentational) is a common learning goal
Checklist to ensure you captured “all essential architectural elements”
• app.module.ts as the composition point (wires Store + root components)
• routing boundary (app-routing.module.ts)
• all three course UI components (course/course-card/course-edit)
• the full NgRx path (actions + reducer + selectors + state + model)
• explicit “no effects / no backend” callout (otherwise reviewers will assume it’s incomplete)