Project documentation to quickly get started hacking it.
- Any Raspberry Pi model.
Other hardware platforms may be used ifDriverService
gets updated. - 2x infrared break bean sensors.
Bind the chosen pin with a team inconfig.yaml
Depending on the table, something else might be better to detect goals.
- Raspberry Pi OS or any operating system capable of running Node.js ecosystem.
- Node.js 16 with npm 8
- Jest test framework
- NestJS app framework
- PM2 process manager
- rpio GPIO access
- RxJS observables
- Swagger UI OpenAPI
.
├── source
│ │
│ ├── config
│ │ Per environment project settings
│ │
│ ├── driver
│ │ Hardware bridge to poll goal sensors
│ │
│ ├── event-emitter
│ │ Publish–subscribe event bus.
│ │
│ ├── exceptions
│ │ Error handler
│ │
│ ├── logger
│ │ Tool for logging messages
│ │
│ ├── scoreboard
│ │ View and API to display scores
│ │
│ ├── store
│ │ In-memory key-value map
│ │
│ └── teams
│ API to handle team data
│
├── tasks
│ Scripts for common tasks
│ Run `npm run` to list them
│
└── test
End-to-end tests
You can set them in a .env
file, at the root of the project:
# run mode, either development or production, affecting
# which configuration is loaded and if it should watch
# for file changes
ENVIRONMENT='development'
# port number to listen to, set to zero for randomness
PORT='4269'
# project folder location inside the Raspberry Pi
UPLOAD_FOLDER='~/foosball'
# SSH destination to the Raspberry Pi
# works best with public key authentication
UPLOAD_SERVER='[email protected]'
After creating the .env
file, run:
# install packages
npm install
# start the app
npm start
Then, open in a browser:
http://localhost:4269/
for the live scoreboardhttp://localhost:4269/api
for the OpenAPI documentation