Spring Boot + Vue.js example | Spring Data JPA + REST + PostgreSQL CRUD
Tags: springboot, vue, postgres
Published: 2021-04-03 10:09:34

Spring Boot + Vue.js example | Spring Data JPA + REST + PostgreSQL CRUD

https://grokonez.com/spring-framework/spring-data/spring-boot-vue-example-spring-data-jpa-rest-postgresql-crud-example


Spring Boot + Vue.js example | Spring Data JPA + REST + PostgreSQL CRUD

In this tutorial, we show you Vue.js Http Client & Spring Boot Server example that uses Spring JPA to do CRUD with PostgreSQL and Vue.js as a front-end technology to make request and receive response.

Related Posts:
- <a href="https://grokonez.com/spring-framework/spring-boot/use-spring-jpa-postgresql-spring-boot">How to use Spring JPA with PostgreSQL | Spring Boot</a>
- <a href="https://grokonez.com/frontend/vue-js/vue-router-example-with-nav-bar-dynamic-route-nested-routes">Vue Router example – with Nav Bar, Dynamic Route & Nested Routes</a>

<!--more-->
<h2>Technologies</h2>
– Java 1.8
– Maven 3.3.9
– Spring Tool Suite – Version 3.8.4.RELEASE
– Spring Boot: 2.0.5.RELEASE

- Vue 2.5.17
- Vue Router 3
- Axios 0.18.0
<h2>Overview</h2>
This is full-stack Architecture:

<img src="https://grokonez.com/wp-content/uploads/2018/09/spring-boot-vue-example-spring-data-jpa-rest-api-postgresql-architecture.png" alt="spring-boot-vue-example-spring-data-jpa-rest-api-postgresql-architecture" width="750" height="258" class="alignnone size-full wp-image-14790" />
<h3>Demo</h3>
<iframe width="853" height="480" src="https://www.youtube.com/embed/2U83YPFu5Ao?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
<h3>1. Spring Boot Server</h3>
<img src="https://grokonez.com/wp-content/uploads/2018/09/spring-boot-vue-example-spring-data-jpa-rest-api-postgresql-architecture-server.png" alt="spring-boot-vue-example-spring-data-jpa-rest-api-postgresql-architecture-server" width="700" height="316" class="alignnone size-full wp-image-14809" />
<h3>2. Vue.js Client</h3>
<img src="https://grokonez.com/wp-content/uploads/2018/09/spring-boot-vue-example-spring-data-jpa-rest-api-postgresql-client.png" alt="spring-boot-vue-example-spring-data-jpa-rest-api-postgresql-client" width="700" height="334" class="alignnone size-full wp-image-14808" />
<h2>Practice</h2>
<h3>1. Spring Boot Server</h3>
<img src="https://grokonez.com/wp-content/uploads/2018/09/spring-boot-vue-example-spring-data-jpa-rest-api-postgresql-project-structure-server.png" alt="spring-boot-vue-example-spring-data-jpa-rest-api-postgresql-project-structure-server" width="331" height="364" class="alignnone size-full wp-image-14768" />

- <strong>Customer</strong> class corresponds to entity and table <strong>customer</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>getAllCustomers</code>, <code>postCustomer</code>, <code>deleteCustomer</code>, 


https://grokonez.com/spring-framework/spring-data/spring-boot-vue-example-spring-data-jpa-rest-postgresql-crud-example