Table of Contents
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.
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.
In order to use the API, you need to compile the modules and deploy them on a Docker container.
The following items should be installed in your system:
- Java 8 or newer (full JDK not a JRE).
- git command line tool (https://help.github.com/articles/set-up-git)
- Your preferred IDE
- Eclipse with the m2e plugin. Note: when m2e is available, there is an m2 icon in
Help -> About
dialog. If m2e is not there, just follow the install process here: https://www.eclipse.org/m2e/ - Spring Tools Suite (STS)
- IntelliJ IDEA
- VS Code
- Eclipse with the m2e plugin. Note: when m2e is available, there is an m2 icon in
Here is an example of possible compilation process. Depending on the IDE you choose, some steps may change
- On the command line
git clone https://github.com/redream.....git
- Inside IntelliJ IDEA
In the main menu, choose
File -> Open
and select the ReDream-Cloud pom.xml. Click on theOpen
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.
- 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
On the target machine, you need to install the Docker client. Be sure to also install docker-compose.
-
You need to authenticate to the Docker registry.
docker login isaratech.registry.jetbrains.space -u username
-
Move to the root directory of the project and execute the following command:
docker-compose up -d
-
Wait... The application needs few minutes to start.
-
You can now access the application using the following URL:
http://localhost:8080/
-
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.
Once the application is running, you can use the following endpoints:
Please refer to the Endpoints documentation
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.
- 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).
In order to contribute to the project, you need to:
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Project Link: https://github.com/hankerspace/ReDREAM
Here are some resources we found useful:
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 : 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 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.