Skip to content

Contributing

Making a code contribution might seem intimidating, but it’s not too difficult:

  1. Make a fork of the WebODM repository
  2. Clone your repository in a directory
  3. Create a new branch: git checkout -b branchname.
  4. Setup a development environment with docker.
  5. Commit the changes: git commit -a -m "describe your changes"
  6. Push the changes to your repository: git push origin branchname
  7. Create a pull request

We don’t have many rules. Follow the guidelines indicated in the Contributing document, be nice to others and you’ll do great! :)

Follow the WebODM docker installation instructions, then run:

./webodm.sh start --dev

That’s it! You can modify any of the files, including SASS and React.js files. Changes will be reflected in the running WebODM instance automatically.

We think testing is a necessary part of delivering robust software. We try to achieve complete test coverage for backend code and at a minimum robust smoke testing for frontend code.

To run the unit tests, simply type:

./webodm.sh test

Once you’re done making changes, if you start WebODM in production mode (without the --dev flag), you will notice that your changes are missing. This is because webodm.sh uses the opendronemap/webodm_webapp docker image to launch WebODM, which doesn’t have your changes. To apply the changes, you need to rebuild the docker image locally:

docker build -t opendronemap/webodm_webapp .

You can also modify the docker-compose.yml file to point to a different image.

The backend is based mainly on Django and Django REST Framework.

We don’t use much of Django’s templating system, except for the Administration and Processing Nodes sections. Instead we use Django to expose an API, which we then tie to a React.js app.

Directories of interest are listed as follow:

DirectoryDescription
/appMain application, includes the UI components, API, tests and backend logic.
/nodeodmApplication that bridges the communication between WebODM and NodeODM. Includes its own unit tests and models.
/webodmDjango’s main project directory. Setting files are here.

We use a React.js app (ES6 syntax) and SCSS for various UI components such as the dashboard. We use webpack to build intermediate components into a static bundle.

Directories of interest are listed as follow:

DirectoryDescription
/app/templates/appLocation of Django templates. While we don’t use them a lot, we use them for a few pages and as a glue to bootstrap the React code.
/app/static/app/jsLocation of Javascript files for all UI components.
/app/static/app/js/componentsWe try to separate components for reusability into various React components. Each component is stored here.
/app/static/app/js/cssEach component should have its own SCSS file. Those files are stored here.

/app/static/app/js/main.jsx is the entry point for the UI. If you wonder how we tie Django and React.js together, this is the file to look at to begin your search.

We use Astro to generate our documentation. See their project’s documentation for information about making changes to the documentation.