Skip to content

emiguelsousa/devicemanager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Device Manager API is an API that supports device lifecycle management.
With this API it is possible to perform:

  • Create a new device.
  • Fully and/or partially update an existing device.
  • Fetch a single device.
  • Fetch all devices.
  • Fetch devices by brand.
  • Fetch devices by state.
  • Delete a single device.

Project Content

The folder where this document is located, has all necessary files and folders to build and run the device-manager application.
The following table describes those files and folders:

File/Folder Description
sql folder Folder containg the sql script to create the device-manager database schema
service folder Contains rest api backend code.
Dockerfile File required to build device-manager image.
docker-compose.yml File used to run the application
Device_Mananger_api_calls.postman_collection Sample file with requests that can be imported on Postman tool

Build Environment Requirements

In order to build the application the environment must have:

  1. Maven 3.9+
  2. Java 21+
  3. Podman,Rancher,Docker or similar tool

Run Environment Requirements

In order to run the application the environment must have:

  1. Java 21+ (only if you run the jar locally)
  2. Podman,Rancher,Docker or similar tool

Database setup and requirements

Device Manager supports MySQL Version 8.0.43 + docker-composer file has all the necessary configuration to start a MySQL data base together with Device Manager service.

Device Manager API documentation

The API documentation can be accessed in runtime by placing the following link http://host:port/swagger-ui/index.html.

Build Device Manager app

Local build

The docker file has the necessary requirements to build the jar artifact and generate the final image.
But you can also perform local compilation by executing the following commands:

cd service
mvn clean package

Accessing the test report coverage report (only available on local builds)

Run the following command to generate the report

cd service
mvn clean verify

The test coverage report will be available on service\target\site\jacoco folder.

Build Device Manager container

Easiest and fastest way to build the application and produce a container image. It pre-builds the jar artifact in a image that match the build enviroment requirements and produces the final image. No tests are run in this build mode. On the project root folder where the Dockerfile is located, run the following command:

[podman|nerdctl|docker] build -t device-manager:latest .

Run Device Manager container

On the project root folder where the docker-compose.yml is located, run the following command:

[podman|nerdctl|docker] compose up -d

Stop Device Manager container

On the project root folder where the docker-compose.yml is located, run the following command:

[podman|nerdctl|docker] compose down

Future improvents

Security

Currently isn't Device Manage doesn't integrate directly with any authentication service. In order to have security is necessary to configure an authentication proxy in between.

About

A simple API to manage devices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors