Back to Coding

AdTONX Telegram Mini App

Prompt

Create a fully functional Telegram Mini App named AdTONX with the following features and integrations: 1. User Features: - Watch ads from Monetag, Adexium, and Adsgram networks to earn TON cryptocurrency with tiered and CPM reward systems. - Complete official, partner, and user-paid tasks, with user-paid tasks allowing task creation by paying TON, using the specified pricing formula. - Use a referral system that rewards 10% commission on referrals' lifetime earnings plus a 0.005 TON bonus per active referral after the referral watches 50 ads. - Withdraw earnings securely to their TON wallet with a 20% fee and minimum withdrawal of 2 TON. - Display a leaderboard of weekly top earners who have watched at least 1000 ads. - Show rewards notifications with toast messages and sound effects. - Provide a splash screen with an animated logo and loading state referencing the provided logo and welcome page links. - Use a blockchain-themed UI color scheme with professional and Telegram-compliant UI/UX. 2. Admin Panel: - Secure admin login with given credentials. - Dashboard with key metrics, charts, and system statuses. - User management including viewing, banning, and editing user details. - Manage all task types with creation, pausing, and refund options. - Approve and reject withdrawal requests with fee handling. - Manage ad network switches and reward settings. - View referrals, transactions, platform settings, logs, and security tools. 3. Technical and Integration Requirements: - Integrate Firebase (Firestore, Authentication) using provided config; real user authentication with Lovable Cloud. - Implement Telegram WebApp SDK with secure initData validation for user auth. - Integrate specified ad networks with provided code snippets for Monetag, Adexium, and Adsgram. - Design frontend as responsive SPA using vanilla JS, HTML5, CSS3, deployable on GitHub Pages. - Use backend-less architecture initially with Firebase Cloud Functions or serverless functions as optional backend. - Implement anti-fraud features like ad cooldown (10s), daily ad limits (3000), IP/device fingerprinting, and task verification. - Configure Firebase Firestore collections for users, transactions, tasks, withdrawals, settings, and admins with given schemas and security rules. - Provide smooth balance animations, countdown ad timers, progress bars, screen transitions, and confetti on success. - Include haptic feedback and sound on reward events. - Provide complete documentation for further development and deployment. 4. Additional Details: - Handle economics safely ensuring zero investment model, platform reserve coverage, pre-funded user tasks, and revenue from ads and fees. - Provide multi-tab navigation: Home, Ads, Tasks, Wallet. - Ensure instant balance updates and notifications. - Leaderboard display limited to users with minimum 1000 ads watched weekly. 5. Output Instructions: - Provide the complete source code of the Mini App frontend and Admin Panel with deployment ready configurations. - Include integration scripts, Firebase security rules, and detailed setup instructions. - Ensure no mock or simulated data; all functionalities fully operational. - Include comments and documentation within code. 6. Use the provided assets and credentials exactly and securely. Priority: Ensure full functionality, security, and real-world readiness, then polish UI/UX for a professional look. # Output Format - Structured, commented source code files for frontend (App.tsx and related), admin panel HTML/JS/CSS, and Firebase rules. - Step-by-step setup and deployment guide. - README with architecture overview and usage instructions. # Notes - Do not use mock data; connect all features to real Firebase and Telegram APIs. - Strictly enforce ad watching limits, cooldowns, and referral conditions. - Admin panel must be accessible via secure login and able to manage all platform aspects. - Provide notifications and sounds on earnings to enhance engagement. - Use blockchain thematic style and smooth animations. - Leaderboard should update weekly based on ads watched. # Examples - Reward toast example: "🎉 You've earned 0.005 TON!" - Splash screen: animated logo followed by welcome page with link https://ibb.co/RkbdNmfv - Referral link format: https://t.me/AdTONX_BOT?start=ref_{USER_ID} Make sure everything is integrated to create a deployable, professional Telegram Mini App and Admin Panel named AdTONX as specified.

Related Coding Prompts

Write Code

As a seasoned programmer, your task is to write code in [programming language] to [perform action]. The code should be efficient, well-structured, and optimized for performance. Make sure to follow best practices and industry standards while implementing the necessary algorithms and logic to achieve the desired functionality. Test the code thoroughly to ensure it functions as intended and meets all requirements. Additionally, document the code properly for future reference and maintenance.

Debug Code

Act as a seasoned programmer with over 20 years of commercial experience. Analyze the provided [piece of code] that is causing a specific [error]. Your task involves diagnosing the root cause of the error, understanding the context and functionality intended by the code, and proposing a solution to fix the issue. Your analysis should include a step-by-step walkthrough of the code, identification of any bugs or logical mistakes, and a detailed explanation of how to resolve them. Additionally, suggest any improvements or optimizations to enhance the performance, readability, or maintainability of the code based on your extensive experience. Ensure that your solution adheres to best practices in software development and is compatible with the current development environment where the code is being executed.

Do Code Review

As a seasoned programmer with over 20 years of commercial experience, your task is to perform a comprehensive code review on the provided [piece of code]. Your review should meticulously evaluate the code's efficiency, readability, and maintainability. You are expected to identify any potential bugs, security vulnerabilities, or performance issues and suggest specific improvements or optimizations. Additionally, assess the code's adherence to industry standards and best practices. Your feedback should be constructive and detailed, offering clear explanations and recommendations for changes. Where applicable, provide examples or references to support your suggestions. Your goal is to ensure that the code not only functions as intended but also meets high standards of quality and can be easily managed and scaled in the future. This review is an opportunity to mentor and guide less experienced developers, so your insights should be both educational and actionable.