AI Prompt for App Architecture
Implement the Plugin-Based architecture pattern for a calendar app with practical code structure and guidelines.
More prompts for App Architecture.
Generate a comprehensive system design document covering architecture, data flow, scalability, and deployment strategy.
Design a complete serverless architecture on AWS Lambda, Vercel, or Cloudflare Workers with infrastructure-as-code.
Design a multi-layer caching architecture with cache invalidation, TTL policies, and consistency guarantees.
Design a complete database schema and data strategy for a analytics dashboard serving the parenting industry.
Design a RESTful or GraphQL API for a restaurant ordering system using SQL with best practices and documentation.
Design a complete system architecture for a healthcare patient portal built with Django + PostgreSQL for real-estate.
You are a senior senior engineer with extensive technical knowledge in system design. You write clear, precise, and implementation-ready content. Explain and implement the **Plugin-Based** architecture pattern for a calendar app using Python. **Pattern:** Plugin-Based **Application:** calendar app **Language:** Python **Team size context:** solo developer ## Pattern Overview - Define the Plugin-Based pattern in 2-3 sentences - Explain when to use it vs. alternatives - List the core principles and rules that must not be violated - Name 3 real-world applications that use this pattern successfully ## Directory Structure Provide a complete folder and file structure showing: - Where each layer or module lives - Naming conventions for files and folders - How to organize shared utilities, types, and constants - Where tests live relative to source files ## Layer-by-Layer Implementation Guide For each layer or component in the Plugin-Based pattern: 1. Explain its responsibility and boundaries 2. Define the interfaces it exposes and consumes 3. Show a representative code example in Python (describe the structure and key functions) 4. List the rules for what this layer is allowed to import ## Dependency Flow - Map out the dependency direction between all layers - Explain the dependency inversion principle as it applies here - Show how to use dependency injection for testability - Identify common mistakes that violate the dependency rules ## Communication Between Components - Define how components communicate (events, direct calls, message bus) - Specify the data transfer objects or contracts between layers - Error propagation strategy across layer boundaries - Logging and observability at each layer ## Testing Strategy by Layer - Unit testing approach for each layer (what to mock, what to test directly) - Integration testing strategy for cross-layer interactions - End-to-end testing scope and tools - Test data management approach ## Migration Guide - How to gradually adopt this pattern in an existing codebase - Recommended migration order (which layer to extract first) - Common pitfalls during migration and how to avoid them - Definition of done for a successful migration - Use precise technical terminology appropriate for the audience - Include code examples, configurations, or specifications where relevant - Document assumptions, prerequisites, and dependencies - Provide error handling and edge case considerations Organize your output using a clear framework with labeled sections. Each section should build on the previous one.