nRF Connect is based on Electron, React, and Redux. Some familiarity with React and Redux is recommended in order to create apps. You should at least understand concepts like JSX, props, actions, reducers, and immutable state.
Install development tools
You should have a basic setup and little familiarity with these:
- Node.js (at least version 14)
- An editor with good TypeScript support (e.g. VS Code, Atom, WebStorm)
Install nRF Connect
If you only want to develop (existing or new) apps, it is sufficient to have nRF Connect for Desktop installed as a binary. If you do not have it installed already, just follow the instructions on how to install nRF Connect for Desktop.
Architecture of nRF Connect for Desktop
Before starting, you should know the basic structure of nRF Connect for Desktop with its two main blocks, the core and the apps:
The core resides in the two projects:
- The launcher from which the apps are installed and launched
- The Electron shell in which the launcher and the apps run
contains the common code for all apps: UI elements and code to give lower level
A bit unusual: Some common libraries are not only provided during development and then bundled into the apps. Instead the launcher also provides these libraries during runtime, so that the individual apps do not have to include the shared code themselves.
Providing the common libraries through the launcher at runtime has two advantages for the apps: The apps can be smaller and they are usually platform independent, as the only platform specific parts are in the core.
Conversely, this means that the core is platform dependent and a platform-specific variant must be downloaded or compiled.
Besides common code
pc-nrfconnect-shared also provides common package
dependencies, scripts and configurations for all official applications and the
core. E.g. it includes configurations for esbuild,
ESLint and Jest as well as scripts to
Nordic Semiconductors provides several apps to work with the development kits or dongles from Nordic Semiconductor. They are all installed and run through the launcher provided by the core.
Besides using the officially distributed apps, you are also able to run your own apps. This is described later, when we describe how to develop your own apps.
There are some more projects that aid the development of apps for nRF Connect for Desktop:
- Several projects are brought in as dependencies by the core which provide access to the hardware:
pc-nrfconnect-boilerplateis a very minimal app, which is not useful on its own, but may be used as a template to start new apps.
pc-nrfconnect-docscontains these pages to describe how to develop nRF Connect for Desktop.
You are now set up to develop a new app, work on an existing app or work on the core of nRF Connect for Desktop.