Skip to content

Commit a69c937

Browse files
authored
Merge pull request #28 from lightninglabs/connect-demo
Add demo to showcase the basic connection flow
2 parents 3162f23 + 734aa21 commit a69c937

30 files changed

+29112
-0
lines changed

demos/connect-demo/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"overrides": [
3+
{
4+
"files": [".prettierrc", ".babelrc", ".eslintrc", ".stylelintrc"],
5+
"options": {
6+
"parser": "json"
7+
}
8+
}
9+
],
10+
"printWidth": 90,
11+
"proseWrap": "always",
12+
"singleQuote": true,
13+
"useTabs": false,
14+
"semi": true,
15+
"tabWidth": 2,
16+
"trailingComma": "all",
17+
"bracketSpacing": true,
18+
"jsxBracketSameLine": false,
19+
"arrowParens": "avoid"
20+
}

demos/connect-demo/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# LNC Demo - Basic Connect
2+
3+
This demo showcases the most basic flow to connect from a browser to a Lightning Terminal
4+
(litd) node using the `lnc-web` NPM package.
5+
6+
## Running the demo
7+
8+
To run the demo, you'll need to have NodeJS installed and a Lightning Terminal node
9+
accessible that you can obtain a pairing phrase from.
10+
11+
1. Clone this repo
12+
```sh
13+
$ git clone https://github.com/lightninglabs/lnc-web.git
14+
$ cd lnc-web/demos/connect-demo
15+
```
16+
2. Install the dependencies
17+
```sh
18+
$ npm install
19+
```
20+
3. Start the web app
21+
```sh
22+
$ npm start
23+
```
24+
Your browser should open to http://localhost:3000 and you should see the home page
25+
below
26+
27+
## Screenshots
28+
29+
### Welcome page with Connect button
30+
31+
![1_welcome](./public/img/1_welcome.png)
32+
33+
### Connect page
34+
35+
Enter your pairing phrase and a new password to use so you don't need to login again
36+
37+
![2_connect](./public/img/2_connect.png)
38+
39+
### Welcome page when connected
40+
41+
After connecting to your node, you'll be redirected back to the welcome page, but now it
42+
will display some information obtained from calling `GetInfo` on `lnd`.
43+
44+
![3_connected](./public/img/3_connected.png)
45+
46+
### Login page
47+
48+
If you reload the page or click the Logout link, you will be taken back to the Welcome
49+
page. It will detect that you have already connected from this browser in the past and
50+
display a "Login" button instead of "Connect". When you click "Login", you'll be take to
51+
the Login page where you only need to provide your password to reconnect to your node.
52+
53+
![4_login](./public/img/4_login.png)

0 commit comments

Comments
 (0)