AstroPlant / astroplant-backend

Linking several systems to create the AstroPlant backend
https://astroplant.gitbook.io/developers/
4 stars 2 forks source link

AstroPlant Backend

This repository contains utilities to build the modules that form the AstroPlant backend. The main API, necessary for running the backend, is available at the astroplant-api repository. A front-end UI for interacting with the backend is available at the astroplant-frontend-web repository.

Description of the backend architecture

The AstroPlant backend consists of various modules.

Communication between kits and the backend is over MQTT. A service ingests measurements over MQTT into the database. The main AstroPlant API implements the bi-directional kit RPC. It further implements the HTTP API used by front-end clients.

File tree

Creating a development backend

This repository provides two methods for creating backends for development purposes: Docker Compose and a NixOS container.

Docker Compose

A Docker Compose file to launch a development backend including the web front-end is available in the ./docker subdirectory.

To get started quickly, run:

$ git clone https://github.com/AstroPlant/astroplant-api.git
$ git clone https://github.com/AstroPlant/astroplant-frontend-web.git
$ git clone https://github.com/AstroPlant/astroplant-backend.git
$ cd astroplant-backend/docker
$ docker-compose up

Then navigate to http://localhost:5173 in your browser.

See the ./docker directory for more details.

NixOS container

A NixOS container declaration is given in ./flake.nix. On NixOS, you can start it imperatively:

$ git clone https://github.com/AstroPlant/astroplant-backend.git
$ cd astroplant-backend
$ sudo nixos-container create astroplant --flake .
$ sudo nixos-container start astroplant

See https://nixos.wiki/wiki/NixOS_Containers for more information.