This repository is used for storing and versioning code base for app-coding-exercise.
This repository will be used to track and store code base for app-coding-exercise.
This is a Maven-based Spring Boot application, which is used for consuming an API. The docs for the API being consumed are present at this link.
Spring-Boot
application. This step is important because unless the code is built, the corresponding JAR file will not be present and the application won’t run as a Java JAR or as a Spring-Boot
application.To get the code on your local machine, you can either fork the repository and then clone it, or you can clone this repository using the below command.
git clone https://github.com/gauravkanojia/app-coding-exercise.git
Changes can be pushed through a pull request and will be reviewed before merging them to the main (master) repository.
For Forking
this repository, simply click on the Fork button on the top right corner of this page.
As this is a Maven-based project, the dependencies and build properties are mentioned in the parent pom.xml
file. To build the project, simply run the below command in the parent directory where pom.xml
is present.
mvn -U clean install
Above command will build the project for the mentioned dependencies and will package it into a JAR file which can be run as any other Java JAR file.
Since this is a Spring-Boot
project, it can be run in two ways -
Spring-Boot
feature, simply go to the project directory and run the below command
mvn spring-boot:run
java -jar target/app-coding-exercise-1.0.1-SNAPSHOT.jar
Want to check if application is up? Simply paste this URL in browser.
URL - http://localhost:8080/coreapi/test
Expected Output: Your Spring Boot Application is up! Try running other methods. Check README for more details.
URL for Getting all transactions
Operation - GET
URI - http://localhost:8080/coreapi/getAllTransactions
cURL command - curl -X GET http://localhost:8080/coreapi/getAllTransactions
URL for Getting Average Monthly Expenses and Income
Operation - GET
URI - http://localhost:8080/coreapi/getAverages
cURL command - curl -X GET http://localhost:8080/coreapi/getAverages
URL for Ignore Donuts from All Transactions
Operation - GET
URI - http://localhost:8080/coreapi/ignoreDonuts
cURL command - curl -X GET http://localhost:8080/coreapi/ignoreDonuts
The versions mentioned below are oldest to latest.
getAllTransactions
and getAverages
methods.ignoreDonuts
methods.