Skip to content

MotuS backed repository. This server communicates with clients and models.

License

Notifications You must be signed in to change notification settings

MotuS-Web/MotuS-Backend

Repository files navigation

Motus-Backend

motus_logo

Descriptions

Backend uses JAVA to build an API server that communicates with the client as a Spring-Boot framework.

The main purpose of the API server is to store and manage the output received by the client through the AI-Server and the uploaded Guide Data (mp4 & Json) in the DB server to receive the program that the user wants.

This model will be able to function in all areas that collect and utilize human motor movements

A Table of Contents

1. Installation

1.1. Git Clone

$ git clone https://github.com/MotuS-Web/MotuS-Backend.git

1.2. Configuration

It needs to be modified to meet server specifications.

application.yml

spring:
  datasource:
    driver-class-name: org.mariadb.jdbc.Driver
    url: jdbc:mariadb://{host}:{port}/{dbname}
    username: {username}
    password: {password}

  jpa:
    properties:
      hibernate:
        format_sql: true
        show_sql: true
    defer-datasource-initialization : true
  mvc:
    pathmatch:
      matching-strategy: ant_path_matcher

  logging:
    config: classpath:log4j2.yml
  level:
    org.hibernate.SQL: debug

  servlet:
    multipart:
      max-file-size: 30MB
      max-request-size: 40MB

cloud:
  aws:
    credentials:
      access-key: {AWS_ACCESS_KEY_ID}
      secret-key: {AWS_SECRET_ACCESS_KEY}
    region:
      static: {your-region}
    s3:
      endpoint: https://kr.object.ncloudstorage.com
      bucket: {your-bucket}

1.3. Dockerfile

FROM openjdk:11-jdk

# Create the app directory
WORKDIR /app

# Create a user account for running the app
RUN addgroup --system dockeruser && adduser --system --ingroup dockeruser dockeruser

# Change ownership of the /app folder to the new user account
RUN chown -R dockeruser:dockeruser /app

# Switch to the user account
USER dockeruser

# Specify the port to expose (default is 8080)
ARG APP_PORT=8080
EXPOSE ${APP_PORT}

# Copy and set up the app JAR file (default is app.jar)
ARG JAR_FILE=app.jar
COPY ${JAR_FILE} app.jar

ENTRYPOINT ["java","-jar","/app/app.jar"]

1.4. Build & Execute

1.4.1. Condition

  • Database Connection

    • Check the database connection you use
  • Object Storage Connection

    • Check the object storage connection of the Naver Cloud Platform(NCP).
    • Please refer to the 4.1. NCP Object Storage

1.4.2. Local Environment

$ ./gradlew clean build -x test
$ cd build/libs
$ java -jar *.jar

1.4.3. Docker environment

$ ./gradlew clean build -x test
$ docker build -t tag-name:1.0 .
$ docker run -p 8080:8081 -d --name=app-name tag-name:1.0

2. Usage

2.1. Environment

  • InteliJ
  • Postman
  • Git Action
  • Git
  • Gradle
  • Raspberry PI 4B

2.2. Development

  • Spring-Boot
  • Java
  • Object Storage(Naver Cloud Platform)
  • MariaDB

2.3. Dependencies

  • QueryDsl
  • Spring-Data-JPA
  • Spring Security
  • JWT(Json Web Token)
  • WebSocket
  • Lombok

3. System Architecture

3.1. Consumer Function Architecture

image02

3.2. Admin Function Architecture

image03

4. Documentation

4.1. NCP Object Storage

4.2. How to Contribute

5. Open source licensing info

About

MotuS backed repository. This server communicates with clients and models.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published