aboudard / springboot-ngrx-data

SpringBoot with NgRx Data in Angular

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

springboot-ngrx-data

Spring Boot with NgRx Data in Angular 11 This project demonstrates the use of Spring Boot with Angular 10 and NgRx Data lib on top of NgRx. Find the lib here : https://ngrx.io/guide/data

Source code of this article : https://coco-boudard.medium.com/spring-boot-data-and-angular-ngrx-data-cbed33fc6015

Install

Clone this repository

git clone https://github.com/aboudard/springboot-ngrx-data
cd springboot-ngrx-data

The demo app is based on the Angular CLI. You may want to install the CLI globally if you have not already done so.

npm install -g @angular/cli

Install the npm packages

cd src/angular
npm install

Application properties

If you want to upload the files with te dedicated screen, you need to modifiy the properties

storage.location=D:/tests/springboot/todo/storage

Runnning

Just run the build (in watch mode if you plan to work on sources)

ng build --dev --watch

Now run the Spring Boot server

mvn spring-boot:run
or
mvn spring-boot:start

Open your localhost http://localhost:8080

Alternative with json-server

If you want to use the json server mock database just follow these instructions :

  • Install json-server
npm install -g json-server
  • Kill the Spring server we will use the Angular Cli
  • Run the commands :
cd src/angular
npm run start
npm run dbmock

Open your localhost http://localhost:4200

  • Be sure the root path is correct in the /store/app-store.module.ts file :
// TODO : change this config when using json-server or Spring Boot Data
const defaultDataServiceConfig: DefaultDataServiceConfig = {
  root: 'api'
};

Follow the original instructions about NgRx Data

Check the original instructions about monitoring with Redux Devtools and other details

About

SpringBoot with NgRx Data in Angular


Languages

Language:TypeScript 60.8%Language:Java 22.0%Language:HTML 13.5%Language:SCSS 2.2%Language:JavaScript 1.4%Language:CSS 0.1%