bayuagpr / be-xaltius-test

Xaltius Developer Technical Test: (Back-end)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Xaltius Developer Technical Test: (Back-end)

Age Color Generator Apps

This repository contains the source code for Age Color Generator back-end service. It contains all services necessary to expose endpoint and handling request.

Demo

Base URL: https://xaltius-be-test.herokuapp.com

  • Endpoint: /process/age
  • Request body: { "name":"Bayu", "age": 21 }
  • Expected response: { "statusCode":200 "data": { "name":"Bayu", "age": 21, "colors": "#e6bbad" } }

Screenshot

expected

Table of contents

Technologies

  • Spring Framework 5
  • Java Servlet API
  • Fasterxml Jackson Databind
  • Lombok

Packages Structure

  • config (Configuration for web and servlet)
  • controller (Mapping endpoint and attach the handler)
  • exception (Exception handing)
  • model (Model class)
  • service (Service handler)

Getting started

Setting up

Maven required

  • Clone this repository: git clone https://github.com/bayuagpr/be-xaltius-test.git
  • Move into the project directory: cd be-xaltius-test
  • Install the dependencies: mvn clean install

How to build

`mvn clean package`

How to run

There are two options:

1. Run jar natively

  • Run the jar: java -jar target/dependency/webapp-runner.jar target/*.war

2. Use docker

Requires the docker installed on the machine

  • Build the docker image: sudo docker build -t xaltius-be-test .
  • Run the docker image: sudo docker run -d -p 8080:8080 -t xaltius-be-test

Deployment

Requires the Heroku CLI client.

Setting up the project on Heroku

  • Create the Heroku app: heroku create

Deploying to Heroku

  • Push code to Heroku: git push heroku master

About

Xaltius Developer Technical Test: (Back-end)


Languages

Language:Java 98.7%Language:Dockerfile 1.3%