Giter VIP home page Giter VIP logo

meterreadings's Introduction

MeterReadings

It is a SpringBoot application which has 3 GET and 1 POST REST API.
It has h2 database for data persistence.
When building applications, I usually go with this architecture.

alt text
I like using the DTO pattern to seperate the communication between the layers.
It also helps with testability of the code.

The application should be working without any additional setup.

DATABASE
Endpoint to connect to h2 database is http://localhost:8080/h2-console
Database user name is "sa" and password is not needed.

Your H2 databse setup should look this to be able to connect to embedded database.

alt text

I have inserted some data to be able to test the application.
If you feel you need to add more data, feel free to edit this file:
https://github.com/MarinPuizina/MeterReadings/blob/master/src/main/resources/data-h2.sql

Potential issues
The only potential issues that I can think of, is with the H2 dependency.
In the pom.xml file:
https://github.com/MarinPuizina/MeterReadings/blob/master/pom.xml

I am using specific version for H2.

alt text

You can try removing the version and let Spring decide which one it is going to use.

REQUEST SAMPLES FOR TESTING THE APP

GET

  1. http://localhost:8080/readings/addresses/Ulica 7/years/2019
  2. http://localhost:8080/readings/addresses/Ulica 7/years/2019/months
  3. http://localhost:8080/readings/addresses/Marmontova/years/2019/months/September

POST

  1. http://localhost:8080/readings
    body:
    { "client": "Marin Puizina", "address": "Ulica 7", "year": 2019, "month": "November", "reading": 7 }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.