Skip to content

Commit d513338

Browse files
authored
Merge pull request #57 from Peersyst/account-verifier
[account-verifier] feat: setup
2 parents c8f0dc1 + 9e3ca1a commit d513338

40 files changed

+2065
-20
lines changed

apps/account-verifier/.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
VITE_RELAYER_PRIVATE_KEY=""
2+
VITE_RELAYER_ACCOUNT_ID=""
3+
VITE_APP_ORIGIN="http://localhost:3000"
4+

apps/account-verifier/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

apps/account-verifier/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# React + TypeScript + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## Expanding the ESLint configuration
11+
12+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13+
14+
```js
15+
export default tseslint.config({
16+
extends: [
17+
// Remove ...tseslint.configs.recommended and replace with this
18+
...tseslint.configs.recommendedTypeChecked,
19+
// Alternatively, use this for stricter rules
20+
...tseslint.configs.strictTypeChecked,
21+
// Optionally, add this for stylistic rules
22+
...tseslint.configs.stylisticTypeChecked,
23+
],
24+
languageOptions: {
25+
// other options...
26+
parserOptions: {
27+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
28+
tsconfigRootDir: import.meta.dirname,
29+
},
30+
},
31+
})
32+
```
33+
34+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
35+
36+
```js
37+
// eslint.config.js
38+
import reactX from 'eslint-plugin-react-x'
39+
import reactDom from 'eslint-plugin-react-dom'
40+
41+
export default tseslint.config({
42+
plugins: {
43+
// Add the react-x and react-dom plugins
44+
'react-x': reactX,
45+
'react-dom': reactDom,
46+
},
47+
rules: {
48+
// other rules...
49+
// Enable its recommended typescript rules
50+
...reactX.configs['recommended-typescript'].rules,
51+
...reactDom.configs.recommended.rules,
52+
},
53+
})
54+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
)

apps/account-verifier/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React + TS</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

apps/account-verifier/package.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "account-verifier",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc -b && vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"@fast-auth/browser-sdk": "workspace:*",
13+
"@fast-auth/javascript-provider": "workspace:*",
14+
"@noble/hashes": "^1.8.0",
15+
"@scure/base": "^1.2.6",
16+
"bignumber.js": "^9.2.1",
17+
"buffer": "^6.0.3",
18+
"elliptic": "^6.6.1",
19+
"history": "5.3.0",
20+
"jose": "^6.0.11",
21+
"near-api-js": "^5.1.1",
22+
"react": "19.2.0",
23+
"react-dom": "19.2.0",
24+
"react-router-dom": "^7.5.0"
25+
},
26+
"devDependencies": {
27+
"@eslint/js": "^9.22.0",
28+
"@types/elliptic": "^6.4.18",
29+
"@types/react": "^19.0.10",
30+
"@types/react-dom": "^19.0.4",
31+
"@vitejs/plugin-react": "^4.3.4",
32+
"eslint": "^8.26.1",
33+
"eslint-plugin-react-hooks": "^5.2.0",
34+
"eslint-plugin-react-refresh": "^0.4.19",
35+
"globals": "^16.0.0",
36+
"typescript": "~5.7.2",
37+
"typescript-eslint": "^8.26.1",
38+
"vite": "^6.3.0",
39+
"vite-plugin-node-polyfills": "^0.24.0"
40+
},
41+
"exports": {
42+
".": "./src/index.ts"
43+
}
44+
}
Lines changed: 1 addition & 0 deletions
Loading

apps/account-verifier/src/App.css

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#root {
2+
max-width: 1280px;
3+
margin: 0 auto;
4+
padding: 2rem;
5+
text-align: center;
6+
}
7+
8+
.logo {
9+
height: 6em;
10+
padding: 1.5em;
11+
will-change: filter;
12+
transition: filter 300ms;
13+
}
14+
.logo:hover {
15+
filter: drop-shadow(0 0 2em #646cffaa);
16+
}
17+
.logo.react:hover {
18+
filter: drop-shadow(0 0 2em #61dafbaa);
19+
}
20+
21+
@keyframes logo-spin {
22+
from {
23+
transform: rotate(0deg);
24+
}
25+
to {
26+
transform: rotate(360deg);
27+
}
28+
}
29+
30+
@media (prefers-reduced-motion: no-preference) {
31+
a:nth-of-type(2) .logo {
32+
animation: logo-spin infinite 20s linear;
33+
}
34+
}
35+
36+
.card {
37+
padding: 2em;
38+
}
39+
40+
.read-the-docs {
41+
color: #888;
42+
}
43+
44+
.app {
45+
text-align: left;
46+
}
47+
48+
nav {
49+
margin-bottom: 2rem;
50+
padding-bottom: 1rem;
51+
border-bottom: 1px solid #eee;
52+
}
53+
54+
nav ul {
55+
list-style: none;
56+
padding: 0;
57+
display: flex;
58+
gap: 1rem;
59+
}
60+
61+
nav a {
62+
color: #646cff;
63+
text-decoration: none;
64+
font-weight: 500;
65+
}
66+
67+
nav a:hover,
68+
nav a.active {
69+
color: #535bf2;
70+
text-decoration: underline;
71+
}
72+
73+
.page-container {
74+
padding: 1rem;
75+
}

apps/account-verifier/src/App.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
2+
import Home from "./pages/Home";
3+
import "./App.css";
4+
5+
function App() {
6+
return (
7+
<Router>
8+
<div className="app">
9+
<Routes>
10+
<Route path="/" element={<Home />} />
11+
</Routes>
12+
</div>
13+
</Router>
14+
);
15+
}
16+
17+
export default App;
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)