Overview & Impact
Coin Flipper was a fun and customisable Discord bot that could flip coins, start minigames, and did much more! It served as a central hub for many communities, keeping servers active with engaging commands and a robust virtual economy.
At its peak, the application reached massive scale, achieving the following metrics:
- Peak User Count: 775,000
- Peak Server Count: 3,700
- GitHub Stars: 49
Architecture & Features
The application was built using the DiscordJS framework and utilised Firebase NoSQL for real-time data persistence. The architecture was meticulously optimised to handle large-scale concurrency while maintaining high uptime and efficient resource allocation.
Event-Driven Architecture: Leveraged Discord's gateway intents and a modular command structure to process thousands of simultaneous user requests with minimal latency.Custom Caching System: Implemented a bespoke caching layer using DiscordJS Collections (which extends JavaScript's native Map class) to store frequently accessed data in-memory, significantly reducing costly database reads and improving response times.Rate Limiting: Enforced strict rate limits on specific high-frequency commands to prevent API abuse and ensure stable performance by implementing time-based execution throttles.
Features
Advanced Economy System: A comprehensive virtual economy built around Cents allowed users to earn currency through jobs, lottery tickets, and coin flips to purchase items and addons.Scalable Minigames: The bot featured a variety of interactive games that randomly challenged users with tasks such as unscrambling words, reaction time tests (selecting specific reactions or buttons), and typing speed tests to keep the gameplay loop engaging.Custom Mechanics: Introduced unique communal features like a Server Trash Can, allowing users to trade items collectively, and a system of 17 collectible badges to drive long-term user retention.
Repository & Links
The source code for Coin Flipper has been archived and is available on GitHub for educational purposes and community review.
GitHub Repository: https://github.com/ThatsLiamS/Coin-Flipper