This post will walk you through the steps of building a full stack TodoMVC web app and REST API service with Spring Boot, JPA/Hibernate, MySQL, FreeMarker, VueJS and Docker.
What you'll build
What you'll need
- Docker CE 18+
Project structure
Project dependencies
Define JPA Entity, Repository and Service
Define REST API and Controller
Application Properties
FreeMarker/HTML View Template
Static Files
Run the application
Prepare Dockerfile for Java/Spring Boot application
Start your application and infrastructure via Docker Compose. Make sure your local Docker is running and your bash console is at the springboot-examples project root directory. JPA/Hibernate will construct MySQL database and table schema.
docker-compose -f docker-compose-fullstack.yaml up --renew-anon-volumes todomvc-mysql-vuejs
Access to localhost:8080
to enjoy the web app.
And that's it! Thanks for joining and have a happy coding. You can find the full source code as below
Source code
https://github.com/hellokoding/springboot-examples/tree/master/full-stack/todomvc-mysql-vuejs