Giter VIP home page Giter VIP logo

naemansan-server's Introduction

Naemansan Spring Web Server

내가 만든 산책로는 Spring Web Server를 주축으로 서버가 가동합니다.
만약 Docker 실행을 원하실 경우 DockerFile을 사용해주세요.

  • Java Version : 17 이상
  • Server : Spring
  • MYSQL Schema : naemansan
  • requirement - 아래에 해당하는 파일을 resources 폴더에 넣어주세요
    1. application-server.yml : [] 부분을 채워주세요
    2. apple-dev-key.p8 : 애플 로그인용 .p8 File
    3. apple-dev-notification-key.p12 : 애플 푸시알림용 .p12 File
    4. firebase_service_key.json : 푸시알림용 firebase-service_key.json File

Server 사용 예제

0. Ubuntu Update, Upgrade / Install pip

sudo apt-get update
sudo apt-get upgrade
sudo apt install openjdk-17-jdk

1. git clone, change directory

git clone https://github.com/CSID-DGU/2023-1-OSSP2-WeAreBility-3.git
cd 2023-1-OSSP2-WeAreBility-3
cd backend

2. application-server.yml 작성(아래의 파일 참조) 및 requirement 충족

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://[DB IP]:3306/naemansan?useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false&allowPublicKeyRetrieval=true
    username: [username]
    password: [password]
    hikari:
      pool-name: jpa-hikari-pool
      maximum-pool-size: 5
      jdbc-url: ${spring.datasource.url}
      username: ${spring.datasource.username}
      password: ${spring.datasource.password}
      driver-class-name: ${spring.datasource.driver-class-name}
      idleTimeout: 300
      maxLifeTime: 300
      data-source-properties:
        rewriteBatchedStatements: true
  # JPA 설정
  jpa:
    generate-ddl: true
    hibernate:
      ddl-auto: update
    show-sql: false
    properties:
      hibernate:
        dialect: org.hibernate.dialect.MySQL8Dialect
        hbm2ddl.import_files_sql_extractor: org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor
        current_session_context_class: org.springframework.orm.hibernate5.SpringSessionContext
        default_batch_fetch_size: ${chunkSize:100}
        jdbc.batch_size: 20
        order_inserts: true
        order_updates: true
        format_sql: true
  servlet:
    multipart:
      max-file-size: 10MB
      max-request-size: 10MB
  image.path: [Server Image Directory Absolute Path]

client:
  registration:
    kakao:
      client-id: [kakao-client-id]
      client-secret: [kakao-client-secret]
      redirect-uri: [kakao-redirect-uri]
    google:
      client-id: [google-client-id]
      client-secret: [google-client-secret]
      redirect-uri: [google-redirect-uri]
    apple:
      auth-key-file: [auth-key-file-name]
      teamId: [apple-client-secret]
      clientId: [apple-clientId]
      clientKey: [apple-clientKey]
      redirect-uri: [apple-redirect-url]
  provider:
    kakao:
      authorization-uri: "https://kauth.kakao.com/oauth/authorize"
      token-uri: "https://kauth.kakao.com/oauth/token"
      user-info-uri: "https://kapi.kakao.com/v2/user/me"
    google:
      authorization-uri: "https://accounts.google.com/o/oauth2/v2/auth"
      token-uri: "https://oauth2.googleapis.com/token"
      user-info-uri: "https://www.googleapis.com/userinfo/v2/me"
    apple:
      base-url: "https://appleid.apple.com"
      authorization-uri: "https://appleid.apple.com/auth/authorize"
      token-uri: "https://appleid.apple.com/auth/token"
      jwk-uri: "https://appleid.apple.com/auth/keys"
  geocoding:
    api-key: [google-geocoding-api-key]
    api-url: "https://maps.googleapis.com/maps/api/geocode/json"
  ml:
    checker-url: "http://localhost:8000/checker/"
    finisher-url: "http://localhost:8000/finisher/"
    recommender-url: "http://localhost:8000/recommender/"
fmc:
  key:
    path: [fcm-json-file-name]
    scope: https://www.googleapis.com/auth/cloud-platform

jwt.secret: [jwt-secret-key]

2. Gradle Build - requirement가 충족되어야 함,

gradle build

3. Change directory, Run Server - Linux, Windows

cd build/libs/
java -jar naemansan-0.0.1-SNAPSHOT.jar

yml file 참고자료

naemansan-server's People

Contributors

hyungjoonson avatar shortood avatar

Forkers

shortood

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.