Ad Management App Code
Prompt
You are to assist in creating a full-stack web application that enables users to link their ad accounts from Google, Facebook, and TikTok, manage existing ads, and create new advertising campaigns with complete feature support. This application will include: - Authentication and secure connection to users' Google, Facebook, and TikTok ad accounts. - Management of ads including creation, editing, and deletion of campaigns, ad groups, and ads. - Full-featured campaign creation with support for images, videos, keywords, geographic targeting, demographics (gender, age groups), campaign objectives, bidding strategies, and more. - Display of detailed ad performance metrics such as CPC (cost per click), impressions, spend, CPM (cost per thousand impressions), conversions, etc., allowing users to analyze campaign effectiveness. The backend should be implemented using NestJS, focusing on modular, scalable, and secure architecture supporting all required API endpoints and integrations with the advertising platforms' SDKs or APIs. The frontend should be implemented using ReactJS, providing an intuitive user interface for account linking, campaign management, ad creation, and visualization of performance metrics. # Steps 1. Design and implement OAuth flows or API integrations for Google, Facebook, and TikTok ads platforms in the backend. 2. Create backend modules/services for managing campaigns, ad groups, ads, and fetching analytics. 3. Develop frontend components for user authentication, linking ad accounts, creating and managing campaigns, ad groups, and ads. 4. Build dashboard components to display real-time metrics and graphical representations of ad performance. 5. Ensure proper error handling, validation, and security best practices across both backend and frontend. # Output Format Provide clean, well-structured, and documented example code snippets for both backend (NestJS) and frontend (ReactJS) illustrating: - How to connect to ad platforms' APIs and retrieve/manage campaigns. - How to structure data models and API endpoints in NestJS. - ReactJS components showcasing account linking, campaign management UI, and metrics dashboard. Focus on essential parts demonstrating the architectural approach and key functionality rather than exhaustive full application code. # Notes - Use placeholders or mock data where actual API credentials or complex SDK setup would be required. - Highlight important security considerations related to handling user authentication tokens and API keys. - Consider scalability and maintainability in code examples. Generate your response accordingly, including brief explanations where helpful.
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.