Skip to content

Commit e786bf3

Browse files
committed
🚀
0 parents  commit e786bf3

File tree

105 files changed

+12891
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+12891
-0
lines changed

‎.env.example

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Prisma
2+
# https://www.prisma.io/docs/reference/database-reference/connection-urls#env
3+
# https://vercel.com/docs/storage/vercel-postgres
4+
POSTGRES_URL=
5+
POSTGRES_PRISMA_URL=
6+
POSTGRES_URL_NON_POOLING=
7+
POSTGRES_USER="default"
8+
POSTGRES_HOST=
9+
POSTGRES_PASSWORD=
10+
POSTGRES_DATABASE="verceldb"
11+
12+
# Next Auth
13+
# You can generate a new secret on the command line with:
14+
# openssl rand -base64 32
15+
# https://next-auth.js.org/configuration/options#secret
16+
NEXTAUTH_SECRET="secret"
17+
18+
# Configure this with your domain on deployment - if locally use http://localhost:3000
19+
NEXTAUTH_URL="http://localhost:3000"
20+
21+
# Wagmi config (one of these: https://github.com/wevm/viem/blob/main/src/chains/index.ts)
22+
NEXT_PUBLIC_CHAIN_NAME=optimism
23+
24+
# What the message will say when you sign in with the wallet
25+
NEXT_PUBLIC_SIGN_STATEMENT=""
26+
27+
# How many votes each ballot can hold
28+
NEXT_PUBLIC_MAX_ALLOCATION_TOTAL=30000000
29+
# How many votes each project can receive
30+
NEXT_PUBLIC_MAX_ALLOCATION_PROJECT=5000000
31+
32+
NEXT_PUBLIC_VOTING_END_DATE=2024-01-01T00:00:00.000Z
33+
NEXT_PUBLIC_FEEDBACK_URL=https://example.com/feedback
34+
35+
36+
# EAS Schemas (defaults to schemas used in OP RetroPGF 3)
37+
NEXT_PUBLIC_APPROVED_APPLICATIONS_SCHEMA=0xebbf697d5d3ca4b53579917ffc3597fb8d1a85b8c6ca10ec10039709903b9277
38+
NEXT_PUBLIC_APPROVED_APPLICATIONS_ATTESTER=0x621477dBA416E12df7FF0d48E14c4D20DC85D7D9
39+
NEXT_PUBLIC_APPLICATIONS_SCHEMA=0x76e98cce95f3ba992c2ee25cef25f756495147608a3da3aa2e5ca43109fe77cc
40+
NEXT_PUBLIC_BADGEHOLDER_SCHEMA=0xfdcfdad2dbe7489e0ce56b260348b7f14e8365a8a325aef9834818c00d46b31b
41+
NEXT_PUBLIC_BADGEHOLDER_ATTESTER=0x621477dBA416E12df7FF0d48E14c4D20DC85D7D9
42+
NEXT_PUBLIC_PROFILE_SCHEMA=0xac4c92fc5c7babed88f78a917cdbcdc1c496a8f4ab2d5b2ec29402736b2cf929
43+
NEXT_PUBLIC_LISTS_SCHEMA=0x3e3e2172aebb902cf7aa6e1820809c5b469af139e7a4265442b1c22b97c6b2a5
44+
45+
# Used when creating attestations
46+
NEXT_PUBLIC_EAS_CONTRACT_ADDRESS=0x4200000000000000000000000000000000000021
47+
48+
# Only required for uploading metadata when creating lists, profiles, applications
49+
NEXT_PUBLIC_WEB3_STORAGE_API_KEY=
50+
51+
NEXT_PUBLIC_EASSCAN_URL=https://optimism.easscan.org/graphql
52+
NEXT_PUBLIC_WALLETCONNECT_ID=
53+
NEXT_PUBLIC_ALCHEMY_ID=
54+
55+
# Skip the badgeholder check
56+
NEXT_PUBLIC_SKIP_BADGEHOLDER_CHECK=true

