A Next.js-based Solana devnet faucet with configurable rate limiting and Cloudflare protection.
- Rate Limiting: Configurable limits for airdrop requests
- Cloudflare Turnstile: Bot protection
- PostgreSQL: Request tracking and monitoring (currently disabled)
- Responsive UI: Built with Tailwind CSS and Radix UI
Note: GitHub authentication is currently disabled in the codebase. All auth-related code is commented out.
-
Install dependencies:
npm install
-
Configure environment variables:
cp .env.example .env.local
Fill in the required values:
# Server-side variables RPC_URL=your_solana_rpc_url FAUCET_KEYPAIR=your_faucet_keypair POSTGRES_STRING=your_postgres_connection_string CLOUDFLARE_SECRET=your_cloudflare_turnstile_secret IP_ALLOW_LIST=comma_separated_allowed_ips GITHUB_CLIENT_ID=your_github_oauth_client_id GITHUB_CLIENT_SECRET=your_github_oauth_client_secret # Public variables (exposed to client) NEXT_PUBLIC_DOMAIN=your_app_domain NEXT_PUBLIC_URL=your_app_url NEXT_PUBLIC_APP_NAME=your_app_name NEXT_PUBLIC_APP_DESCRIPTION=your_app_description NEXT_PUBLIC_RPC_URL=your_public_rpc_url NEXT_PUBLIC_TICKER=your_token_ticker -
Run the development server:
npm run dev
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
Default limits are configured in lib/constants.ts:
- Default users: 1 request per 6 hours, max 2000 tokens per request
Note: GitHub-based rate limiting is currently disabled. All users use the default limits.
POST /api/request- Request tokens from the faucet
Access the monitoring dashboard at /monitor to view recent requests and system status.