Skip to content

Energy API project consists a couple of the endpoints for a technical training using Java Technology with Spring Boot, RESTFUL, build in Gradle and persistence by MongoDB.

Notifications You must be signed in to change notification settings

jamilsolutions/energy

Repository files navigation

Energy Consumption API

Energy Consumption API project consists a couple of the endpoints like GET /consumption, and POST /event and GET /microgeneration for a technical test using Java Technology with Spring Boot, RESTFUL, build in Gradle and persistence by MongoDB.

Requirements:

  1. Have the MongoDB database installed on the local machine or server:

    Note: Keep MongoDB Compass installation enabled.

  2. Access the database

  3. Create energy database if necessary.

  4. Having Java 8 or higher installed on your computer or laptop:

  5. Clone the project by running the command in a folder of your choice:

   git clone https://github.com/jamilsolutions/energy.git
  1. Enter the directory where the project was cloned and open a command prompt with Git Bash:

    Note: 1. If you do not have git installed use this link to install:

  2. Edit the /energy/src/main/resources/application.yml file with the database settings:

Example:

   spring:
     data:
     mongodb:
       host: localhost
       port: 27017
       database: energy
  1. Run the command in the project /energy with the command:
./gradlew bootJar
  1. Run the project with the command
cd /build/libs/
java -jar energy-0.0.1-SNAPSHOT.jar
  1. Open Postman and import the Secure collection Energy.postman_collection.json:
Postman -> File -> Import -> Select folder or Upload the file -> Confirm import.
  1. Run the collection Energy:
Run Collection Runner -> Run Energy.
  1. Completed. Great job!

About

Energy API project consists a couple of the endpoints for a technical training using Java Technology with Spring Boot, RESTFUL, build in Gradle and persistence by MongoDB.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages