A comprehensive Web3 missions application where users complete tasks to earn XP and ZeryT tokens. Built on Next.js 16 with Supabase.
Status: β Production-Ready (v1.0 - Last Audited: 2025-02-24)
Start here: ZERYTASK_REFERENCE.md - Central reference guide
- Complete project structure
- API endpoints
- Main workflows
- Debugging guide
Full Audit: COMPREHENSIVE_AUDIT_2025.md - Detailed analysis
- Database analysis
- API route audit
- Security review
- Recommendations
- Email/Password Registration - Simple signup without email verification
- User Dashboard - View missions, XP progress, and ZeryT balance
- Mission Completion - Complete various missions (Social, On-chain, Manual) to earn rewards
- User Profile - Manage account details, wallet address, X/Twitter handle
- Exchange System - Exchange ZeryT to USDC with admin-configurable rates
- Referral Program - Earn rewards by referring friends with customizable criteria
- Admin Dashboard - Overview of platform metrics and recent activity
- Mission Management - Create, edit, and delete missions with configurable rewards
- Exchange Management - Configure ZeryT to USDC exchange rates and minimum withdrawal amounts
- User Management - View all users and their statistics
- Exchange Requests - Process and mark exchange requests as paid
- Referral Configuration - Set referral rewards and requirements
- Statistics - Track user growth, active missions, pending exchanges, and economy health
- Frontend: Next.js 16, React, TypeScript, Tailwind CSS
- Backend: Next.js API Routes, Node.js
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth (Email/Password)
id- Primary keyuser_id- Supabase auth user IDemail- User emailusername- Display usernamexp- Experience pointszeryt- ZeryT token balancelevel- User levelrank- User rankwallet_address- Crypto wallet addresstwitter_handle- X/Twitter handleavatar_url- Profile avatar URLreferral_code- Unique referral codereferrer_id- ID of referring usercreated_at- Account creation timestamp
id- Primary keytitle- Mission namedescription- Mission detailscategory- Mission type (social, on-chain, manual)xp_reward- XP earned on completionzeryt_reward- ZeryT earned on completionverification_method- How mission is verifiedactive- Whether mission is activecreated_at- Creation timestamp
id- Primary keyuser_id- User making the requestzeryt_amount- Amount of ZeryT to exchangeusdc_amount- Equivalent USDC amountwallet_address- Wallet to receive USDCstatus- Request status (pending, paid, rejected)created_at- Request creation timestamppaid_at- When admin marked as paid
id- Primary keyreferrer_id- User who referredreferred_user_id- User who was referredstatus- Referral status (pending, active, claimed)created_at- Referral creation timestamp
id- Global config IDzeryt_to_usdc_rate- Exchange ratemin_withdrawal_amount- Minimum ZeryT to exchange
id- Global config IDxp_reward- XP per successful referralzeryt_reward- ZeryT per successful referralusdc_reward- USDC per successful referralmin_level_requirement- Minimum level to qualifymin_missions_requirement- Minimum missions to completemultiplier- Reward multiplier
-
Clone the repository
git clone <repository-url> cd zeryt-missions
-
Install dependencies
npm install
-
Setup Supabase
- Create a Supabase project at supabase.com
- Run the database migration:
/scripts/init_database.sql - Add Supabase environment variables
-
Environment Variables
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key NEXT_PUBLIC_DEV_SUPABASE_REDIRECT_URL=http://localhost:3000 -
Run development server
npm run dev
-
Access the application
- User app: http://localhost:3000
- Admin access: remgoficial@gmail.com
POST /api/auth/signup- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logout
GET /api/users/me- Get current user profilePATCH /api/users/me/update- Update user profile
GET /api/missions- Get available missionsGET /api/admin/missions- Get all missions (admin)POST /api/admin/missions/create- Create new mission
GET /api/exchange/config- Get exchange configurationPOST /api/exchange/request- Request exchangeGET /api/exchange/request- Get user's exchange requestsGET /api/admin/exchange-requests- Get all exchange requestsPOST /api/admin/exchange-config- Update exchange configPOST /api/admin/exchange-requests/[id]/pay- Mark exchange as paid
GET /api/referrals/config- Get referral configurationGET /api/referrals/my-referrals- Get user's referralsPOST /api/admin/referrals-config- Update referral config
GET /api/admin/stats- Get dashboard statisticsGET /api/admin/activity- Get recent activityGET /api/admin/users- Get all users
/- Home/Dashboard/missions- Browse missions/exchange- ZeryT to USDC exchange/referrals- Referral program/profile- User account management/auth/signup- Registration/auth/login- Login
/admin- Admin dashboard/admin/missions- Mission management/admin/missions/create- Create new mission/admin/requests- Exchange request management/admin/users- User management/admin/referrals- Referral configuration
- Email: remgoficial@gmail.com
- Access the app with this email to access admin features
- Social - Twitter/X tasks, Discord tasks, etc.
- On-chain - Blockchain-based tasks
- Manual - Tasks requiring manual verification
- User initiates exchange request with minimum amount check
- Request appears in admin panel as "Pending"
- Admin marks as "Paid" once transaction is processed
- User has 1-3 business days to mark complete
- Exchange is moved to "Paid" status
Update in /app/page.tsx, /app/admin/**/*.tsx files:
if (user?.email === 'your-email@example.com') {
setIsAdmin(true)
}Navigate to Admin Controls β Exchange Configuration
Navigate to Admin β Referral Configuration
Deploy to Vercel for best Next.js support:
vercel deploySet environment variables in Vercel dashboard before deployment.