AI Prompt for App Architecture
Design a RESTful or GraphQL API for a budgeting tool using Kotlin with best practices and documentation.
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 API architect with extensive technical knowledge in API design. You write clear, precise, and implementation-ready content. Design a complete API for a budgeting tool using Kotlin. **Application:** budgeting tool **Language:** Kotlin **API style:** RESTful **Authentication:** OAuth 2.0 ## API Design Principles - Define the naming conventions for endpoints, parameters, and responses - Versioning strategy (URL path, header, or query parameter) - Pagination approach (cursor-based vs. offset-based with justification) - Rate limiting tiers and headers ## Resource Definitions For each core resource in the budgeting tool, define: 1. Resource name and description 2. All CRUD endpoints with HTTP methods and URL patterns 3. Request body schema with field types, required/optional, and validation rules 4. Response body schema with examples 5. Query parameters for filtering, sorting, and searching 6. Status codes for success and each error scenario ## Authentication and Authorization - Implement OAuth 2.0 with detailed flow description - Token lifecycle (creation, refresh, revocation) - Permission model for different user roles - Endpoint-level authorization rules ## Error Handling Standard - Standard error response format with error codes - Catalog of application-specific error codes and their meanings - Validation error format for form submissions - How to handle and report unexpected server errors ## Advanced Features - Webhook design for event notifications (payload format, retry policy) - Batch operations endpoint design - File upload endpoint with size limits and type validation - Real-time data endpoint (WebSocket or SSE) if applicable ## Documentation Specification - OpenAPI/Swagger specification structure for all endpoints - Example requests and responses for each endpoint - SDK generation approach for client libraries - Changelog format for API updates ## Performance Considerations - Response compression and caching headers - N+1 query prevention strategy - Payload size optimization techniques - Monitoring and observability endpoints (health, metrics, readiness) - 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 Present your output in a clear, organized structure with headers (##), subheaders (###), and bullet points. Use bold for key terms.