💻 REST API Builder with Authentication : Build a Complete REST API with Auth — AI Prompt

REST API Builder with Authentication : Build a Complete REST API with Auth — AI Prompt

Generate a production-ready REST API with JWT authentication, input validation, and error handling in any stack — using this one detailed AI prompt

📋 The Prompt

Act as a senior backend engineer. Build a complete REST API endpoint for the following: Tech stack: [e.g. Node.js + Express + PostgreSQL / Python + FastAPI / Go] Feature: [e.g. User Registration and Login] Requirements: - Input validation with proper error messages - Password hashing using bcrypt - JWT authentication middleware - Custom error classes with correct HTTP status codes - Separate route handler, service layer, and repository layer - TypeScript with strict types (if applicable) For each endpoint provide: - HTTP method and path - Request body (with example JSON) - Success response (with example JSON) - All possible error responses - Brief explanation of business logic Also include: - Folder structure recommendation - How to test each endpoint using curl or Postman - 3 security considerations I should keep in mind

🚀 How to Use This Prompt

Copy the prompt above and paste it into your preferred AI tool — Midjourney, DALL-E, ChatGPT, or Stable Diffusion. Replace all [bracketed placeholders] with your specific values for best results.

💡 Tips for Best Results

  • Be as specific as possible when filling in the placeholders.
  • Experiment with different values for varied, unique results.
  • For Midjourney, add --v 6 --ar 16:9 at the end.
  • Run the same prompt multiple times — AI generates unique outputs each run.

More Coding Prompts

AI Code Refactoring Prompt — Clean Up Messy Code Instantly
Coding

AI Code Refactoring Prompt — Clean Up Messy Code Instantly

Transform messy, unreadable, or inefficient code into clean, maintainable, production-read...

Open →
Production-Ready AI Coding Prompt
Coding

Production-Ready AI Coding Prompt

A focused AI coding prompt built for real production systems. It pushes the AI to think li...

Open →
AI Unit Test Generator Prompt — Full Test Coverage in Minutes
Coding

AI Unit Test Generator Prompt — Full Test Coverage in Minutes

Generate comprehensive unit tests with edge cases, error scenarios, and mock data for any ...

Open →