A decentralized exchange with World ID authentication.
Local Development - Given Vercel is down, local lets you play with UI, but with no auth (auth requires callbacks to Vercel)
- Install dependencies:
pnpm install
- Copy
.env.example
to.env
:
cp .env.example .env
- Run development server:
pnpm run dev
- Visit
http://localhost:3000/login
- Production URL: https://worldchain-one.vercel.app
- World ID Callback URL: https://worldchain-one.vercel.app/api/auth/callback/worldcoin
- Go to your Vercel Project Settings > Environment Variables
- Add the following environment variables:
# Authentication (Required)
NEXTAUTH_URL=https://worldchain-one.vercel.app
NEXTAUTH_SECRET=0fjDAH3SRQM+jzbdAT2uLp4K7DxGUD8unbtopbSTvmw=
# World ID OAuth
WLD_CLIENT_ID=app_2a124e9650db276b1a861f7ab9891763
WLD_CLIENT_SECRET=sk_8a1fb67ed99ec6195d9b42713dc3953e99764cb65b48c45f
# Public Variables
NEXT_PUBLIC_APP_ID=app_2a124e9650db276b1a861f7ab9891763
NEXT_PUBLIC_ACTION="test-action"
NEXT_PUBLIC_WALLETCONNECT_ID=67230c935989bb6922b0ee8f53bf9441
NEXT_PUBLIC_CONTRACT_ADDRESS=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
NEXT_PUBLIC_ALCHEMY_RPC_URL=https://worldchain-sepolia.g.alchemy.com/v2/dHgmedS39psbe_tuXLRsdUSupfWi85Rj
- Go to World ID Developer Portal
- Navigate to your app settings
- Add the following redirect URI:
https://worldchain-one.vercel.app/api/auth/callback/worldcoin
After deploying to Vercel, verify the following:
-
Authentication Flow:
- Visit https://worldchain-one.vercel.app
- Click "Sign in with World ID"
- Complete verification process
- Check redirect back to app
-
Environment Variables:
- Verify NEXTAUTH_SECRET is set
- Check World ID credentials
- Confirm callback URLs
-
Features:
- World ID Authentication
- MetaMask Integration
- Contract Interactions
- Protected Routes
- Next.js 13
- TypeScript
- NextAuth.js
- World ID
- Wagmi
- ConnectKit
- TailwindCSS
- Foundry (Smart Contracts)
├── contracts/ # Smart contracts
├── public/ # Static assets
├── src/
│ ├── abi/ # Contract ABIs
│ ├── lib/ # Shared utilities
│ ├── pages/ # Next.js pages
│ ├── styles/ # Global styles
│ └── types/ # TypeScript types
├── .env.example # Environment variables template
├── next.config.js # Next.js configuration
├── vercel.json # Vercel deployment configuration
└── tsconfig.json # TypeScript configuration
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_URL=https://worldchain-one.vercel.app
-
Authentication Issues:
- Verify NEXTAUTH_SECRET is set in Vercel
- Check World ID redirect URIs
- Confirm environment variables
-
Build Errors:
- Check Vercel build logs
- Verify all dependencies are installed
- Confirm environment variables are set
-
Contract Interactions:
- Verify contract address
- Check Alchemy RPC URL
- Confirm MetaMask connection
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License.