Skip to content

Commit 4e56f01

Browse files
committed
add getting started
1 parent 0793436 commit 4e56f01

File tree

4 files changed

+66
-10
lines changed

4 files changed

+66
-10
lines changed

docs/Getting_started.md

Lines changed: 63 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,81 @@ Although a complete environment will be composed of a workstation running nodejs
1010

1111
These are the possible choices of development environment.
1212

13-
### Web App on Raspberry Pi, backend on Raspberry Pi
13+
### Web App on workstation, backend on Raspberry Pi
1414

15-
The most complete and preferred development environment, it enables development of both components.
15+
![Dev Env Full](./images/dev_env_hybrid.svg)
1616

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.
17+
The most complete and preferred development environment, it enables development of both components: frontend on the workstation (PC or Mac) and backend directly on the Raspberry PI.
2018

21-
After the script has been executed, a directory named `coderbot` should be present in the `/home/pi` path.
19+
### Web App on Raspberry Pi, backend on Raspberry Pi
20+
21+
![Dev Env RPi](./images/dev_env_rpi.svg)
22+
23+
This environment is the best option when you only need to develop on the Web App (frontend), while the backend runs on a "real" Raspberry Pi, so fully exposing CoderBot backend APIs.
2224

2325
### Web App on workstation, backend on local docker (stub)
2426

27+
![Dev Env Stub](./images/dev_env_stub.svg)
2528

26-
### Web App on workstation, backend on Raspberry Pi
29+
This environment is a valid alternative for developing the Web App and the CoderBot APIs mocked by the backend "stub" are enough for enabling frontend development.
2730

31+
The backend "stub" implements most APIs but mocks most phisycal input and output, such as sensor reading and motor control. Also the camera input is a fixed jpeg image, and cannot be used to test computer vision functions, as well as neural netowrks.
2832

2933
## Installation
3034

31-
### Workstation
35+
### Workstation, Web App
36+
37+
1. Install [Nodejs](https://nodejs.org/en/) either by installing directly on the workstation or running a docker image (in that case, [install docker](https://docs.docker.com/get-docker/)).
38+
1. Install [Git](https://git-scm.com/)
39+
1. Clone frontend repo locally: `git clone https://github.com/CoderBotOrg/frontend.git`
40+
1. Install packages, run local server: `cd frontend && npm i && npm run dev`
41+
42+
### Workstation, backend stub
3243

33-
### Raspberry Pi
44+
1. Install [docker](https://docs.docker.com/get-docker/)
45+
1. Run backend stub: `docker run -dp 8090:5000 ghcr.io/coderbotorg/backend:stub-latest`
3446

35-
## Make a change
47+
### Raspberry Pi, backend, frontend (dist package)
3648

49+
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.
50+
1. login via ssh to the Raspberry Pi, [download the script to install requirements](https://github.com/CoderBotOrg/system-install/archive/refs/heads/master.zip)
51+
1. run the `install_dev.sh` script in the `system-install` directory.
52+
53+
After the script has been executed, a directory named `coderbot` should be present in the `/home/pi` path.
3754

55+
Run the backend `cd coderbot && ./start.sh`
56+
57+
You should see on the console the output log of the backend starting.
58+
59+
The backend is properly started and ready to accept connection from the client when the following line is printed in the log:
60+
61+
```
62+
[...]
63+
INFO:root:starting camera
64+
INFO:root:camera init
65+
INFO:cnn.cnn_classifier:./cnn_models/generic_fast_low.tflite
66+
INFO:root:loaded: generic_fast_low <cnn.cnn_classifier.CNNClassifier object at 0x681b4340>
67+
* Serving Flask app 'main'
68+
* Debug mode: off
69+
INFO:werkzeug:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
70+
* Running on all addresses (0.0.0.0)
71+
* Running on http://127.0.0.1:5000
72+
* Running on http://192.168.1.16:5000
73+
INFO:werkzeug:Press CTRL+C to quit
74+
```
75+
76+
## Make your first change
77+
78+
To see if everything is correctly configured, try to make a small change to the frontend and / or the backend
79+
80+
1. Open a browser and load the main (landing) page [http://localhost:8080](http://localhost:8080). See the message "Welcome to CoderBot"
81+
2. On the frontend (if the dev server is running on the local workstation), modify the file `frontend/src/components/Landing.vue` at line 12, Change
82+
83+
```
84+
<div class="logo">CoderBot</div>
85+
```
86+
to:
87+
```
88+
<div class="logo">my first change to CoderBot</div>
89+
```
90+
3. You should see the landing page has been changed and the message is now "Welcome to my first change to CoderBot"

docs/images/dev_env_hybrid.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/images/dev_env_rpi.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy