How cloudmaker97/discord-captcha-verification works
Project type and purpose
• This is a Node.js–based full-stack microservice application whose primary function is to provide Discord user verification via a Cloudflare Turnstile captcha.
• It consists of a Discord bot, a lightweight web server hosting the captcha flow, an event-driven communication layer, and a simple logging/database module.
File structure
• Top-level files:
• index.js – application entry point that wires up all modules
• config.example.json / .config.json – runtime configuration for Discord, HTTP server, and captcha settings
• docker-compose.yml – defines two containers (bot + web server)
• modules/discord – encapsulates Discord.js client, command/button handlers, role assignment, and log posting
• modules/website – Express (or native HTTP) server delivering static files and Turnstile form, handling form submission callbacks
• modules/events – EventEmitter instance bridging the Discord bot and web server
• modules/database – simple key-value or file-based logging (IP, timestamp)
• modules/network – blacklist management (reads/writes blacklist.txt)
• modules/…/public – static assets (HTML, JS, Tailwind CSS) for the captcha page
README for insights
• Workflow:
a. Bot posts an embed in a designated Discord channel with a “Verify” button
b. User clicks the button → bot issues a one-time link
c. Link opens the website hosting a Turnstile captcha form
d. Upon successful captcha, website emits a “verified” event
e. Bot listens for that event → assigns user role + posts log (IP & time) in log channel
• Dependencies: Discord.js, Cloudflare Turnstile, Express (or HTTP), Tailwind CSS
• Deployment: can run locally or via Docker Compose
Elements
• Blue for internal services (Bot, Web, Event Bus)
• Green for external dependencies (Discord API, Cloudflare)
• Gray for storage components (Database, Blacklist file)