This post walks you through the steps of creating an Email Verification web application Example with Spring Boot, MySQL running inside Docker containers

What you'll build

  • Email Verification Form

  • Send verification email through Amazon SES

  • Verify email service

What you'll need

Stack

  • Docker
  • Spring Boot
  • Java Mail API
  • Spring Data JPA
  • MySQL
  • NGINX
  • Maven

Project structure

├── app
│   ├── src
│   │   └── main
│   │       ├── java
│   │       │   └── com
│   │       │       └── hellokoding
│   │       │           └── account
│   │       │               ├── model
│   │       │               │   ├── MailProperties.java
│   │       │               │   ├── User.java
│   │       │               │   ├── VerificationForm.java
│   │       │               │   └── VerificationToken.java
│   │       │               ├── repository
│   │       │               │   ├── UserRepository.java
│   │       │               │   └── VerificationTokenRepository.java
│   │       │               ├── service
│   │       │               │   ├── SendingMailService.java
│   │       │               │   └── VerificationTokenService.java
│   │       │               ├── web
│   │       │               │   └── AccountController.java
│   │       │               └── WebApplication.java
│   │       └── resources
│   │           ├── static
│   │           │   ├── css
│   │           │   │   └── main.css
│   │           │   └── js
│   │           │       └── main.js
│   │           ├── templates
│   │           │   ├── email-verification.ftl
│   │           │   └── verification-form.ftl
│   │           └── application.properties
│   ├── Dockerfile
│   └── pom.xml
├── nginx
│   └── conf.d
│       └── app.conf
└── docker-compose.yaml

Spring Boot Web application

Application dependencies


JPA Entities



JPA Repositories



Services



Controllers


FreeMarker View template



Application Configuration



Dockerize

Dockerfile of Spring Boot web application


NGINX config file


Docker Compose


Test

  • Run command docker-compose up
  • Access to http://localhost

Source code

[email protected]:hellokoding/email-verification-springboot-mysql-nginx-dockercompose.git

https://github.com/hellokoding/email-verification-springboot-mysql-nginx-dockercompose