‎.eslintrc.cjs

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
const config = {
3+
parser: "@typescript-eslint/parser",
4+
parserOptions: {
5+
project: true,
6+
},
7+
plugins: ["@typescript-eslint"],
8+
extends: [
9+
"plugin:@next/next/recommended",
10+
"plugin:@typescript-eslint/recommended-type-checked",
11+
"plugin:@typescript-eslint/stylistic-type-checked",
12+
],
13+
rules: {
14+
// These opinionated rules are enabled in stylistic-type-checked above.
15+
// Feel free to reconfigure them to your own preference.
16+
"@typescript-eslint/array-type": "off",
17+
"@typescript-eslint/consistent-type-definitions": "off",
18+
19+
"@typescript-eslint/consistent-type-imports": [
20+
"warn",
21+
{
22+
prefer: "type-imports",
23+
fixStyle: "inline-type-imports",
24+
},
25+
],
26+
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
27+
"@typescript-eslint/require-await": "off",
28+
"@typescript-eslint/no-misused-promises": [
29+
"error",
30+
{
31+
checksVoidReturn: { attributes: false },
32+
},
33+
],
34+
},
35+
};
36+
37+
module.exports = config;

‎.gitignore

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# database
12+
/prisma/db.sqlite
13+
/prisma/db.sqlite-journal
14+
15+
# next.js
16+
/.next/
17+
/out/
18+
next-env.d.ts
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# local env files
34+
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
35+
.env
36+
.env*.local
37+
38+
# vercel
39+
.vercel
40+
41+
# typescript
42+
*.tsbuildinfo

