Giter VIP home page Giter VIP logo

buddy's Introduction

EdgeTX Buddy logo

Pipeline status Coverage code style: prettier

Helping you on your journey to EdgeTX

Development

Prerequisites

This application uses node-usb when running in electron. In order to compile the bindings some build libraries are required depending on platform. For MacOS and Windows, these should already be built in.

Linux

$ sudo apt-get install build-essential libudev-dev

This software is designed to run on node@16 which can be installed with Fast Node Manager

Commands

Enable or install yarn package manager

# For Node.js <16.10
$ npm i -g corepack

# For Node.js >=16.10
$ corepack enable

Install deps

$ yarn

Developing

# Start electron and web environments in watch mode
$ yarn start

# Start web environment only
$ yarn start:web

# Storybook component environment
$ yarn storybook

Building

# Build and pack electron app (outputs renderer assets too)
$ yarn build

# Compile only web environment
$ yarn compile:web:production

Run tests

$ yarn test

Run e2e tests - requires web or app to be built

# Web app tests
$ yarn e2e:web
# Electron app tests
$ yarn e2e:app

Lint

$ yarn lint:all

# Or yarn lint <file>

Format (this codebase has enforced formatting with prettier)

$ yarn fmt

Extract new translation strings

$ yarn extract-locales

Translations

Translation strings are stored in the ./locales directory. To contribute a language which doesn't already exist:

  1. Add the ISO code to the ./locales/languages.json
  2. Extract the strings to the new language files (yarn extract-locales)
  3. Translate the strings for their equivilent meanings

The namespaces (common, flashing, etc), provide some context for what the strings relate to

Structure

The application is split into different contexts

  • Main: Electron Main Process - initialising the electron application, runs the backend when running in electron. Runs in a Node.JS context
  • Renderer: React Web Application - Runs in browser or electron renderer process. Shows different UI depending on context.
  • Shared: Multi-Context code - Designed to run in any environment. Imported by both Main or Renderer
  • Webworker: WebWorker Context - .bootstap files start-up .worker files. Code designed only to run in WebWorker contexts.

Communication

This application makes use of GraphQL to request data across process boundary. Meaning that the renderer process is always entirely separated from the GraphQL execution environment.

Apollo Bus Link is used to facilitate the communication between the GraphQL execution process in Electron or Webworker environments.

Electron architecture Webworker architecture

Exceptions

Within WebWorker contexts, there are some browser functions which cannot be invoked within WebWorker contexts and so have to be invoked in the main process. In order to keep things in Electron and Web processes similar a set of Cross Boundary Communication functions have been defined.

Acknowledgements

A massive thank you to the software which makes all of this possible. Specifically:

Screenshots

Screenshot of flashing

buddy's People

Contributors

freshollie avatar pfeerick avatar bigspeedfpv avatar rotorman avatar kobakirill avatar daleckystepan avatar pancronos avatar l1cardo avatar raphaelcoeffic avatar riwanou avatar jurgelenas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.