Skip to content

bitcoin-studio/LightningNespressoUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nespresso Capsule Vending Machine over Lightning Network

What is it?

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

Notes

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

OpenFaaS

The app is served as an Express app using the OpenFaaS Dockerfile Template.

Non standard Ingress operator

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

Secrets

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

Developing with Okteto (WIP)

Make sure the prod image is deployed
faas up --regex api
Build a dev image
DEV=dev faas build --regex api
Push that image to Okteto container registry
DEV=dev faas push --regex api
Sync local source code with remote using dev image
cd function
okteto up

See also