Development Setup

The development workflow is still being worked on, but this page covers the current state of the world.

You will see pip install -e . frequently in the documentation. Please see the pip documentation for an explanation on what this does.


Backend Development

Linux

1. Clone the dev branch from the LedFx Github repository:

$ git clone https://github.com/LedFx/LedFx.git -b dev
$ cd LedFx

2. Install system dependencies via apt install:

$ sudo apt install libatlas3-base \
      libavformat58 \
      portaudio19-dev \
      pulseaudio

3. Install LedFx and its requirements using pip:

$ pip install -r requirements-dev.txt
$ pip install -e .

4. This will let you run LedFx directly from your Git repository via:

$ ledfx --open-ui

macOS

1. Clone the dev branch from the LedFx Github repository:

$ git clone https://github.com/LedFx/LedFx.git -b dev
$ cd ./LedFx

2. Create a python venv for LedFx with python>=3.7 and install dependencies:

$ python3 -m venv ~/ledfx-venv
$ source ~/ledfx-venv/bin/activate
$ brew install portaudio pulseaudio

3. Install LedFx and its requirements using pip:

$ pip install -r requirements-dev.txt
$ pip install -e .

4. This will let you run LedFx directly from your Git repository via:

$ ledfx --open-ui

Frontend Development

Building the LedFx frontend is different from how the core backend is built. The frontend is based on React.js and thus uses NPM as the core package management.

Note

LedFx will need to be running in development mode for everything to work. To enable development mode, open the config.yaml file in the .ledfx folder and set dev_mode: true)

Linux

To get started, first install npm and all the requirements:

1. Start in the LedFx repo directory:

$ pip install yarn
$ cd frontend
$ yarn install

The easiest way to test and validate your changes is to run a watcher that will automatically rebuild as you save and then just leave LedFx running in a separate command window.

2. Start LedFx in development mode and start the watcher:

$ ledfx
$ yarn start

At that point any change you make to the frontend will be recompiled and after a browser refresh LedFx will pick up the new files. After development and testing you will need to run a full build to generate the appropriate distribution files prior to submitting any changes.

3. When you are finished with your changes, build the frontend:

$ yarn build

macOS

1. Install nodejs and NPM requirements using homebrew:

$ brew install nodejs
$ brew install yarn
$ cd ~/frontend
$ yarn install

2. Start LedFx in developer mode and start the NPM watcher:

$ ledfx
$ yarn start

3. When you are finished with your changes, build the frontend:

$ yarn build

Document Development

The documentation is written in reStructuredText. Once you are finished making changes, you must build the documentation. To build the LedFx documentation follow the steps outlined below:

Note

Alternatively, you may run make livehtml in place of make html to open a browser and view your changes in realtime.

Linux

$ cd ~/ledfx/docs
$ pip install -r requirements-docs.txt
$ make html

macOS

$ source ~/ledfx-venv/bin/activate
$ cd ~/ledfx/docs
$ pip install -r requirements-docs.txt
$ make html