Skip to content

Commit

Permalink
Merge pull request #2 from hypersign-protocol/feature/bootstrap
Browse files Browse the repository at this point in the history
Feature/bootstrap
  • Loading branch information
Vishwas1 authored Jul 2, 2021
2 parents b340c94 + 9d34b37 commit 21caead
Show file tree
Hide file tree
Showing 6 changed files with 391 additions and 30 deletions.
32 changes: 9 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,28 @@ Unlike, other social login (like F\*ceb\*\*k :p) it does not even track any user
## Install and usage

Note: Make sure you have `hypersign.json` file in your root folder.
### Install dependencies

Install dependencies
```bash
npm i
```

Development
### Development

```bash
npm run bootstrap # it will generate hypersign.json
npm run dev
```
Note: Create `production.env`

```
npm run build:dev
npm run start
```
### Production

Production

```bash
npm run build:prod
npm run prod #production
npm run bootstrap # it will generate hypersign.json
npm run build:dev
npm run start
```
Note: Create `production.env` for production run
Note: Create `production.env`

### Dockerization

Build docker image
```
npm run build:prod
docker build -t hs-auth-server . # build an image
```

Run container
```
docker run -p 5000:5000 -d hs-auth-server
```
Note: Create `production.env` for production run
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
"description": "Server to issue Hypersign Auth Credential. It uses hypersign-auth-js-sdk for this purpose ",
"main": "app.js",
"scripts": {
"start": "cp production.env dist && NODE_ENV=production node dist/src/app.js",
"prod": "cp production.env dist && NODE_ENV=production node dist/api.bundle.js",
"dev": "NODE_ENV=development nodemon src/app.ts",
"build:dev": "rimraf dist && tsc -p . && cp -r public dist",
"start": "NODE_ENV=production node dist/src/app.js",
"prod": "NODE_ENV=production node dist/api.bundle.js",
"dev": "NODE_ENV=production nodemon src/app.ts",
"build:dev": "rimraf dist && tsc -p . && cp -r public dist && cp production.env dist",
"build:prod": "rimraf dist && webpack",
"lint": "eslint . --ext .ts",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"bootstrap": "NODE_ENV=production ts-node src/bootstrapHypersignMaterial.ts"
},
"author": "Vishwas Anand Bhushan",
"license": "MIT",
Expand All @@ -20,6 +21,7 @@
"express": "^4.17.1",
"express-rate-limit": "^5.2.6",
"helmet": "^4.4.1",
"hs-ssi-sdk": "^5.0.1",
"hypersign-auth-js-sdk": "^2.0.4",
"mongoose": "^5.12.3",
"swagger-ui-express": "^4.1.6",
Expand Down
10 changes: 9 additions & 1 deletion public/deeplink.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,15 @@ <h2>Credential Issuance</h2>
const buttonhtml = `<a class="btn " href='${deeplink}' target='_blank'>Accept Credential in Mobile Wallet</a>`;
const buttonhtmlweb = `<a class="btn " href='${weblink}' target='_blank'>Accept Credential in Web Wallet</a>`;
$('.button').html(buttonhtml);
$('.button-web').html(buttonhtmlweb);
$('.button-web').html(`<a class="btn" href="#">Accept Credential in Web Wallet</a>`);
$('.button-web').click(function(){
window.open(
weblink,
"popUpWindow",
`height=800,width=400,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes`
);
});

$("#qrcode").qrcode({
"width": 200,
"height": 200,
Expand Down
Loading

0 comments on commit 21caead

Please sign in to comment.