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.
- The environment where this project will be run should have Java 8 setup with environment variables.
- The environment should have Maven build tool configured for building the project and running the project as
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 aSpring-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 -
- To run this project utilizing
Spring-Boot
feature, simply go to the project directory and run the below command
mvn spring-boot:run
- To run this project utilizing the Java JAR file, simply go to the project directory and run the below command from project directory
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.
- 1.0.0-SNAPSHOT: Release with
getAllTransactions
andgetAverages
methods. - 1.0.1-SNAPSHOT: Release with
ignoreDonuts
methods.
- Spring STS has been used to develop this project.
- This project was tested as Spring-Boot Application as well as a runnable JAR file.
- As the backend API is not consumable through a VPN, please make sure you're not on any VPN while running the application.
- JUnit test classes have not been written for this project.
- Have shown documentation framework, Swagger Implementation in some of the model classes.
- Reach out to me: gisgaurav@gmail.com