A comprehensive subscription payment system leveraging the Solana blockchain, integrated into a Discord bot as the client interface. Probot facilitates the purchase and management of subscriptions for various cryptocurrency tools in an efficient and user-friendly manner. This project is divided into two main parts:
- Client (located in the Client folder)
- Backend (includes SubscriptionsAPI, Data, and ProRaffleTool folders - the first tool)
The client application was developed in C# using the DSharpPlus library. It can be installed on any Discord server and serves as the GUI for users to purchase subscriptions. Subscriptions provide access to cryptocurrency tools that offer meaningful advantages in the crypto world.
Key Features:
-
Subscribe, allows users to subscribe to different plans for a product.
-
Payment Wallets, configure the payment address for the Solana blockchain.
-
Claim code, generate claim codes to provide access to different communities or for trial versions.
- /product-keys - View product keys associated with your account.
- /new-subscription - Start a new subscription.
- /extend-subscription - Extend an existing subscription.
- /update-alphabot-key - Update your Alphabot key.
- /bot-status - Check the status of the bot.
All operations communicate with the backend through the SubscriptionsAPI.
The backend system is divided into multiple components that work together to handle subscriptions, orders, and related functionalities.
- Manages subscription-related operations and communicates with the client.
- Follows the MVC pattern (Model-View-Controller).
- Provides multiple endpoints for managing:
- Users
- Orders
- Subscriptions
- Products
- Product keys
- Is secured by an API key, ensuring access is restricted to authorized users only.
- Contains 3 background jobs for efficient task handling. Jobs 1 and 2 remain active but idle until triggered by the arrival of a new order:
- TransactionMonitorService, searches Solana blockchain (RPC Call) for newly added transaction for a period of 10min and if found notifies OrderMonitorService using a transaction channel
- OrderMonitorService, processes orders, updates their states, and notifies users of changes in real-time using SignalR.
- SubscriptionCheckService, sends reminders to authorized users about upcoming subscription expirations. Notifications are sent at 7, 3, and 1 day(s) before expiration, also utilizing SignalR for real-time alerts.
- Utilizes Entity Framework (Code-First Approach) and LINQ to manage and communicate with the database, for all the operations mentioned above.
- Contains all database-related objects, configurations and migrations.
- SQLite is used to store all the data.
Problem
Every day, approximately 1,000 raffles are created. Managing these raffles manually would require significant time and effort, especially when using multiple accounts.
Solution
An automated system was developed to enhance clients' chances of winning whitelist spots in NFT raffles. This tool complements the subscription system and provides users with a significant competitive edge.
-
Webhook Integration
- Receives and processes new raffle.
- Registers users in raffles through the Alphabot.app API.
- Utilizes Ngrok to safely expose the webhook to external sources.
-
Automated Raffle Registration
- A background job runs every 2 hours to automatically register users for leftover raffles, maximizing participation opportunities.
-
Discord OAuth2 Implementation - allow users to monitor in real time which raffles were successfully registered and which ones failed. The user must give authorization to attach a webhook in a specific server in order to work.