Skip to content

Latest commit

 

History

History
98 lines (77 loc) · 2.54 KB

CONTRIBUTING.md

File metadata and controls

98 lines (77 loc) · 2.54 KB

Contributing

Project documentation to quickly get started hacking it.

Hardware

Software

Tech stack

Folder structure

.
├── 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

Enviroment variables

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]'

Setup and run

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 scoreboard
  • http://localhost:4269/api for the OpenAPI documentation