Skip to content

The ReDREAM project, funded by EU Horizon 2020, aims to revolutionise the energy market and puts the consumer at the centre. The mobility service is a web API that allows other ReDream modules to get information about vehicles, routing and energy consumption for travels.

License

Notifications You must be signed in to change notification settings

hankerspace/ReDREAM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT License LinkedIn


Logo

REDREAM - MOBILITY SERVICE

Web API for the ReDream Mobility Service

API main path · Project website

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Product Name Screen Shot

The ReDREAM project, funded by EU Horizon 2020, aims to revolutionise the energy market and puts the consumer at the centre.

The mobility service is a web API that allows other ReDream modules to get information about vehicles, routing and energy consumption for travels.

Main features are:

  • Provide a database of vehicles based on their energy and size. This database contains a lot of constants needed for other Mobility Service modules.
  • Retrieve the energy cost. Electricity price is retrieved from the Stemy database. Fuel, dies price is retrieved from the HERE API database.
  • Compute travels route and energy consumption for a given vehicle or using public transport.
  • Store and compute KPIs for a user (average energy consumption, average distance, average time, etc.)

Other features will be added in the future.

(back to top)

Built With

The modules are built using Java 1.8 based on the Spring framework.

  • Maven is used for project management and building the modules.
  • Spring Boot is the main framework used for the modules.
  • Spring Cloud is used for the microservices architecture.
  • Docker is used for the overall deployment.
  • Keycloak is used for authentication.
  • PostgreSQL is used for the database.
  • Swagger is used for the documentation.
  • JUnit is used for the tests.
  • Mockito is used for the tests.
  • Javadoc is used for the documentation.
  • SonarQube is used for the code quality.
  • Git is used for the version control.

(back to top)

Getting Started

In order to use the API, you need to compile the modules and deploy them on a Docker container.

Prerequisites

The following items should be installed in your system:

Compilation and push docker images

Here is an example of possible compilation process. Depending on the IDE you choose, some steps may change

  1. On the command line
    git clone https://github.com/redream.....git
    
  2. Inside IntelliJ IDEA In the main menu, choose File -> Open and select the ReDream-Cloud pom.xml. Click on the Open button.

Now the whole projet is opened in the IDE. You can now compile the project. Each module of the project must be compiled. There is a specific maven goal to build and push images on a docker registry.

  1. To compile using the command line, move to the root directory of the project. Then execute the following command:
    mvn clean install package docker:build -DpushImage
    

(back to top)

Installation and running

On the target machine, you need to install the Docker client. Be sure to also install docker-compose.

  1. You need to authenticate to the Docker registry.

    docker login isaratech.registry.jetbrains.space -u username
    
  2. Move to the root directory of the project and execute the following command:

    docker-compose up -d
    
  3. Wait... The application needs few minutes to start.

  4. You can now access the application using the following URL:

    http://localhost:8080/
    
  5. Tools and other modules are available on the others ports such as 5601, 9411, 9090 and so on...

If you want to use your own docker registry, you have to edit the configuration in the pom.xml file and then in the docker-compose.yml. Currently, the docker registry is private, and you need credentials to get the built images.

(back to top)

Usage

API

Once the application is running, you can use the following endpoints:

Please refer to the Endpoints documentation

Tools

Several tools are available on the application. They are part of Spring Cloud framework.

By default, the tools are available on these ports:

  • 8761: Discovery service with web-based UI to monitor the registered services.
  • 8888: Config service with API to retrieve configurations.
  • 5432: PostgreSQL database.
  • 9090: Admin service with web-based UI to manage the application. Metrics and health of services are available.
  • 5000: Logstash service.
  • 9200: Elasticsearch service.
  • 5601: Kibana service. It is a web-based UI to monitor the application. It is also used to visualize the logs.
  • 8889: Keycloack service. Exposes a web-based UI to manage the application authentication.
  • 9411: Zipkin service. It is a web-based UI to monitor the application. It is also used to visualize the traces.
  • 9091: Prometheus service.
  • 3000: Grafana service. It is a web-based UI to monitor the application. It is also used to visualize the metrics.

(back to top)

Roadmap

  • Vehicle service
  • Energy service
  • Routing service
  • User service
    • Endpoints to store User KPIs
    • Endpoints to retrieve User KPIs
  • Hybrid vehicles

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

In order to contribute to the project, you need to:

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Project Link: https://github.com/hankerspace/ReDREAM

(back to top)

Acknowledgments

Here are some resources we found useful:

  • Spring Logo Spring : Spring makes it easy to create Java enterprise applications. It provides everything you need to embrace the Java language in an enterprise environment, including:
    • Core technologies like dependency injection and declarative programming.
    • Infrastructure support in the form of data access and integration, validation, web, and more.
    • A testing framework.
    • A rich ecosystem of third-party libraries.
  • Img Shields : Shields are SVGs that you can use in your README to highlight code coverage, dependencies, etc.
  • GitHub Pages : GitHub Pages are public webpages hosted and easily published through GitHub.
  • Font Awesome : Font Awesome Icons are incredibly awesome. Available in Font Awesome Free for everyone, or in Font Awesome Pro when you get a license.
  • React Icons : Include popular icons in your React projects easily with react-icons, which utilizes ES6 imports that allows you to include only the icons that your project is using.
  • HERE Maps : HERE Maps API for JavaScript brings interactivity and rapid customization into your application development, with HERE maps as the foundation.
  • Google Maps : Google Maps Platform offers a free $200 monthly credit for Maps, Routes, and Places (see Billing Account Credits).
  • Spring Cloud : Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems (e.g. configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state).
  • Netflix OSS : Netflix Open Source Software Center.
  • Docker Logo Docker : Docker is an open platform for developing, shipping, and running applications.
  • Docker Compose : Compose is a tool for defining and running multi-container Docker applications.
  • Docker Registry : Docker Hub is the world's easiest way to create, manage, and deliver your teams' container applications.
  • Best Readme Template : An awesome README template to jumpstart your projects!
  • YourKit Logo YourKit supports open source projects with innovative and intelligent tools for monitoring and profiling Java and .NET applications. YourKit is the creator of YourKit Java Profiler, YourKit .NET Profiler, and YourKit YouMonitor.

(back to top)

About

The ReDREAM project, funded by EU Horizon 2020, aims to revolutionise the energy market and puts the consumer at the centre. The mobility service is a web API that allows other ReDream modules to get information about vehicles, routing and energy consumption for travels.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages