Skip to content

dattranitnlu/onltest-backend-api

Repository files navigation

BACKEND: TEST MAKER APPLICATION


APIs Documentation

Code Conventions By Oracle

Installation

Pre-conditions:

Clone repo

git clone https://gitlab.com/test-maker-team/test-maker-api.git

Go to folder

cd test-maker-api/

Pull images and run as containers for project(database, cache, message queue,...)

docker-compose up -d

Create environment file with application-<env_name>.yml in /src/main/resources/

Such as application-dev.yml, application.yml,...

# ===============================
# = DATA SOURCE
# ===============================
# Set here configurations for the database connection
spring:
  datasource:
    url: jdbc:postgresql:https://<host>:<port_number>/<database_name>
    username: <db_username>
    password: <db_password>
    dbcp2:
      test-while-idle: true
      validation-query: SELECT 1
  sql:
    init:
      continue-on-error: true
  jpa:
    show-sql: true
    hibernate:
      ddl-auto: update
  flyway:
    locations: classpath:dev/db/migration
    encoding: UTF-8
    url: jdbc:postgresql:https://<host>:<port_number>/testmaker_dev
    user: <db_username>
    password: <db_password>

jwt:
  signing:
    key:
      secret: mySecret
  http:
    request:
      header: Authorization
  token:
    expiration:
      in:
        seconds: 604800

Illustration for creating env files

Choose environment to run project

Copy this text into argument vms to run

-Dspring.profiles.active=<env_name>

Illustration for adding arguments

What's included

Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:

<Root project>
├── src/                                                    # project root
│   ├── main/                                               # container java classes and resources
│   │   ├── java                                            # java folder - where storing packages and java classes
│   │   └── resources                                       # resources folder
│   │       ├── static                                      # static - where storing public files
│   │       ├── templates                                   # templates - where storing HTML template
│   │       └── application-<env_name>.yml                  # env files
│   │
│   └── test/                                               # test folder - where storing testing files
│       └── ...
│
└── build.gradle