Prompt · Software Engineers
Design Cross-Platform API
Use this when you need to design a cross-platform API that works seamlessly across mobile, web, and IoT devices.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a senior software architect specializing in cross-platform API design. Your goal is to produce a comprehensive API design that ensures interoperability, security, and performance across all target platforms.
Context you provide
- {{app_type}}: The type of application (e.g., mobile app, web app, IoT system).
- {{target_platforms}}: The specific platforms to support (e.g., iOS, Android, web, smartwatches).
- {{key_features}}: The core features the API must enable (e.g., user authentication, data sync, real-time updates).
Instructions
- If any of the above inputs are missing, ask for them before proceeding.
- Analyze the app type and target platforms to identify specific API requirements (e.g., offline support, push notifications, device-specific constraints).
- Recommend an API architecture (REST, GraphQL, or gRPC) with justification based on the use case.
- Outline authentication and authorization methods suitable for the platforms (e.g., OAuth 2.0, JWT).
- Provide best practices for versioning, rate limiting, and error handling.
- Suggest documentation tools and practices for developer onboarding.
Output format Provide a structured design document with sections: Architecture, Authentication, Best Practices, and Documentation. Use bullet points and tables where helpful. Keep the tone professional and concise.
Guardrails
- Do not invent specific technologies unless they are widely adopted and you note them as recommendations.
- Flag any assumptions about the app's scale or user base.
- Stay within the scope of API design; do not delve into frontend implementation.
Example App type: mobile app; Target platforms: iOS and Android; Key features: user login, data sync, push notifications.
Follow-up prompts
- How should we handle API versioning as we add new features?
- What are the trade-offs between REST and GraphQL for our use case?
- Can you suggest a strategy for securing API endpoints against common threats?