SlideShare a Scribd company logo
End to end todo list app with
NestJs - Angular - Redux &
Redux Saga
Babacar NIANG
Agenda
Create nest API
Create Angular App
What about Redux ?
Managing angular store
Who I am ?
Console.log(me);
{
fullName: ‘Babacar NIANG’,
nicknames: [‘Basse’, ‘eagledev’],
company: ‘Weego’,
twitter: ‘@Babacar_Basse’,
email: ‘babacar.basse@esp.sn’
}
NestJs
A new framework for building efficient, scalable Node.js
server-side applications.
It uses JavaScript, is built with and fully supports TypeScript.
Also allows developers to code in pure JavaScript
npm install -g @nestjs/cli
nest new dpjs-weego
nest generate module
NestJs
First determine the DTO (Data Transfer Object) schema request
A DTO is an object that defines how the data will be sent over the network.
Define endpoint:
@Post()
async createTodo(@Body() todo: TodoDTO)
Url with parameters
@Get(‘id’)
findOne(@Param('id') id: string)
How to allow request with a specific payload ?
NestJs
npm install --save @nestjs/mongoose mongoose
MongoDB with Nest ?
Import MongooseModule into app.module
MongooseModule.forRoot('mongodb://localhost/nest')
Create Schemas DB
Import Schema model into the module
MongooseModule.forFeature([{ name: 'Todo', schema: TodoSchema }])
Finally inject the Model in the service
constructor(@InjectModel('Todo') private readonly todoModel:
Model<ITodo>) {}
NestJs
https://docs.nestjs.com/techniques/hot-reload
For hot reload
Exception filters
throw new HttpException('todo not found', HttpStatus.NOT_FOUND);
Create
Angular
App
https://angular.io/docs
npm install -g @angular/cli
What
about
Redux ?
State management library for applications
Managing
angular
store
@ngrx
npm install --save @ngrx/core
npm install --save @ngrx/effects
npm install --save @ngrx/entity
npm install --save @ngrx/router-store
npm install --save @ngrx/store
npm install --save @ngrx/store-devtools
Managing
angular
store
Create store
store
actions
effects
reducers
selectors
state
Interface App State
export interface IAppState {
router?: RouterReducerState;
}
App Reducers
export const appReducers: ActionReducerMap<IAppState, any> = {
router: routerReducer,
};
Managing
angular
store
StoreRouterConnectingModule.forRoot({ stateKey: 'router' }),
!environment.production ? StoreDevtoolsModule.instrument() : [],
EffectsModule.forRoot(AllEffects),
Import Store Router, StoreDevTools and Effects modules into app.module
StoreModule.forRoot(appReducers)
Import Store with appReducers forRoot into app.module
Managing
angular
store
Create todo Actions
export class GetTodoList implements Action {
public readonly type = ETodoActions.GetTodoList;
constructor() {}
}
.
….
export type TodoListActions = GetTodoList | GetTodoListSuccess |
GetTodoListError;
Create todo State
export interface ITodoListState {
data: Array<ITodo>;
loaded: boolean;
loading: boolean;
error: any;
}
Managing
angular
store
Create todo reducer
export function todoReducer(state = initialTodoListState,
action: TodoActions): ITodoListState {
switch(action.type) {
…..
default: return state;
}
}
Add todo state to App State
export interface IAppState {
router?: RouterReducerState;
todolist: ITodoListState
}
Add todo reducer into App Reducers
export const appReducers: ActionReducerMap<IAppState, any> = {
router: routerReducer,
todolist: todoReducer
};
Managing
angular
store
Create todo selector
export const selectTodoList = (state: IAppState) => state.todolist;
Create todo effects
@Injectable()
export class TodoEffects {
@Effect()
getTodoList$ = this.action$.pipe(
ofType<GetTodoList>(ETodoActions.GetTodoList),
switchMap(() => this.todoService.getTodoList()),
switchMap(todos => of(new GetTodoListSuccess(todos))),
catchError(err => of(new GetTodoListError(err)))
);
constructor(private action$: Actions, private todoService: TodoService) {}
}
Managing
angular
store
Select todo List state from the store
$todoListState = this.store.pipe(select(selectTodoList));
https://ngrx.io/docs
For more documentation
https://github.com/babacarbasse/todolist-app
Repo Github
Kill -9

