8000 first · CoderBotOrg/dev-docs@ce98fd7 · GitHub
[go: up one dir, main page]

Skip to content

Commit ce98fd7

Browse files
committed
first
1 parent 75ef674 commit ce98fd7

File tree

4 files changed

+91
-3
lines changed

4 files changed

+91
-3
lines changed

.github/workflows/build_publish.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ jobs:
4545
${{ runner.os }}-build-
4646
- name: Install dependencies
4747
run: npm ci
48-
- name: Static HTML export with Nuxt
48+
- name: Generate REST API docs
49+
run: docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate -i https://raw.githubusercontent.com/CoderBotOrg/backend/develop/coderbot/v1.yml -g markdown -o /local/docs/api_v1
50+
- name: Static HTML export with VitePress
4951
run: npm run docs:build
5052
- name: Upload artifact
5153
uses: actions/upload-pages-artifact@v1

docs/Backend.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,32 @@
1-
# Backend
1+
# Backend
2+
3+
The backend component implements CoderBot control and programming runtime.
4+
5+
It is based on a single Python process executing the Flask web server.
6+
7+
The services are all implemented, and served, as REST API exposed by the [connexion](https://connexion.readthedocs.io/en/latest/#) framework.
8+
9+
## CoderBot API
10+
11+
See the full specification of the [CoderBot REST API](./api_v1/README.md).
12+
13+
## Features
14+
15+
The backend services are used by the Web App front end in order to execute commands on the CoderBot hardware (direct control of motors), as well as providing the real time video stream.
16+
17+
The backend implements API to manage CoderBot configurations and programs, offering read/write/delete to all entities, which are persisted on the local Raspberry Pi nass storage (the data partition of the micro-sd).
18+
19+
One core feature of the backend component is the ability to execute user defined programs, which are programs written by the CoderBot users using the blockly editor available in the Web App.
20+
21+
The backend component implements the runtime environment for user programs. User programs are sent from the Web App to the backend via REST API as a Python source code generated by blockly. The Python code is "instrumented" with "on-demand loop exit" statetements and then executed as part of the main Python backend program (in the context of the same process of the main backend runtime).
22+
23+
The backend implements all binding required to control the CoderBot, either by reading input and controlling outputs.
24+
25+
The main features implemented are:
26+
- video stream - provides a continuos video stream (MJPEG format) of the Raspberry Pi Camera to the Web App
27+
- ultrasonic sensors - provides distance readings from the sensors
28+
- motor control / encoder reading - provides control over the motors, as well as reading the input from the step encoders plugged on the moters
29+
- computer vision - provides several decoding algorithm based on [OpenCV](https://opencv.org/) framework, in order to detect objects and features from images taken from the video stream, including image classification and obkect recognition via deep neural networks models and the [Tensorflow Lite](https://www.tensorflow.org/lite) runtime framework.
30+
- audio output - emits sounds and text to speach via audio output device
31+
- audio input - detects sounds and noise through the audio input device
32+
- music - provides a musical instruments API on top of audio output device

docs/Frontend.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,27 @@
22

33
The frontend component provides the Web application client module.
44

5-
The Web Application is a Single Web Application based on the Vue framework.
5+
The Web Application is implemented as Single Web Application based on the [Vue](https://vuejs.org/) framework.
66

7+
The Web Application is served by a nginx web server running on the Raspberry Pi. The nginx also works as a reverse proxy for the backend REST API, as well as the wifi-connect REST API.
8+
9+
## Paths
10+
11+
The main paths served by the frontend are:
12+
13+
- `/` (root) - The Web Application
14+
- `/api` - The backend REST API
15+
- `/wifi` - The wifi-connect REST API
16+
17+
## Components
18+
19+
The Web App uses several Vue ecosystem extensions and add-ons:
20+
21+
- [Vuetify](https://next.vuetifyjs.com/en/) - UI elements aligned to Material Design
22+
- [Vuex](https://vuex.vuejs.org/) - client state management
23+
- [VueRouter](https://router.vuejs.org/) - path routing
24+
- [Vuelidate](https://vuelidate-next.netlify.app/) - form input validation
25+
26+
The program editor is based on [Blockly](https://developers.google.com/blockly), which is also used as a toolbox (blocks "palette" editor).
27+
28+
See [frontend repo](https://github.com/CoderBotOrg/frontend) for more details.

docs/Getting_started.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,37 @@
11
# Getting started
22

3+
CoderBot, when in "production" runs in containers hosted on the BalenaOS. To prepare a production runtime, see [Deployment](./Deployment.md) guide.
4+
5+
The following guide is about preparing an environment suitable for development of frontend (WebApp) and backend CoderBot components.
6+
7+
## Choose your development environment
8+
9+
Although a complete environment will be composed of a workstation running nodejs and an IDE and a Raspberry Pi running the Raspberry OS (Linux Debian), it is possible to use a "stub" running in a container on the workstation in order to avoid the requirement of the Raspberry Pi while developing just the frontend.
10+
11+
These are the possible choices of development environment.
12+
13+
### Web App on Raspberry Pi, backend on Raspberry Pi
14+
15+
The most complete and preferred development environment, it enables development of both components.
16+
17+
1. flash a micro-sd card (at least 8GB RAM, possibly class 10) with the latest release of the Raspberry OS (32bit), using the [Raspberry-provided desktop app](https://www.raspberrypi.com/software/). Do not forget to enable ssh and the WiFi connection configuration.
18+
2. login via ssh to the Raspberry Pi, [download the script to install requirements](https://github.com/CoderBotOrg/system-install/archive/refs/heads/master.zip)
19+
3. run the `install_dev.sh` script in the `system-install` directory.
20+
21+
After the script has been executed, a directory named `coderbot` should be present in the `/home/pi` path.
22+
23+
### Web App on workstation, backend on local docker (stub)
24+
25+
26+
### Web App on workstation, backend on Raspberry Pi
27+
28+
329
## Installation
430

31+
### Workstation
32+
33+
### Raspberry Pi
34+
35+
## Make a change
36+
37+

0 commit comments

Comments
 (0)
0