Coder Social home page Coder Social logo

challenge's Introduction

Tenpo challenge

Tenpo challenge is a web application based on microservices that runs in Docker containers. This README provides instructions for installing and running MyApp using Docker Compose.

Prerequisites

Make sure you have the following components installed on your system:

Installation Steps

Follow the steps below to install and run Tenpo challenge in your local environment:

  1. Clone the Tenpo challenge repository from GitHub:

    [email protected]:alesuarez/challenge.git
    
  2. Run the following command to build the Docker images and start the containers:

    docker-compose up --build
    

This command will download the necessary images, create and run the containers based on the configuration specified in the docker-compose.yml file. The containers will run in the background (-d).

  1. After the containers have started successfully, you can access to Swagger Documentation through your web browser at the following URL:

      http://localhost:8080/challenge/swagger-ui.html
    

Available endpoints

  1. Get a percentage

      POST http://localhost:8080/challenge/calculator/percentage
      
      body:
           {
               "valueOne": 10,
               "valueTwo": 30
           }
    
  2. All Call History paginated data

    GET http://localhost:8080/challenge/history?page=0&size=10

Observations: you can specify the amount of data and the page number

  • page: page number
  • size: number of records per page

By default page=0 and size=10

How to test

  1. MOCKYFLY

    This API uses app.mockfly.dev as mock service. Three possible answers are configured:

  • If the sum of the values is equal to 500.0 the service returns an Internal Service Exception.
  • If the sum of the values is equal to 100.0 the service returns 30%.
  • If the sum of the values is equal to 200.0 the service returns 10%.
  • By default 10%

Postman collection: https://api.postman.com/collections/10961811-f12c27e1-986e-4650-9985-74ddf3f16de7?access_key=PMAT-01H2PKH2CWSQ26T72REYKVR4RA

  1. API

Get 30%

    curl --location 'http://localhost:8080/challenge/calculator/percentage' \
    --header 'Content-Type: application/json' \
    --data '{
    "valueOne": 25,
    "valueTwo": 75
    }'

Get 10%

    curl --location 'http://localhost:8080/challenge/calculator/percentage' \
    --header 'Content-Type: application/json' \
    --data '{
    "valueOne": 150,
    "valueTwo": 50
    }'

Retry 3 times and go to the database

    curl --location 'http://localhost:8080/challenge/calculator/percentage' \
    --header 'Content-Type: application/json' \
    --data '{
    "valueOne": 200,
    "valueTwo": 300
    }'

Technologies

  • Spring boot
  • Maven
  • Resilience4j
  • Lombok
  • Swagger
  • Docker

challenge's People

Contributors

alesuarez avatar

Watchers

 avatar

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.