Skip to content

mehmandarov/microprofile-iot

Repository files navigation

MicroProfile + IoT

While it’s easy to figure out why MicroProfile is cool, it’s might be hard to see all of its features in action and how they can be used it in your project. This project intends to show you what MicroProfile is good for by using many of its key elements while solving a specific (and fun) problem – controlling the IoT enabled lighting.

Also, this project is going to show you what happens when enterprise Java developers and architects get to decide how the IoT devices can be controlled.

Documentation

Detailed documentation and the description of the project can be found on a separate page.

Prerequisites

  • Java 8, or newer
  • Maven
  • Docker, docker-compose
  • Hardware: It also might be a good idea to have some Philips Hue lamps, or similar. Note that if you are using something else than Philips Hue, you might need to rewrite or do some changes to the facade service.

Running the Project

  1. Build all the artifacts with Maven:

    $ mvn clean install -T 1C
    
  2. Start all the containers – facade, weatherservice, and timeservice:

    $ docker-compose up --build
    

    The setup of the Docker containers and mapping of the ports with the host machine can be seen in the docker-compose.yml file.

  3. Start the gateway service: Note: this service can be started at any time. It will also be dockerized in the future.

    $ cd gateway
    $ mvn liberty:run-server
    

    Gateway service is now available at http://localhost:9080/hue.

  4. Run the frontend:

    $ cd frontend
    $ npm run serve
    

    If you are running this for the first time, make sure to install all dependencies first with:

    $ npm install
    
  5. Access the frontend from http://localhost:8080/

Authors