Skip to content

GSC-2024-Hongik-Team-6/safety-server

Repository files navigation

safety-server

GDSC Solution Challenge Server Repository


🔧 Technology stack



⛓️ Architecture

safey drawio


🧩 ERD

Google Solution Challenge ERD


🖹 DB setting

Local MySQL ~ Google Cloud MySQL integration

Set Local MySQL
Set application.yml file in Springboot
Network authorization in security through Google Cloud MySQL

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url : ${DB_URL}
    username: ${DB_USERNAME}
    password: ${DB_PASSWORD}
  jpa:
    properties:
      hibernate:
        show_sql: true
        format_sql: true
        use_sql_comments: true
        hbm2ddl:
          auto: update
        default_batch_fetch_size: 1000
  security:
    oauth2:
      resourceserver:
        jwt:
          jwk-set-uri: https://www.googleapis.com/service_accounts/v1/jwk/securetoken%40system.gserviceaccount.com
          issuer-uri: https://securetoken.google.com/${FIREBASE_APP_NAME}

logging.level:
  org.hibernate.SQL: debug
  • ${DB_URL} should be Public IP address of Google Cloud MySQL
  • ${DB_USERNAME} should be Local MySQL's userName
  • ${DB_PASSWORD} should be Local MySQL's passWord

🛳 Server Deployment Process

CI using GithubActions

Local : DockerImage Making

  1. jar build : gradle build

  2. image creation : docker build -t userAccountName/repositoryName ./

  3. push to Docker hub : using Docker Desktop

  • userAccountName/repositoryName is from Docker hub repository

Server : Deploy through Google Cloud VM instance

  1. docker login : docker login
  2. pull from Docker hub : docker pull userAccountName/repositoryName
  3. query DockerImage : docker images
  4. rename DockerImage : docker tag userAccountName/repositoryName DockerImageRenaming
  5. make docker-compose.yml : put DockerImageRenaming text in docker-compose.yml
  6. run Docker Compose : docker-compose up

About

GDSC Solution Challenge Server Repository

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •