Skip to content

Critalic/GenesisPractice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GSES2-BTC API

This is a solution for the practice test for Genesis Engineering School 2022. This repository contains a Spring Boot API with the following capabilities:

  • Request current BTC rate using CoinMarketCap's API.
  • Send e-mail with the current course using gmail SMTP to a list of subscribed e-mails.
  • Add e-mails to the above-mentioned list. Detailed requirements are listed here.

IMPORTANT NOTE

The api keys provided in the application.properties are example data. To use the application, you'll have to provide your own.

Requirements

  • JDK 8 or higher
  • Spring Boot (v.2.6.2)
  • Docker

Docker instructions

  • Build the image from the Dockerfile
docker build -t <image name> <path to Dockerfile>
  • Run the application from the image in the Dockerfile directory
docker run -p<your port>:8080 <image name>

The autogenerated Swagger API will be available at http://localhost:<your port>/swagger-ui/index.html

How it works

The main components of the project are:

  • controller - used to get requests and send back responses via defined endpoints;
  • service - classes that contain business logic;
  • model - classes that are used for CoinMarketCap's API's response validation and could be used for data persistence in the future;
  • exception - custom business logic exceptions
  • advice - classes, used for exception handling.

Spring WebClient is used to send requests and get responses in synchronous mode from CoinMarketCap's API. The API's response is then validated and parsed for the requested currency's price. The emails are stored in Emails.txt file and are accessed via Java's IO package classes.

About

Practice test for 2022 Genesis IT School

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published