Skip to content

Cubex Backend Modules

_lib Module

The _lib module contains custom-built libraries that handle important functions across the platform. These functions include:

  • Sending emails to users
  • Sending Slack notifications
  • Sending push notifications
  • Sending one-time passwords (OTP) for user verification
  • Adding new user profiles to Klaviyo for email marketing campaigns
  • Logging errors to Sentry for tracking and troubleshooting
  • Performing database operations:
  • Updating records
  • Deleting records
  • Inserting new records
  • Fetching data

Admin Module

The admin module allows administrators to manage the platform with the following capabilities:

  • View all users and their rewards transactions
  • Create new admin accounts
  • Access configuration settings
  • View statistics on the dashboard
  • Calculate the total balance of all users

Authentication Module

The Authentication module manages user logins and secures accounts. Its functions include:

  • User registration
  • Email verification
  • Password changes
  • Recovering forgotten passwords

Crypto Module

The Crypto module manages all cryptocurrency-related operations. Its functions include:

  • Creating crypto wallet addresses
  • Tracking transactions
  • Calculating wallet balances
  • Calculating the amount in Naira to be liquidated
  • Crediting loyalty bonuses
  • Handling currency conversions
  • Listing supported cryptocurrencies
  • Managing the sale of crypto for Naira

Durable Objects Module

The Durable Objects module ensures that users can only make one transfer request at a time, preventing multiple transfer requests from being processed simultaneously.

Feature Flag Module

The Feature Flag module manages feature settings on the platform. Its functions include:

  • Creating new features
  • Updating existing features
  • Viewing specific platform features

Forward Module

The Forward module handles server error management. Its functions include:

  • Logging server errors
  • Sending errors to Sentry for tracking and troubleshooting

Middleware Module

The Middleware module ensures that users are authenticated before performing critical actions. Its functions include:

  • Checking user authentication before allowing actions such as:
  • Selling crypto
  • Creating wallets
  • Fetching user's naira wallet history
  • Transferring funds to user's bank account
  • Fetching user's crypto transactions
  • Verifying the user's token, issued during login or signup

Payments Module

The Payments module handles all payment and transfer operations. Its functions include:

  • Listing Nigerian banks
  • Allowing users to transfer money to other platform users
  • Enabling fund transfers to Nigerian bank accounts

Transfer Accounts Module

The Transfer Accounts module manages users' bank account details. Its functions include:

  • Storing users' bank account information
  • Fetching transfer accounts
  • Validating transfer account details
  • Deleting transfer accounts to ensure smooth fund transfers

User Module

The User module enables users to manage their personal details. Its functions include:

  • Updating personal information
  • Accessing Naira wallets
  • Viewing transaction history
  • Managing security PINs
  • Handling validations for:
  • BVN (Bank Verification Number)
  • Bank account details
  • Phone numbers

Wallet Module

The Wallet module manages rewards for loyal customers and oversees wallet transactions. Its functions include:

  • Tracking rewards given to loyal customers
  • Crediting user wallets
  • Debiting user wallets
  • Checking if users have sufficient balance

Webhook Module

The Webhook module manages automatic notifications from external systems. Its functions include:

  • Handling notifications for:
  • Successful bank transfers
  • Failed bank transfers
  • Crypto deposits
  • Instant orders and withdrawals
  • Account or BVN verifications