This repository is part of a Do-It-Yourself vending machine project which connects to a Bitcoin point of sales terminal.
Select your coffee, pay with Bitcoin (via Lightning Network), and the vending machine will deliver your Nespresso capsule.
This repository is the Bitcoin point of sale terminal code for the simple non-BTCPay version of LightningNespressoServer.
When an invoice has been paid, the server notifies the client via websocket and sends a request to the vending machine which delivers the Nespresso capsule.
-
master branch is for express app hosted on Kubernetes cluster
-
rpi branch is for Raspberry Pi hosting server locally
-
vps branch is for express app hosted on VPS
Since PWA apps only works with HTTPS, I use HTTPS even in development. Valid server.crt
and server.key
files are needed at the root of
the project. You can follow this tutorial to generates them https://medium.com/@tbusser/creating-a-browser-trusted-self-signed-ssl-certificate-2709ce43fd15
The app is served as an Express app using the OpenFaaS Dockerfile Template.
This app uses a non-standard Ingress Operator that bypass the OpenFaaS Gateway. This is because of the use of the unsupported protocols
gRPC and websockets.
Read more at https://github.com/openfaas-incubator/ingress-operator#bypass-mode
A LetsEncrypt Issuer must be available on openfaas-fn namespace kubectl apply -f k8s/issuer-le-prod.yaml -n openfaas-fn
Deploy Ingress Operator kubectl apply -R -f k8s/ingress_operator
Configuration variables are stored in .env
file.
Also, make sure OPENFAAS_URL env var is set properly before running faas
commands.
faas secret create lightning-nespresso-api-config --from-file=./api/.env
-
The point of sale website: https://coffee.bitcoin-studio.com
-
The vending machine code: LightningNespressoServer
-
The 3D printed / laser cutted vending machine: CAD files
-
A description of the project: Bitcoin Studio website