✨ This workspace has been generated by Nx, a Smart, fast and extensible build system. ✨
- Create the web app
nx generate @nrwl/angular:application web --style=scss --addTailwind --prefix=nx-store --routing --setParserOptionsProject --tags='platform:web, type:app'
- Install ngrx
npm install @ngrx/store --save
Run the ng add schematic
nx g @ngrx/store:ng-add --project=web
Install @ngrx/effects
npm install @ngrx/effects --save
Run the ng add schematic
nx g @ngrx/effects:ng-add --project=web
- Add Api
npm install -D @nrwl/nest
nx generate @nrwl/nest:application api --frontendProject=web --setParserOptionsProject --tags='platform:node, type:app'
- Add Feature lib Articles (web)
nx generate @nrwl/angular:library list --style=scss --directory=web/articles/feature --addTailwind --buildable --changeDetection=OnPush --compilationMode=full --lazy --prefix=nx-store --routing --setParserOptionsProject --tags='platform:web,type:feature, scope:articles'
- Add Feature lib Articles (node)
nx generate @nrwl/nest:library articles --directory=api --buildable --controller --service --setParserOptionsProject --strict --tags='platform:node, type:feature, scope:articles'
- Add Models lib
nx generate @nrwl/workspace:library models --directory=shared --buildable --setParserOptionsProject --skipBabelrc --no-strict --tags='type:util, scope:shared'
- Add the DataAccess lib for the Articles Scope
nx generate @nrwl/angular:library data-access --style=none --directory=web/articles --buildable --changeDetection=OnPush --prefix=nx-store --tags='platform:web, type:data-access, scope:articles'
- Add the Articles Service to call the API
nx generate @schematics/angular:service articles --project=web-articles-data-access --path=libs/web/articles/data-access/src/lib/services
export interface Article {
id: number;
title: string;
description: string;
tags: string;
author: Author;
createdAt?: Date;
updatedAt: Date;
}
export interface Author {
id?: number;
bio: string;
email: string;
image: string;
username: string;
following: boolean;
}
CRUD