‎README.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# OpenRPGF
2+
3+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fcarlbarrdahl%2Fpokt-rpgf&env=POSTGRES_URL,POSTGRES_PRISMA_URL,POSTGRES_URL_NON_POOLING,POSTGRES_USER,POSTGRES_HOST,POSTGRES_PASSWORD,POSTGRES_DATABASE,NEXTAUTH_SECRET,NEXTAUTH_URL)
4+
5+
[Fork OpenRPGF](https://github.com/carlbarrdahl/pokt-rpgf/fork)
6+
7+
**TODO**
8+
9+
- Introduction text about this project
10+
- Screenshots
11+
- Deployment Loom video
12+
13+
### Deploying
14+
15+
#### 1. Create a Postgres database
16+
17+
https://vercel.com/dashboard/stores?type=postgres
18+
19+
#### 2. Configure the environment variables
20+
21+
https://vercel.com/dashboard
22+
23+
Navigate to your project and add the Environment variables found on the Settings tab
24+
25+
See `.env.example` for examples
26+
27+
#### 3. Configure theme and metadata
28+
29+
Edit `tailwind.config.ts` and `src/config.ts`
30+
31+
_You can edit files directly in GitHub by navigating to a file and clicking the Pen icon to the right._
32+
33+
### Development
34+
35+
```sh
36+
git clone https://github.com/carlbarrdahl/pokt-rpgf
37+
38+
bun install # (or pnpm / yarn / npm)
39+
40+
cp .env.example .env # and update .env variables
41+
42+
bun run dev
43+
44+
open localhost:3000
45+
```
46+
47+
### Features
48+
49+
### EAS Types
50+
51+
- **Badgeholders** - Determines who are allowed to vote
52+
- **Projects** - Registered projects
53+
- **Approved Projects** - Approved projects and shown in the UI
54+
- **Profiles** - Profile for projects and lists
55+
- **Lists** - Collection of projects with a recommendation of vote allocations
56+
57+
### Technical details
58+
59+
- **EAS** - Projects, lists, profiles, etc are all stored on-chain in Ethereum Attestation Service
60+
- **Batched requests with tRPC** - Multiple requests are batched into one (for example when the frontend requests the metadata for 24 projects they are batched into 1 request)
61+
- **Server-side caching of requests to EAS and IFPS** - Immediately returns the data without calling EAS of ipfs.
62+
- **SQL database for ballots** - Votes are stored privately in a Postgres database

‎bun.lockb

391 KB
Binary file not shown.

‎next.config.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
3+
* for Docker builds.
4+
*/
5+
await import("./src/env.js");
6+
7+
/** @type {import("next").NextConfig} */
8+
const config = {
9+
reactStrictMode: true,
10+
11+
eslint: {
12+
ignoreDuringBuilds: true,
13+
},
14+
typescript: {
15+
ignoreBuildErrors: true,
16+
},
17+
18+
/**
19+
* If you are using `appDir` then you must comment the below `i18n` config out.
20+
*
21+
* @see https://github.com/vercel/next.js/issues/41980
22+
*/
23+
i18n: {
24+
locales: ["en"],
25+
defaultLocale: "en",
26+
},
27+
};
28+
29+
export default config;

‎package.json

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"name": "open-rpgf",
3+
"version": "0.1.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"build": "next build",
8+
"db:push": "prisma db push",
9+
"db:studio": "prisma studio",
10+
"dev": "next dev",
11+
"postinstall": "prisma generate",
12+
"lint": "next lint",
13+
"start": "next start",
14+
"test": "vitest",
15+
"index": "npx tsx src/indexer/index.ts"
16+
},
17+
"dependencies": {
18+
"@hookform/resolvers": "^3.3.2",
19+
"@next-auth/prisma-adapter": "^1.0.7",
20+
"@prisma/client": "^5.7.1",
21+
"@radix-ui/react-dialog": "^1.0.5",
22+
"@rainbow-me/rainbowkit": "^1.3.1",
23+
"@rainbow-me/rainbowkit-siwe-next-auth": "^0.3.4",
24+
"@t3-oss/env-nextjs": "^0.7.1",
25+
"@tanstack/react-query": "^4.36.1",
26+
"@trpc/client": "^10.44.1",
27+
"@trpc/next": "^10.44.1",
28+
"@trpc/react-query": "^10.44.1",
29+
"@trpc/server": "^10.44.1",
30+
"clsx": "^2.0.0",
31+
"ethers": "^5.7.2",
32+
"graphql-request": "^6.1.0",
33+
"lucide-react": "^0.297.0",
34+
"next": "^14.0.4",
35+
"next-auth": "^4.24.5",
36+
"next-themes": "^0.2.1",
37+
"node-fetch-cache": "^3.1.3",
38+
"p-limit": "^5.0.0",
39+
"react": "18.2.0",
40+
"react-dom": "18.2.0",
41+
"react-hook-form": "^7.49.2",
42+
"react-icons": "^4.12.0",
43+
"react-markdown": "^9.0.1",
44+
"react-number-format": "^5.3.1",
45+
"react-use": "^17.4.2",
46+
"siwe": "^2.1.4",
47+
"superjson": "^2.2.1",
48+
"tailwind-variants": "^0.1.19",
49+
"viem": "^1.20.3",
50+
"wagmi": "^1.4.12",
51+
"zod": "3.22.4"
52+
},
53+
"devDependencies": {
54+
"@next/eslint-plugin-next": "^14.0.4",
55+
"@tailwindcss/typography": "^0.5.10",
56+
"@types/eslint": "^8.56.0",
57+
"@types/node": "^18.19.3",
58+
"@types/node-fetch-cache": "^3.0.4",
59+
"@types/react": "^18.2.45",
60+
"@types/react-dom": "^18.2.18",
61+
"@typescript-eslint/eslint-plugin": "^6.15.0",
62+
"@typescript-eslint/parser": "^6.15.0",
63+
"autoprefixer": "^10.4.16",
64+
"dotenv": "^16.3.1",
65+
"eslint": "^8.56.0",
66+
"ky": "^1.1.3",
67+
"msw": "^2.0.11",
68+
"postcss": "^8.4.32",
69+
"prettier": "^3.1.1",
70+
"prettier-plugin-tailwindcss": "^0.5.9",
71+
"prisma": "^5.7.1",
72+
"tailwindcss": "^3.4.0",
73+
"typescript": "^5.3.3",
74+
"vite": "^5.0.10",
75+
"vitest": "^1.1.0",
76+
"vitest-mock-extended": "^1.3.1"
77+
},
78+
"ct3aMetadata": {
79+
"initVersion": "7.24.1"
80+
}
81+
}

0 commit comments

Comments
 (0)