This is probably the best template that I've seen so far for making an easy to use app in nodejs.
It uses Alby to handle the lightning payment processing. You only need to setup a lightning address with them and provide it to the app. The rest is all taken care of, authentication, payments, and qr-code generation.
It's great!
reply
Glad you like it! 👌
reply
Dope! We need more turn-key tooling to help devs integrate lightning (ESPECIALLY devs who are not bitcoin experts). Thanks for sharing!
reply
For someone who doesn't have experience making apps (but has experience coding in python and fortran), what would be your recommendation to take this template and make something useful out of it? What prerequisites would be needed to deploy something from nearly scratch all the way to the end? Plenty of ideas on what my app could be about...
reply
This project uses JavaScript and the Express.js web framework. You'd use yarn.js to run the project and install additional packages. It does server side rendering of HTML templates (.ejs files), of course styles are CSS.
reply
Ok, thanks! I'll check out the different keywords you gave me there and see how I can get up to speed...
reply
You only need to do the following after you download the code (or git clone it)
npm install #(to install the dependencies) npm start #(to compile and run the server)
now the app is running at port 3000, so simply open a website at localhost:3000 or at your ip:3000
To be able to run those commands you need to have nodejs installed. Also git for easier download.
So, the whole thing is:
git clone https://github.com/reneaaron/lapp-template cd lapp-template npm install npm start
Now your app is live at your_ip:3000
reply
Thanks. I've done everything, except when i type npm start, I'm getting
You need to configure your environment variables first. Check out the README file!
However, I've put my getalby address in the .env file (without any spaces around the = character). I've even restarted the terminal in case something has to be sourced like for .bashrc files.
reply
Looks like it's not reading the .env file.
Add this in the beginning of src/server/server.js
const { config } = require('dotenv');
and this just before // Validate configuration
config();
reply
Great, it works now.
FYI, I had to kill a docker process locking port 3000 before it did (using kill -9 $(lsof -ti:3000)).
Will try experimenting a bit with it all now
reply
Alby login throws Network Error, but that's probably outside of this app's control. Anyhow, can confirm it looks like a neat template to start building on. Good job!
It's a great starting template, but I get the following error when trying to sign in with Bitcoin or scanning the QR code:
TypeError: window.webln.lnurl is not a function at window.addEventListener.capture (inpageScript.bundle.js:1:13624) window.addEventListener.capture @ inpageScript.bundle.js:1
Can someone help, please?
reply
You will probably get more help if you post that as an issue in GitHub:
reply
This is awesome!
reply