Angular 11 + Spring JPA + PostgreSQL example | Angular 11 Http Client – Spring Boot RestApi Server
Tags: angular11, springboot, springjpa, restapi
Published: 2021-05-10 08:20:00

https://ozenero.com/angular-11-spring-jpa-postgresql-crud

Angular 11 + Spring JPA + PostgreSQL example | Angular 11 Http Client – Spring Boot RestApi Server


In this tutorial, <strong>ozenero</strong> shows you Angular 11 Http Client & Spring Boot Server example that uses <strong>Spring JPA</strong> to interact with <strong>PostgreSQL</strong> and <strong>Angular 11</strong> as a front-end technology to make request and receive response.

Related Posts:
- <a href="https://ozenero.com/spring-framework/spring-boot/use-spring-jpa-postgresql-spring-boot">How to use Spring JPA with PostgreSQL | Spring Boot</a>
- <a href="https://ozenero.com/spring-framework/spring-boot/spring-jpa-postgresql-angularjs-example-spring-boot">Spring JPA + PostgreSQL + AngularJS example | Spring Boot</a>
- <a href="https://ozenero.com/spring-framework/spring-boot/use-angular-http-client-fetch-data-springboot-restapi">How to use Angular Http Client to fetch Data from SpringBoot RestAPI – Angular 11</a>
- <a href="https://ozenero.com/spring-framework/spring-boot/use-angular-httpclient-post-put-delete-data-springboot-rest-apis-angular-4">How to use Angular HttpClient to POST, PUT, DELETE data on SpringBoot Rest APIs – Angular 11</a>

Updated:
- <a href="https://ozenero.com/spring-framework/spring-boot/spring-boot-angular-6-example-spring-data-rest-postgresql-example">Spring Boot + Angular 6 example | Spring Data JPA + REST + PostgreSQL CRUD example</a>

<!--more-->
<h2>I. Technologies</h2>
– Java 1.8
– Maven 3.3.9
– Spring Tool Suite – Version 3.8.4.RELEASE
– Spring Boot: RELEASE
– Angular 11
<h2>II. Overview</h2>
<img src="https://ozenero.com/wp-content/uploads/2017/05/angular-http-service-architecture-1.png" alt="angular-http-service-architecture" width="570" height="542" class="alignnone size-full wp-image-5475" />
<h3>1. Spring Boot Server</h3>

<img src="https://ozenero.com/wp-content/uploads/2017/08/angular-4-spring-jpa-postgresql-spring-boot-architecture.png" alt="angular-4-spring-jpa-postgresql-spring-boot-architecture" width="700" height="330" class="alignnone size-full wp-image-7626" />

For more details about Spring JPA - PostgreSQL, please visit:
<a href="https://ozenero.com/spring-framework/spring-boot/use-spring-jpa-postgresql-spring-boot">How to use Spring JPA with PostgreSQL | Spring Boot</a>

<h3>2. Angular 11 Client</h3>
<img src="https://ozenero.com/wp-content/uploads/2017/08/angular-4-spring-jpa-postgresql-angular-architecture.png" alt="angular-4-spring-jpa-postgresql-angular-architecture" width="698" height="342" class="alignnone size-full wp-image-7628" />

For more details:
- About Angular 11 Routing:
<a href="https://ozenero.com/spring-framework/spring-boot/work-angular-routing-spring-boot-angular-4">How to work with Angular Routing – Spring Boot + Angular 11</a>
- About Angular Http Client to GET/POST/DELETE:
+ <a href="https://ozenero.com/spring-framework/spring-boot/use-angular-http-client-fetch-data-springboot-restapi">How to use Angular Http Client to fetch Data from SpringBoot RestAPI – Angular 11</a>
+ <a href="https://ozenero.com/spring-framework/spring-boot/use-angular-httpclient-post-put-delete-data-springboot-rest-apis-angular-4">How to use Angular HttpClient to POST, PUT, DELETE data on SpringBoot Rest APIs – Angular 11</a>

<h2>III. Practice</h2>
<h3>1. Project Structure</h3>
<h4>1.1 Spring Boot Server</h4>
<img src="https://ozenero.com/wp-content/uploads/2017/08/angular-4-spring-jpa-postgresql-spring-boot-structure.png" alt="angular-4-spring-jpa-postgresql-spring-boot-structure" width="347" height="362" class="alignnone size-full wp-image-7630" />

- Class <strong>Customer</strong> corresponds to entity and table <strong>customer</strong>, it should be implemented <strong>Serializable</strong>.
- <strong>CustomerRepository</strong> is an interface extends <strong>CrudRepository</strong>, will be autowired in <strong>CustomerController</strong> for implementing repository methods and custom finder methods.
- <strong>CustomerController</strong> is a REST Controller which has request mapping methods for RESTful requests such as: <code>getAll</code>, <code>postCustomer</code>, <code>delete</code>, <code>findByLastName</code>.
- Configuration for Spring Datasource and Spring JPA properties in <strong>application.properties</strong>
- <strong>Dependencies</strong> for <strong>Spring Boot</strong> and <strong>PostgreSQL</strong> in <strong>pom.xml</strong>
<h4>1.2 Angular 11 Client</h4>
<img src="https://ozenero.com/wp-content/uploads/2017/08/angular-4-spring-jpa-postgresql-angular-structure.png" alt="angular-4-spring-jpa-postgresql-angular-structure" width="418" height="372" class="alignnone size-full wp-image-7631" />

https://ozenero.com/angular-11-spring-jpa-postgresql-crud

Angular 11 + Spring JPA + PostgreSQL example | Angular 11 Http Client – Spring Boot RestApi Server