TODO merge with devicehub | devicehub adapted to trustchain oc1 orchestral (dpp branch)
This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Xavier Bustamante Talavera 47f5bf69ae Return ranges in AggregateRate 2018-10-15 14:20:26 +02:00
docs Add states and quick-access properties on Device; merge in ereuse-rate 2018-10-13 14:53:46 +02:00
ereuse_devicehub Return ranges in AggregateRate 2018-10-15 14:20:26 +02:00
examples Use SanitizedStr and CITText, lowering many strings 2018-09-30 12:29:33 +02:00
tests Return ranges in AggregateRate 2018-10-15 14:20:26 +02:00
.gitignore Initial commit 2018-04-10 17:06:06 +02:00
MANIFEST.in Better installation; add example_app 2018-07-07 18:51:15 +02:00
README.md Enhance installation 2018-09-16 13:53:07 +02:00
requirements.txt Add states and quick-access properties on Device; merge in ereuse-rate 2018-10-13 14:53:46 +02:00
setup.cfg Enhance testing config 2018-09-16 15:56:20 +02:00
setup.py Add states and quick-access properties on Device; merge in ereuse-rate 2018-10-13 14:53:46 +02:00

README.md

Devicehub

Devicehub is an IT Asset Management System focused in reusing devices, created under the project eReuse.org.

Our main objectives are:

  • To offer a common IT Asset Management for donors, receivers and IT professionals so they can manage devices and exchange them. This is, reusing and ultimately recycling.
  • To automatically recollect, analyse, process and share (controlling privacy) metadata about devices with other tools of the eReuse ecosystem to guarantee traceability, and to provide inputs for the indicators which measure circularity.
  • To highly integrate with existing IT Asset Management Systems.
  • To be decentralized.

Devicehub is built with Teal and Flask.

Installing

The requirements are:

  • Python 3.5.3 or higher. In debian 9 is # apt install python3-pip.
  • PostgreSQL 9.6 or higher with pgcrypto and ltree. In debian 9 is # apt install postgresql-contrib
  • passlib. In debian 9 is # apt install python3-passlib.

Install Devicehub with pip: pip3 install ereuse-devicehub -U --pre.

Running

Download, or copy the contents, of this file, and call the new file app.py.

Create a PostgreSQL database called devicehub by running create-db:

  • In Debian 9: sudo su - postgres; examples/create-db.sh devicehub
  • In MacOS: examples/create-db.sh devicehub.

Create the tables in the database by executing in the same directory where app.py is:

$ flask init-db

Finally, run the app:

$ flask run

The error flask: command not found can happen when you are not in a virtual environment. Try executing then python3 -m flask.

See the Flask quickstart for more info.

Administrating

Devicehub has many commands that allows you to administrate it. You can, for example, create a dummy database of devices with flask dummy or create users with flask create-user. See all the available commands by just executing flask and get more information per command by executing flask command --help.

Understand the software

See the docs to understand how the software works and the design principles.

Use the API

Checkout Swagger to see the schemas and endpoints (we are working in making it interactive).

Use postman as an example of how to use the API.

Run in Postman

Testing

To run the tests you will need to:

  1. git clone this project.
  2. Create a database for testing executing create-db.sh like the normal installation but changing the first parameter from devicehub to dh_test: create-db.sh dh_test.
  3. Execute at the root folder of the project python3 setup.py test.

Generating the docs

  1. git clone this project.
  2. Install plantuml. In Debian 9 is # apt install plantuml.
  3. Execute pip3 install -e .[docs] in the project root folder.
  4. Go to <project root folder>/docs and execute make html. Repeat this step to generate new docs.