Giter Site home page Giter Site logo

elementsproject / nanopos Goto Github PK

View Code? Open in Web Editor NEW
106.0 14.0 25.0 179 KB

A simple Lightning :zap: point-of-sale system, powered by Lightning Charge

License: MIT License

JavaScript 73.60% Shell 3.06% HTML 21.88% Dockerfile 1.46%
bitcoin lightning lightning-charge pos point-of-sale micropayments

nanopos's Introduction

nanopos

npm release MIT license Pull Requests Welcome IRC

A simple Lightning ⚡ point-of-sale system with a clean & minimal web UI.

  • Optimized for places selling fixed-price items (like coffee shops, falafel stands or barber shops), but also has an option for billing custom amounts.
  • Small codebase (~60 server-side LoC + ~70 client-side LoC), great starting point for developing your own Lightning Charge apps!

Powered by ⚡ Lightning Charge.

See demo video here ➤

Setup

$ npm install -g nanopos

$ edit items.yaml # see file format below

$ nanopos --items-path items.yaml --charge-token mySecretToken --currency USD
HTTP server running on localhost:9116

Running with Docker

Nanopos includes a Dockerfile to allow for fast setup using a docker container based on node:carbon. To run from the container with port 9116 exposed, first setup Lightning Charge, then build the image with:

$ docker build -t elements_project/nanopos .

and then run with:

$ docker run -p9116:9116 -e CHARGE_URL=http://[charge-url]/ -e CHARGE_TOKEN=[access-token] elements_project/nanopos

That's it! The web server should now be running on port 9116 and ready to accept payments.

Example items.yaml file

tea:
  price: 0.02 # denominated in the currency specified by --currency
  title: Green Tea # title is optional, defaults to the key

coffee:
  price: 1

bamba:
  price: 3

beer:
  price: 7

hat:
  price: 15

tshirt (S):
  price: 25
  metadata:
    shirt_size: S

The metadata object will be added into the metadata of invoices for this item.

CLI options

$ nanopos --help

  A simple Lightning point-of-sale system, powered by Lightning Charge.

  Usage
    $ nanopos [options]

  Options
    -c, --charge-url <url>      lightning charge server url [default: http://localhost:9112]
    -t, --charge-token <token>  lightning charge access token [required]

    -y, --items-path <path>     path to yaml file with item config [default: ./items.yaml, file is required]
    -x, --currency <currency>   currency to use for item prices [default: BTC]
    -m, --theme <name>          pick theme from bootswatch.com [default: yeti]
    -l, --title <name>          website title [default: Lightning Nano POS]
    --no-custom                 disable custom amount field [default: false]
    --show-bolt11               display bolt11 as text and button [default: false]

    -p, --port <port>           http server port [default: 9115]
    -i, --host <host>           http server listen address [default: 127.0.0.1]
    -h, --help                  output usage information
    -v, --version               output version number

  Example
    $ nanopos -t chargeSecretToken -x EUR -y items.yaml

License

MIT

nanopos's People

Contributors

blackrat avatar mojoaxel avatar shesek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nanopos's Issues

satoshi price calculation

Just curious..

how is nanopos calculating satoshi amount when requesting invoice generation from lightning-charge?
is there a link to current price of btc vs currency chosen?

thanks for comments!

Would you like a logo?

Hi,
excelent work! Im a graphic designer and I would like to create a logo for nanopos. For free, no strings attached.

Will you provide me some feedback if I create something?

More of my contibutions to open source projects - https://busy.org/@andrejcibik

Additionally show invoice as text

Right now the invoice is only displayed as QR code but if you have to copy and paste the invoice or if you're using the Tor browser (which doesn't display the QR codes by default) you want to see the invoice as text string.

Installation Issue

I seem to be having a issue with npm install.

root@BTCPayServerVM:/home/elementsprojects/nanopos# npm install
root@BTCPayServerVM:/home/elementsprojects/nanopos# npm start

[email protected] start /home/elementsprojects/nanopos
./start.sh

npm ERR! weird error 1
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! not ok code 0
root@BTCPayServerVM:/home/elementsprojects/nanopos# npm install
root@BTCPayServerVM:/home/elementsprojects/nanopos# npm start

[email protected] start /home/elementsprojects/nanopos
./start.sh

npm ERR! weird error 1
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! not ok code 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.