Skip to content

isuru-samarasinghe/crypto-recommendation-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crypto Recommendation Service

This is a Java 8 and Spring Boot application that provides a recommendation service for cryptocurrencies. When you start the application (and every day at midnight) the service reads prices from CSV files, calculates various statistics for each cryptocurrency, and stores that data in the H2 in-memory database. The application also exposes several endpoints for retrieving this data.

Important things to know

  • CSV files are stored in src/main/resources directory
  • If you add more CSV files with different crypto, the application will read them automatically
  • If a given CSV file(s) has data of more than a month (6 months, a year), the application will process them accordingly
  • If the user requests data of a crypto that is not available, the service will provide an appropriate error with 404 code
  • The application is dockerized, so it can be used with Kubernetes
  • The application will throw 429 Too Many Requests error if a given user exceeds this service.rate.limit

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Java 8
  • Maven
  • Docker (optional)

Installing

  1. Clone the repository
git clone https://github.com/isuru-samarasinghe/crypto-recommendation-service.git
  1. Navigate to the project directory
cd crypto-recommendation-service
  1. Build the project with Maven
mvn clean install
  1. Run the application
java -jar target/crypto-recommendation-service-1.0-SNAPSHOT.jar

The application will start running at http://localhost:8080/swagger-ui.html.

If you want to run the application using mvn spring-boot:run command, makesure to copy application.properties to the root of the project.

Docker

To run the application in a Docker container, build the Docker image and run it:

  1. Build the project
mvn clean install
  1. Build the Docker image
docker build -t crypto-recommendation-service .
  1. Run the Docker container
docker run -p 8080:8080 crypto-recommendation-service

Documentation

The API documentation is available at http://localhost:8080/swagger-ui.html.

Testing

To run the tests, use the following Maven command:

mvn test

Code Coverage

To generate the code coverage report, use the following Maven command:

mvn test jacoco:report

This will generate a report in target/site/jacoco/index.html. Open this file in a web browser to view the report.

Initial coverage report.

image

Built With

  • Java 8 - The programming language used
  • Spring Boot - The web framework used
  • Maven - Dependency Management
  • Swagger - Used to generate the API documentation

Authors

  • Isuru Samarasinghe

License

This project is licensed under the Apache 2.0 License - see the LICENSE.md file for details

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published