More Related Content

What's hot (20)

PDF
Use Node.js to create a REST API
Fabien Vauchelles
 
PPTX
Reactjs
Mallikarjuna G D
 
PDF
Arquitetura Node com NestJS
Vanessa Me Tonini
 
PPTX
React + Redux Introduction
Nikolaus Graf
 
PDF
Introduction to Redux
Ignacio Martín
 
PPT
Angular 8
Sunil OS
 
PDF
Angular Dependency Injection
Nir Kaufman
 
PPTX
Introduction to JSX
Micah Wood
 
PDF
Expressjs
Yauheni Nikanovich
 
PPTX
React render props
Saikat Samanta
 
PPTX
Clean architecture
.NET Crowd
 
PDF
Clean architecture with asp.net core
Sam Nasr, MCSA, MVP
 
PPTX
Node.js Event Emitter
Eyal Vardi
 
PPTX
Introduction to Node.js
Vikash Singh
 
PDF
Angular data binding
Sultan Ahmed
 
PDF
Clean Architecture
NSCoder Mexico
 
PPTX
[Final] ReactJS presentation
洪 鹏发
 
PDF
Introducing Clean Architecture
Roc Boronat
 
PPTX
Getting started with Next.js - IM Tech Meetup - Oct 2022.pptx
Ilesh Mistry
 
PPTX
Angular modules in depth
Christoffer Noring
 
Use Node.js to create a REST API
Fabien Vauchelles
 
Arquitetura Node com NestJS
Vanessa Me Tonini
 
React + Redux Introduction
Nikolaus Graf
 
Introduction to Redux
Ignacio Martín
 
Angular 8
Sunil OS
 
Angular Dependency Injection
Nir Kaufman
 
Introduction to JSX
Micah Wood
 
React render props
Saikat Samanta
 
Clean architecture
.NET Crowd
 
Clean architecture with asp.net core
Sam Nasr, MCSA, MVP
 
Node.js Event Emitter
Eyal Vardi
 
Introduction to Node.js
Vikash Singh
 
Angular data binding
Sultan Ahmed
 
Clean Architecture
NSCoder Mexico
 
[Final] ReactJS presentation
洪 鹏发
 
Introducing Clean Architecture
Roc Boronat
 
Getting started with Next.js - IM Tech Meetup - Oct 2022.pptx
Ilesh Mistry
 
Angular modules in depth
Christoffer Noring
 

Similar to End to end todo list app with NestJs - Angular - Redux & Redux Saga (20)

PDF
Ngrx slides
Christoffer Noring
 
PDF
Angular2 with TypeScript
Rohit Bishnoi
 
PPTX
React js programming concept
Tariqul islam
 
PPTX
Reactive Angular 2
Lazar Nikolov
 
PDF
Using redux and angular 2 with meteor
Ken Ono
 
PDF
Using redux and angular 2 with meteor
Ken Ono
 
PDF
Redux data flow with angular
Gil Fink
 
PDF
Redux data flow with angular
Gil Fink
 
PDF
Introduction to Redux (for Angular and React devs)
Fabio Biondi
 
PDF
Redux with angular 2 - workshop 2016
Nir Kaufman
 
PDF
Angular 7 Firebase5 CRUD Operations with Reactive Forms
Digamber Singh
 
PPTX
Redux in Angular2 for jsbe
Brecht Billiet
 
PPTX
Ngrx: Redux in angular
Saadnoor Salehin
 
PDF
Angular 2 overview in 60 minutes
Loiane Groner
 
