Backend server of "All Ears" is a Spring Boot
application and requires JDK 17
& Spring Boot 3.X
. Make sure to have the correct dependencies for the project.
- java version: "17.0.6" 2023-01-17 LTS
- Spring boot version: 3.2.2
- Project: Gradle-Groovy
- IntelliJ IDEA or eclipse
- MySQL Workbrench
Clone this repository to your local computer using:
git clone https://github.com/TeamAllways-AllEars/All-Ears_Server.git
Backend server of "All Ears" uses GCP VM E2 instance for hosting and GCP Cloud SQL MySQL 8.0 Engine for DB. Make Cloud SQL instance with MySQL 8.0 Engine and add your local computer IP to Authorized networks.
- Cloud SQL engine: MySQL 8.0
- Authorized networks: your local computer IP or
0.0.0.0/0
(for testing) - How to connect: An external, internet-accessible (Public) IP address.
Also, to run your own backend server, make a GCP VM instance and attach a static external IP to the VM instance. The information for the static external IP should be provided to the Android client (refer to All-Ears_Android repository). You should also create a new firewall rule allowing IPv4 0.0.0.0/0, TCP 8080
and IPv6 ::/0, TCP 8080
for inbound traffic, and apply it to the VM instance of the SpringBoot backend server.
- Machine series: E2(choose higher spec for high traffic volume)
- Firewall rule: allow
IPv4 0.0.0.0/0, TCP 8080
andIPv6 ::/0, TCP 8080
- Make static external IP
To run this code with your GCP resource, please copy the code below and make allEars\src\main\resources\application.yml
file (❗Do not change the directory or file name❗) inside of your project. After that, fill the parentheses with info of your GCP Cloud SQL
.
spring:
# GCP Cloud SQL
datasource:
url: jdbc:mysql://<your_db_instance_ip>:3306/<your_db_name>?useSSL=false&characterEncoding=UTF-8&serverTimezone=UTC
username: <your_db_instance_username> # default is root
password: <your_db_instance_password>
driver-class-name: com.mysql.cj.jdbc.Driver
# hibernate
jpa:
show-sql: true
hibernate:
ddl-auto: update
- Change the value of the
ddl-auto
variable insideapplication.yml
toupdate
orcreate
for on first execution, andnone
for the second. - Run
AllEarsApplication
![allears-architecture-backend](https://private-user-images.githubusercontent.com/89632139/306906448-fb35f694-3ce7-4841-9eb2-f032fc15a136.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwMzc0ODQsIm5iZiI6MTcyNDAzNzE4NCwicGF0aCI6Ii84OTYzMjEzOS8zMDY5MDY0NDgtZmIzNWY2OTQtM2NlNy00ODQxLTllYjItZjAzMmZjMTVhMTM2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDAzMTMwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdjN2Q3MzEzMzIzMjY1MTVmNDM5ODNlNTI0ZmY5Y2U3NDJlZDQwNGJlOGFiMjgxNTc4ZjcwMWE0ZTMwZDE5NGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.3dxbl1p-Abo9P2HIA1M4SMGWzNrXq3lm58OF4lNl0mI)