We are very happy to receive and merge your contributions into this repository!
To contribute via pull request, follow these steps:
- Create an issue describing the feature you want to work on
- Write your code, tests and documentation, and format them (ESLint for Javascript and autopep8 for Python)
- Create a pull request describing your changes
Your pull request will be reviewed by a maintainer, who will get back to you about any necessary changes or questions. You will also be asked to sign a Contributor License Agreement.
Check the contribution guidelines to get more details about how to contribute.
The project is divided in two parts: a Python backend handling the data and a ReactJS frontend to build the dashboard. Both can be managed with Docker, but you can also run them separately.
For now, this section has been tested for Ubuntu only. It seems that some problems can occur on macOS, and maybe on Windows. But if you want to contribute it's not a big deal, just scroll down a little bit more to the Python and ReactJS sections to learn how to manage them separately.
Simply install Docker and docker-compose and you are good to go with the command:
$ docker-compose up -d
If you use Docker, you probably want to run the tests inside the running containers. Here is how.
We are using unittest to test the Python code.
$ sudo docker-compose exec app python -m unittest discover minotor/tests
We are using jest to run our ReactJS tests.
$ sudo docker-compose exec front npm run test
Note: in both cases if you installed docker-compose so that it runs without sudo, of course remove sudo from the commands above.
Minotor uses Poetry for dependency management. If you want to build it from source,
you have to install Poetry first.
Run the following code line to install dependencies
$ poetry install
For now, we follow pep8 recommandations. Feel free to use any tool you want to help you do that, even if it is not mentioned in the list below.
PyCharm already has the autopep8 formatter implemented. See your preferences for the related shortcut.
Install python-autopep8 and give it
the autopep8
path in the settings if it is not in your system's path.
We are using unittest to test the Python code. Run the tests at the source of the project:
$ python -m unittest discover minotor/tests
The frontend project is located at /minotor/front
.
At the root of the project, install the dependencies with npm:
$ npm install
You can as well use yarn as package manager:
$ yarn install
We use ESlint to format and spot issues in the Javascript code.
The rules are explicited in the .eslintrc
file.
Since the frontend project is not at the root of the global project, you may have to specify the root to the working directory to your IDE.
Create a .vscode/settings.json
file if it doesn't exist and add a field:
"eslint.workingDirectories": [
"./minotor/front"
],
Install linter and linter-eslint
and you should be good to go. Don't forget to install node dependencies (dev dependencies included)
as shown above so that the node_modules
folder in /minotor/front
exists and is not empty.
We are using jest to run our ReactJS tests. Run the test with npm:
$ npm run test