-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POAP Dashboard App (Milestones 1-4) #2
Merged
Merged
Changes from 133 commits
Commits
Show all changes
135 commits
Select commit
Hold shift + click to select a range
1a69749
import project
rikublock ab33866
add setup steps to readme
rikublock e18c927
add event overview, event details page
rikublock f1a6db6
add webpack
rikublock 25a9eef
fix dev server routing
rikublock 2b1e71e
add wallet providers
rikublock 32ba19c
implement event sign up
rikublock 6485cb0
remove old routes
rikublock 5f48257
add profile dialog
rikublock 816e2bf
disable close button while loading
rikublock 9397781
improve profile dialog
rikublock d8a891e
tweak join dialog
rikublock a4f7a8f
add prettier config
rikublock 8cd47fb
rework mint dialog
rikublock 211bc94
mint dialog clean up
rikublock b2156cf
add connectivity status
rikublock 03dabab
fix dev server config
rikublock d4c47e5
cumulative update
rikublock e2b153c
update gem provider
rikublock 3936b3a
add authentication
rikublock d7fdcea
rework EventTable
rikublock 1e831af
add updated API endpoints
rikublock a7fbb5f
add disabled to mint dialog checkbox
rikublock d41028b
add content wrapper
rikublock cf04923
prepare for api 2.0
rikublock 924917f
update readme for API 2.0
rikublock 623684a
limit add participants to at most 20 entries
rikublock b7eace9
add permissions state to auth context
rikublock a0c6d80
check permissions on pages
rikublock a86f0f6
make network status indicator non clickable
rikublock db66142
clean up event info page
rikublock b7cff65
add link to event info
rikublock ba500d7
snackbar tweaks
rikublock 140f688
implement join api changes
rikublock e190ee6
update types
rikublock 8871464
add stack for secondary button spacing
rikublock 3eb7b0a
add get slots api
rikublock ca3a283
display available slots
rikublock 4ae0b21
add event status to data table
rikublock df08972
fix offer index typing
rikublock f683a2e
style table depending on event expiration
rikublock 871dfc2
add user wallet address auto complete options
rikublock 3fd6d07
add debug page
rikublock 0815276
clean up dialog set data
rikublock a223760
make loader text customizable
rikublock 5f298e4
add get event link api
rikublock 0dad78d
add create link dialog
rikublock d58e075
set default event creation type to public
rikublock 2102809
fix comment typo
rikublock aefbacd
add admin page template
rikublock ccdbec7
add authorized minter api
rikublock 5e8ccd8
add new admin routes
rikublock a6d31c7
rework providers to support new event minting flows
rikublock a06f928
add admin stats page template
rikublock 51e6bfb
[tmp] claim workflow
rikublock d1d0673
[tmp] claim workflow 2
rikublock 4c742b7
rework /events API
rikublock 2a64ab4
add admin event list
rikublock 82baea7
update API
rikublock 4d92566
update /users API
rikublock 27615f6
update admin users page
rikublock 05ff5e6
rename mint -> create dialog
rikublock 305a102
update admin pages
rikublock eb3b51f
backup new create dialog
rikublock f573c91
fix provider
rikublock f3e1ad7
update types
rikublock 8d04ce2
add login flow switch
rikublock 64e01dd
remove user based event slots
rikublock 6535929
add eventId to create dialog state
rikublock 3a0cbb4
add basic event card template
rikublock a20f5d5
add payment API
rikublock 37ef584
add event cancel API
rikublock 08f8fe9
add info box
rikublock 92bd051
update connector to return txhash
rikublock d1d633d
basic working create flow
rikublock 1908855
add cancel dialog
rikublock 3ad71a8
complete create dialog
rikublock c77fa83
rework link dialog to re-use step
rikublock 5532213
update event card
rikublock f9bfc7a
disable debug mode
rikublock 9555b98
[wip] rework claim page
rikublock acd1a84
update layouts
rikublock f8928d9
add return_url if on mobile
rikublock 9ccb181
rename menu entry to dashboard
rikublock 8c7ca1c
change to local storage for xumm sdk
rikublock 6ddd9f0
working claim setup
rikublock fc5ee80
add status, deposit amount row to event table
rikublock fa4ef70
remove attendee page
rikublock 490968b
simplify content wrapper
rikublock dd2d5db
rework event info page
rikublock db91340
fix tooltip
rikublock 85cca27
rework welcome page
rikublock 99337a5
improve claim setup
rikublock 129b3e8
remove obsolete logging
rikublock 95fbec3
redirect when successfully connecting a wallet
rikublock 2b7c4e6
capitalize readme bullets
rikublock ad825fb
prompt user to look at their wallet
rikublock 9e28efc
display message when there are no events
rikublock 86e2bdf
add debug clear storage
rikublock a4a50e2
rework home page
rikublock 36f6863
add back button component
rikublock d0fe490
add offset prop
rikublock 8998495
disable obsolete actions
rikublock 01dca31
rework admin pages
rikublock d4249dd
add debug button to revoke authorized minter
rikublock 6459cd1
add footer
rikublock 316cd0a
add warning for low vault account balance
rikublock 14dd950
make image optional during event creation
rikublock 6499100
rename xumm -> xaman
rikublock a752c52
minor UI tweaks
rikublock 544b04d
display deposit amount on event cards
rikublock f20f429
rework event info page
rikublock 21bd3df
fix close dialog after disconnecting wallet
rikublock 91b57be
add event share and cancel button to event info page
rikublock adc605c
adjust axios timeout for event API
rikublock 6e6d271
show available event slots to any user
rikublock 64df3ed
move content box component
rikublock 05370c6
display NFT id on claim page
rikublock b85e91e
add event info page for mobile
rikublock 98cef1e
enable filter menu in data tables
rikublock ce21537
list event owner address in admin event overview
rikublock 2b74171
redirect after login depending on permissions
rikublock ceb6b64
require event end date to be in the future
rikublock dda317d
adjust app version
rikublock 3c3f115
display wallet address after NFT claim
rikublock 2b7ee01
add NFT ownership verification API
rikublock 3c0259a
add NFT ownership verification page
rikublock 9a291a2
clean up comments
rikublock f1b11e1
add content box labels
rikublock 22aa432
only redirect during regular login
rikublock 1311bf8
lazy mount add dialog
rikublock 555fac4
add verify nft icon to event page
rikublock b212caa
add verify ownership note
rikublock 8ba6a44
restore lost license file
rikublock d0a03ca
code clean up
rikublock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,2 @@ | ||
REACT_APP_URL_POAP_API="http://localhost:4000/" | ||
REACT_APP_KEY_XUMM_API="" |
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,24 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
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,4 @@ | ||
tabWidth: 2 | ||
semi: true | ||
singleQuote: false | ||
printWidth: 80 |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,2 +1,51 @@ | ||
# POAP-APP | ||
The web app for Proof of Attendance Protocol | ||
# POAP APP | ||
|
||
The web app for Proof of Attendance Protocol | ||
|
||
## Requirements | ||
- Node.js `v18.16.0+` | ||
- Yarn `v1.22.19+` | ||
- Running POAP API 2.0 server (backend), for details see [here](https://github.com/rikublock/POAP-API2) | ||
|
||
## Getting Started | ||
- Install dependencies with `yarn install` | ||
- Rename `.env.example` to `.env` (change values as needed) | ||
- `REACT_APP_URL_POAP_API` (backend server URL) | ||
- `REACT_APP_KEY_XUMM_API` (Xumm App API key, needs to match the key configured in the backend) | ||
- Ensure the backend service is running | ||
- Run the app with `yarn start` | ||
|
||
## Available Scripts | ||
|
||
In the project directory, you can run: | ||
|
||
### `yarn install` | ||
|
||
Install dependencies. | ||
|
||
### `yarn start` | ||
|
||
Runs the app in the development mode.\ | ||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. | ||
|
||
The page will reload if you make edits.\ | ||
You will also see any lint errors in the console. | ||
|
||
### `yarn test` | ||
|
||
Launches the test runner in the interactive watch mode.\ | ||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. | ||
|
||
### `yarn build` | ||
|
||
Builds the app for production to the `build` folder.\ | ||
It correctly bundles React in production mode and optimizes the build for the best performance. | ||
|
||
The build is minified and the filenames include the hashes.\ | ||
Your app is ready to be deployed! | ||
|
||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. | ||
|
||
## Supported Wallets | ||
- Xumm (installation details [here](https://xumm.app/)) | ||
- GemWallet (installation details [here](https://gemwallet.app/)) |
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,11 @@ | ||
declare module "*.svg" { | ||
import * as React from "react"; | ||
|
||
const content: React.FunctionComponent<React.SVGAttributes<SVGElement>>; | ||
export default content; | ||
} | ||
|
||
declare module "*.svg?url" { | ||
const content: string; | ||
export default content; | ||
} |
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,90 @@ | ||
{ | ||
"name": "poap-app", | ||
"version": "1.0.0", | ||
"description": "Dashboard for the Proof of Attendance Protocol", | ||
"author": "Riku Block", | ||
"private": true, | ||
"dependencies": { | ||
"@ant-design/colors": "^7.0.0", | ||
"@ant-design/icons": "^5.1.4", | ||
"@emotion/react": "^11.11.0", | ||
"@emotion/styled": "^11.11.0", | ||
"@fortawesome/fontawesome-svg-core": "^6.4.2", | ||
"@fortawesome/free-brands-svg-icons": "^6.4.2", | ||
"@fortawesome/react-fontawesome": "^0.2.0", | ||
"@gemwallet/api": "^3.4.0", | ||
"@hookform/resolvers": "^3.1.1", | ||
"@mui/icons-material": "^5.11.16", | ||
"@mui/lab": "^5.0.0-alpha.134", | ||
"@mui/material": "^5.13.2", | ||
"@mui/x-data-grid": "^6.7.0", | ||
"@mui/x-date-pickers": "^6.8.0", | ||
"apexcharts": "^3.42.0", | ||
"axios": "^1.4.0", | ||
"date-fns": "^2.30.0", | ||
"file-saver": "^2.0.5", | ||
"jotai": "^2.1.0", | ||
"notistack": "^3.0.1", | ||
"qrcode.react": "^3.1.0", | ||
"react": "^18.2.0", | ||
"react-apexcharts": "^1.4.1", | ||
"react-copy-to-clipboard": "^5.1.0", | ||
"react-device-detect": "^2.2.3", | ||
"react-dom": "^18.2.0", | ||
"react-hook-form": "^7.45.0", | ||
"react-jwt": "^1.2.0", | ||
"react-router-dom": "^6.11.2", | ||
"react-scripts": "5.0.1", | ||
"react-window": "^1.8.9", | ||
"web-vitals": "^2.1.0", | ||
"xrpl": "^2.11.0", | ||
"xumm": "^1.6.1", | ||
"zod": "^3.21.4", | ||
"zustand": "^4.3.8" | ||
}, | ||
"scripts": { | ||
"start": "webpack serve --mode development", | ||
"build": "webpack --mode production" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"react-app", | ||
"react-app/jest" | ||
] | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@svgr/webpack": "^8.1.0", | ||
"@testing-library/jest-dom": "^5.14.1", | ||
"@testing-library/react": "^13.0.0", | ||
"@testing-library/user-event": "^13.2.1", | ||
"@types/file-saver": "^2.0.5", | ||
"@types/jest": "^27.0.1", | ||
"@types/node": "^16.7.13", | ||
"@types/react": "^18.0.0", | ||
"@types/react-copy-to-clipboard": "^5.0.4", | ||
"@types/react-dom": "^18.0.0", | ||
"@types/react-window": "^1.8.5", | ||
"dotenv-webpack": "^8.0.1", | ||
"esbuild-loader": "^3.0.1", | ||
"html-webpack-plugin": "^5.5.3", | ||
"node-polyfill-webpack-plugin": "^2.0.1", | ||
"ts-loader": "^9.4.3", | ||
"tsconfig-paths-webpack-plugin": "^4.0.1", | ||
"typescript": "^5.1.3", | ||
"webpack": "^5.87.0", | ||
"webpack-cli": "^5.1.4", | ||
"webpack-dev-server": "^4.15.1" | ||
} | ||
} |
Binary file not shown.
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,28 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta | ||
name="description" | ||
content="Dashboard for the Proof of Attendance Protocol" | ||
/> | ||
<title>POAP Dashboard</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
<!-- | ||
This HTML file is a template. | ||
If you open it directly in the browser, you will see an empty page. | ||
|
||
You can add webfonts, meta tags, or analytics to this file. | ||
The build step will place the bundled scripts into the <body> tag. | ||
|
||
To begin the development, run `npm start` or `yarn start`. | ||
To create a production bundle, use `npm run build` or `yarn build`. | ||
--> | ||
</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,7 @@ | ||
import React from "react"; | ||
import { render, screen } from "@testing-library/react"; | ||
import App from "./App"; | ||
|
||
test("nothing", () => { | ||
render(<App />); | ||
}); |
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,43 @@ | ||
import { BrowserRouter } from "react-router-dom"; | ||
import { Provider as JotaiProvider } from "jotai"; | ||
import { SnackbarProvider } from "notistack"; | ||
|
||
import { createTheme, ThemeProvider } from "@mui/material/styles"; | ||
import { CssBaseline } from "@mui/material"; | ||
import Slide from "@mui/material/Slide"; | ||
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider"; | ||
import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFns"; | ||
|
||
import Routes from "routes"; | ||
import { Web3Provider } from "connectors/context"; | ||
import { AuthProvider } from "components/AuthContext"; | ||
|
||
function App() { | ||
const theme = createTheme(); | ||
|
||
return ( | ||
<BrowserRouter> | ||
<JotaiProvider> | ||
<Web3Provider> | ||
<AuthProvider> | ||
<ThemeProvider theme={theme}> | ||
<SnackbarProvider | ||
autoHideDuration={10000} | ||
anchorOrigin={{ vertical: "top", horizontal: "right" }} | ||
TransitionComponent={Slide} | ||
maxSnack={3} | ||
> | ||
<LocalizationProvider dateAdapter={AdapterDateFns}> | ||
<CssBaseline /> | ||
<Routes /> | ||
</LocalizationProvider> | ||
</SnackbarProvider> | ||
</ThemeProvider> | ||
</AuthProvider> | ||
</Web3Provider> | ||
</JotaiProvider> | ||
</BrowserRouter> | ||
); | ||
} | ||
|
||
export default App; |
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,27 @@ | ||
import axios from "axios"; | ||
import config from "config"; | ||
|
||
import type { NetworkIdentifier, PlatformStats } from "types"; | ||
|
||
export type getStatsParams = { | ||
networkId: NetworkIdentifier; | ||
}; | ||
|
||
export const getStats = async ( | ||
jwt: string, | ||
params: getStatsParams | ||
): Promise<PlatformStats> => { | ||
const response = await axios.get( | ||
new URL("/admin/stats", config.apiURL).toString(), | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${jwt}`, | ||
}, | ||
responseType: "json", | ||
timeout: config.timeout, | ||
params: params, | ||
} | ||
); | ||
|
||
return response.data.result as PlatformStats; | ||
}; |
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,72 @@ | ||
import axios from "axios"; | ||
import config from "config"; | ||
|
||
import { WalletType } from "types"; | ||
|
||
export const heartbeat = async (): Promise<boolean> => { | ||
const response = await axios.get( | ||
new URL("/auth/heartbeat", config.apiURL).toString(), | ||
{ | ||
responseType: "json", | ||
timeout: config.timeout, | ||
} | ||
); | ||
|
||
return response.data.result as boolean; | ||
}; | ||
|
||
export type nonceData = { | ||
pubkey: string; | ||
}; | ||
|
||
export const nonce = async (data: nonceData): Promise<string> => { | ||
const response = await axios.post( | ||
new URL("/auth/nonce", config.apiURL).toString(), | ||
data, | ||
{ | ||
responseType: "json", | ||
timeout: config.timeout, | ||
} | ||
); | ||
|
||
return response.data.result as string; | ||
}; | ||
|
||
export type loginData = { | ||
walletAddress: string; | ||
walletType: WalletType; | ||
data: string; | ||
signature?: string; | ||
claimFlow: boolean; | ||
}; | ||
|
||
export const login = async (data: loginData): Promise<string> => { | ||
const response = await axios.post( | ||
new URL("/auth/login", config.apiURL).toString(), | ||
data, | ||
{ | ||
responseType: "json", | ||
timeout: config.timeout, | ||
} | ||
); | ||
|
||
return response.data.result as string; | ||
}; | ||
|
||
export type refreshResult = string | null; | ||
|
||
export const refresh = async (jwt: string): Promise<refreshResult> => { | ||
const response = await axios.post( | ||
new URL("/auth/refresh", config.apiURL).toString(), | ||
{}, | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${jwt}`, | ||
}, | ||
responseType: "json", | ||
timeout: config.timeout, | ||
} | ||
); | ||
|
||
return response.data.result as refreshResult; | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Xumm is rebranding as
Xaman
so maybe it'd be good to rename them in this project? (With a note like "Xaman, formerly named Xumm, ..."