https://github.com/sarakhild/springboot-thymeleaf-crud-db-deployment
This project manages an employee database with CRUD operations and is deployed on Alibaba Cloud using Terraform for scalable infrastructure management
https://github.com/sarakhild/springboot-thymeleaf-crud-db-deployment
alibabacloud dockerfile dokcer-compose mysql spring-boot spring-jpa terraform thymeleaf
Last synced: 3 months ago
JSON representation
This project manages an employee database with CRUD operations and is deployed on Alibaba Cloud using Terraform for scalable infrastructure management
- Host: GitHub
- URL: https://github.com/sarakhild/springboot-thymeleaf-crud-db-deployment
- Owner: SaraKhild
- Created: 2024-11-04T11:22:18.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-18T17:59:42.000Z (8 months ago)
- Last Synced: 2025-02-08T16:12:52.459Z (5 months ago)
- Topics: alibabacloud, dockerfile, dokcer-compose, mysql, spring-boot, spring-jpa, terraform, thymeleaf
- Language: HCL
- Homepage:
- Size: 40.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spring Boot & Thymeleaf: CRUD Operations with Database Integration and Deployment on Alibaba Cloud
## Overview
This project focuses on managing an employee database through a user-friendly interface. It includes functionalities to:
* Display a list of employees.
* Add new employees to the database.
* Update existing employee information.
* Delete employees from the database.
The project also incorporates cloud deployment using Alibaba Cloud. Infrastructure is provisioned and managed using Terraform, enabling scalable and efficient deployment of the application.
## Usages
- SpringBoot
- SpringJPA
- Thymeleaf
- MySQL
- Terraform
- Dockerfile
- Docekr Compose
## Architecture of the Project### 1- deployment folders
- provider.tf
- vpc.tf
- key.tf
- bastion-sg.t
- bastion.tf
- employee-sg.tf
- employee.tf
- employee.tpl
- mysql-sg.tf
- mysql.tf
- mysql.tpl
- load-balancer.tf
### 2- src folders
#### 2.1 main
- Controllers folder
- Entities folder
- DAO folder
- Services folder
#### 2.2 resources
##### 2.2.1 templates
- employee-form.html
- list-employees.html### 2-Maven pom.xml
```
org.springframework.boot
spring-boot-starter-thymeleaf
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-devtools
runtime
true
mysql
mysql-connector-java
runtime
org.springframework.boot
spring-boot-starter-test
test
org.springframework.boot
spring-boot-starter-data-jpa
org.hibernate
hibernate-core
${hibernate.version}
```
### 3-Application.properties.yml
```
spring.datasource.url=jdbc:mysql://mydb:3306/demo
spring.datasource.username=demouser
spring.datasource.password=demopassspring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto=update```
### 4- Dockerfile
```
FROM openjdk:17
WORKDIR /
ADD target/spring-boot-thymeleaf-crud-db-project-0.0.1-SNAPSHOT.jar /
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/spring-boot-thymeleaf-crud-db-project-0.0.1-SNAPSHOT.jar"]```
### 5- Docker-compose.yml
```
version: "3"
services:
server:
container_name: app-container
image: app-image
build: .
restart: always
ports:
- 9091:8080
depends_on:
- mydbmydb:
container_name: mydb
platform: linux/arm64/v8
image: mysql:latest
restart: always
ports:
- 3313:3306
environment:
MYSQL_DATABASE: demo
MYSQL_USER: demouser
MYSQL_PASSWORD: demopass
MYSQL_ROOT_PASSWORD: demopass
```## Let's Start :mechanical_arm:
### • Display Empoyees Table
### • Add new Employee
![]()
### • Update Empoyee:
![]()
### • Delete Employee:
![]()
---
### Good Luck
![]()