PPTX
Best Practices NgRx for Scaling Your Angular Application
Vagner Oliveira
 
PDF
Angular2 workshop
Nir Kaufman
 
PDF
Predictable reactive state management for enterprise apps using NGRX/platform
Ilia Idakiev
 
PPTX
Damian Kmiecik - Road trip with Redux
PROIDEA
 
PDF
#FrontConf2017 — Enhance your User (and Developer) Experience with React & Redux
phacks
 
Ngrx slides
Christoffer Noring
 
Angular2 with TypeScript
Rohit Bishnoi
 
React js programming concept
Tariqul islam
 
Reactive Angular 2
Lazar Nikolov
 
Using redux and angular 2 with meteor
Ken Ono
 
Using redux and angular 2 with meteor
Ken Ono
 
Redux data flow with angular
Gil Fink
 
Redux data flow with angular
Gil Fink
 
Introduction to Redux (for Angular and React devs)
Fabio Biondi
 
Redux with angular 2 - workshop 2016
Nir Kaufman
 
Angular 7 Firebase5 CRUD Operations with Reactive Forms
Digamber Singh
 
Redux in Angular2 for jsbe
Brecht Billiet
 
Ngrx: Redux in angular
Saadnoor Salehin
 
Angular 2 overview in 60 minutes
Loiane Groner
 
Best Practices NgRx for Scaling Your Angular Application
Vagner Oliveira
 
Angular2 workshop
Nir Kaufman
 
Predictable reactive state management for enterprise apps using NGRX/platform
Ilia Idakiev
 
Damian Kmiecik - Road trip with Redux
PROIDEA
 
#FrontConf2017 — Enhance your User (and Developer) Experience with React & Redux
phacks
 
Ad

Recently uploaded (20)

PPTX
Distribution reservoir and service storage pptx
dhanashree78
 
PDF
Electrical Engineer operation Supervisor
ssaruntatapower143
 
PDF
Digital water marking system project report
Kamal Acharya
 
PPTX
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
PPTX
How Industrial Project Management Differs From Construction.pptx
jamespit799
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
PDF
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PDF
AN EMPIRICAL STUDY ON THE USAGE OF SOCIAL MEDIA IN GERMAN B2C-ONLINE STORES
ijait
 
PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
PPTX
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
PDF
20ES1152 Programming for Problem Solving Lab Manual VRSEC.pdf
Ashutosh Satapathy
 
PPTX
OCS353 DATA SCIENCE FUNDAMENTALS- Unit 1 Introduction to Data Science
A R SIVANESH M.E., (Ph.D)
 
PPT
New_school_Engineering_presentation_011707.ppt
VinayKumar304579
 
PPT
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
 
PDF
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
PPTX
澳洲电子毕业证澳大利亚圣母大学水印成绩单UNDA学生证网上可查学历
Taqyea
 
PDF
mbse_An_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
PPTX
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
Distribution reservoir and service storage pptx
dhanashree78
 
Electrical Engineer operation Supervisor
ssaruntatapower143
 
Digital water marking system project report
Kamal Acharya
 
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
How Industrial Project Management Differs From Construction.pptx
jamespit799
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
AN EMPIRICAL STUDY ON THE USAGE OF SOCIAL MEDIA IN GERMAN B2C-ONLINE STORES
ijait
 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
20ES1152 Programming for Problem Solving Lab Manual VRSEC.pdf
Ashutosh Satapathy
 
OCS353 DATA SCIENCE FUNDAMENTALS- Unit 1 Introduction to Data Science
A R SIVANESH M.E., (Ph.D)
 
New_school_Engineering_presentation_011707.ppt
VinayKumar304579
 
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
 
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
澳洲电子毕业证澳大利亚圣母大学水印成绩单UNDA学生证网上可查学历
Taqyea
 
mbse_An_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
Ad

End to end todo list app with NestJs - Angular - Redux & Redux Saga