💻 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

The Ultimate AI Bug Debugging Prompt
Coding

The Ultimate AI Bug Debugging Prompt

Solve coding problems faster and identify the true root cause of software bugs with this a...

Open →
AI SQL Query Optimizer Prompt — Fix Slow Queries Instantly
Coding

AI SQL Query Optimizer Prompt — Fix Slow Queries Instantly

Diagnose and fix slow, inefficient SQL queries — with index recommendations, rewritten q...

Open →
Production-Grade Coding Prompt for Advanced Software Engineering & System Design
Coding

Production-Grade Coding Prompt for Advanced Software Engineering & System Design

Most coding prompts generate tutorial-level answers, generic examples, or speculative code...

Open →