-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: SIWE React client/server example (#638)
* first commit for siwe-react-example * fix text in readme * delete no need files * fix return from signout * Update web3modal/wagmi version to be equal to web3modal/siwe Co-authored-by: Glitch <[email protected]> * run with fixed port Co-authored-by: Glitch <[email protected]> * fixed port from frontend * update lock file --------- Co-authored-by: Glitch <[email protected]>
- Loading branch information
1 parent
32319e1
commit 502ce08
Showing
19 changed files
with
12,876 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_PROJECT_ID=<your-project-id-from-cloud.walletconnect.com> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react-hooks/recommended', | ||
], | ||
ignorePatterns: ['dist', '.eslintrc.cjs'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['react-refresh'], | ||
rules: { | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
# Environment | ||
.env.local | ||
.env.development.local | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# SIWE Quickstart with WalletConnect | ||
|
||
A Minimal demo using React so developers can work on their integration with WalletConnect and SIWE using this repository as a template. | ||
|
||
1. Install dependencies in the frontend: `pnpm install` | ||
|
||
2. Create and complete the .env.local file with your Project Id from http://cloud.walletconnect.com | ||
|
||
``` | ||
VITE_PROJECT_ID=... | ||
``` | ||
|
||
3. Run the frontend: `pnpm run dev` | ||
|
||
4. Create a new console and install dependencies in the server | ||
|
||
``` | ||
cd server | ||
pnpm install | ||
``` | ||
|
||
5. Run the server: `pnpm start` | ||
|
||
6. Open in your browser http://localhost:5173/ | ||
(the frontend address must be the same that you have in the server cors config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>SIWE + WalletConnect (React)</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "appkit-siwe-react", | ||
"private": true, | ||
"version": "0.0.1", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite --port 5174", | ||
"build": "tsc -b && vite build", | ||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"@tanstack/react-query": "^5.51.1", | ||
"@wagmi/core": "^2.11.7", | ||
"@web3modal/siwe": "^5.0.6", | ||
"@web3modal/wagmi": "5.0.6", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"viem": "^2.17.3", | ||
"wagmi": "^2.10.10" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18.3.3", | ||
"@types/react-dom": "^18.3.0", | ||
"@typescript-eslint/eslint-plugin": "^7.13.1", | ||
"@typescript-eslint/parser": "^7.13.1", | ||
"@vitejs/plugin-react": "^4.3.1", | ||
"eslint": "^8.57.0", | ||
"eslint-plugin-react-hooks": "^4.6.2", | ||
"eslint-plugin-react-refresh": "^0.4.7", | ||
"typescript": "^5.2.2", | ||
"vite": "^5.3.3" | ||
} | ||
} |
Oops, something went wrong.