Skip to content

Commit 3dd5def

Browse files
authored
Initial commit
0 parents  commit 3dd5def

39 files changed

Lines changed: 5430 additions & 0 deletions

.github/workflows/relyance-sci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Relyance SCI Scan
2+
3+
on:
4+
schedule:
5+
- cron: "0 20 * * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
execute-relyance-sci:
10+
name: Relyance SCI Job
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Pull and run SCI binary
18+
run: |-
19+
docker pull gcr.io/relyance-ext/compliance_inspector:release && \
20+
docker run --rm -v `pwd`:/repo --env API_KEY='${{ secrets.DPP_SCI_KEY }}' gcr.io/relyance-ext/compliance_inspector:release

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.17.0

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# React example of minikit
2+
3+
Apart from a frontend, you'll need a backend, this template contains an example of that as well
4+
5+
## To run, install:
6+
7+
- deps, `cd frontend;pnpm i;cd -;cd backend;pnpm i`
8+
- ngrok - Create a free ngrok account, follow the official [docs](https://ngrok.com/docs/getting-started/)
9+
- nginx - use you favorite package manager :)
10+
11+
### nginx setup
12+
13+
To serve multiple localhost applications through a single ngrok tunnel (only one available for free-tier users), you can use nginx as a reverse proxy. Follow the steps below to set it up:
14+
15+
### Run nginx
16+
17+
Use the config provided in the root of this repo
18+
`sudo nginx -c full/path/to/this/repo/nginx.conf`
19+
or, if you run the command from the root dir
20+
`sudo nginx -c $(pwd)/nginx.conf`
21+
22+
To stop nginx run `sudo nginx -s stop`
23+
24+
### Tunnel through Ngrok
25+
26+
`ngrok http 8080`
27+
The port doesn't matter, make sure it's the `listen` one from nginx config

backend/.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
WLD_CLIENT_ID=
2+
WLD_CLIENT_SECRET=
3+
# needed by authjs, use `openssl rand -base64 32` to generate
4+
AUTH_SECRET=

backend/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
3+
.env

backend/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.17.0

backend/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### To get started, start the server
2+
3+
`pnpm run dev`

backend/index.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import express from "express";
2+
3+
import { verifyHandler } from "./src/verify";
4+
import { initiatePaymentHandler } from "./src/initiate-payment";
5+
import { confirmPaymentHandler } from "./src/confirm-payment";
6+
import cors from "cors";
7+
8+
const app = express();
9+
10+
// trust the proxy to allow HTTPS protocol to be detected
11+
// https://expressjs.com/en/guide/behind-proxies.html
12+
app.set("trust proxy", true);
13+
// allow cors
14+
app.use(cors());
15+
// json middleware
16+
app.use(express.json());
17+
app.use(express.urlencoded({ extended: true }));
18+
19+
// request logger middleware
20+
app.use((req, _res, next) => {
21+
console.log(`logger: ${req.method} ${req.url}`);
22+
next();
23+
});
24+
25+
app.get("/ping", (_, res) => {
26+
res.send("minikit-example pong v1");
27+
});
28+
29+
// protected routes
30+
app.post("/verify", verifyHandler);
31+
app.post("/initiate-payment", initiatePaymentHandler);
32+
app.post("/confirm-payment", confirmPaymentHandler);
33+
34+
const port = 3000; // use env var
35+
app.listen(port, () => {
36+
console.log(`Example app listening on port ${port}`);
37+
});

backend/nodemon.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"watch": ["./src/**/*.ts", "./index.ts"],
3+
"ext": "ts",
4+
"exec": "ts-node ./index.ts"
5+
}

0 commit comments

Comments
 (0)