Skip to content
/ cars Public

Entity-attribute-value (EAV) model implementation based on car

Notifications You must be signed in to change notification settings

dst/cars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cars

Build Status Coverage Status

Entity-attribute-value (EAV) model implementation based on car. Cars in EAV model are kept in a rational database (embedded H2). Attributes together with basic fields are also kept in a document database (embedded MongoDB) to support faster search operations.

Application can be run as fat jar and RESTful API is available.

System dependencies

  • Java 8

Configuration

Default port is 8888. It can be changed in application.yaml if needed.

Starting server

For Windows use gradlew.bat

Run from gradle

$ ./gradlew bootRun

Run the fat jar

$ ./gradlew build
$ java -jar build/libs/cars.jar

Verification

$ curl localhost:8888/info
{
    "app": {
        "description": "RESTful web service for storing cars",
        "name": "cars",
        "version": "0.1"
    },
    "git": {
        "branch": "master",
        "commit": {
            "id": "f08244c",
            "time": "\"Tue Mar 24 23:51:47 2015 +0100\""
        }
    }
}

REST API documentation

Documentation is generated by Swagger and is available under main site. For local run it can be found here

Example car in json format which can be stored in system:

{
  "make": "Opel",
  "model": "Corsa",
  "year": 2010,
  "engineDisplacement": 1300,
  "attributes": {
    "origin": "Poland",
    "speed": "fast"
  }
}

Example search filter:

{
  "year": 2010,
  "speed": "fast"
}

Technology stack

  • back-end: Java 8, Spring Boot, Spring Data, JPA with Hibernate, embedded H2, embedded MongoDB, Lombok, Logback
  • testing: Spock
  • building: gradle, Travis
  • code quality: JaCoCo, coveralls

Disclaimer

All Spring Boot Actuator endpoints are turned on and are available at server port. It is convenience when testing, but not recommended in production.

Embedded H2 and MongoDB databases are used for easy setup.

About

Entity-attribute-value (EAV) model implementation based on car

Resources

Stars

Watchers

Forks

Packages

No packages published