REST API Builder with Authentication
Generate a complete, production-ready REST API with JWT authentication, rate limiting, and full CRUD endpoints.
The Prompt
Build a production-ready REST API with these specifications: API purpose: [describe what the API does] Main resources/entities: [list 2–3, e.g., users, posts, products] Database: [PostgreSQL / MongoDB / SQLite] Language/framework: [Node.js/Express / Python/FastAPI / Go] Authentication: JWT (access + refresh tokens) Generate the complete API including: 1. Project structure with all files listed 2. Authentication endpoints: - POST /auth/register (with password hashing) - POST /auth/login (returns JWT) - POST /auth/refresh - POST /auth/logout 3. For each resource: full CRUD endpoints - GET /[resource] (list with pagination, filtering, sorting) - GET /[resource]/:id - POST /[resource] (with validation) - PUT /[resource]/:id (with ownership check) - DELETE /[resource]/:id (soft delete) 4. Middleware: auth guard, rate limiter (100 req/15min), request logger, error handler 5. Input validation with descriptive error messages 6. Environment variable configuration (.env.example) Write clean, commented code following REST best practices.
Tips for Best Results
- →Add API versioning (/v1/) from the start — easier than retrofitting later
- →Use Postman or Insomnia to test all endpoints after generation
Tags
Related Prompts
Full-Stack API Generator
Generate a complete REST API with database schema, authentication, CRUD operations, and documentation.
Code GenerationDatabase Schema Designer
Design a complete database schema with tables, relationships, indexes, and migration scripts for your application.
Code GenerationPython Web Scraper Builder
Generate a robust Python web scraper with error handling, rate limiting, and data export to CSV or JSON.
Code GenerationReact Dashboard Component Builder
Generate a complete analytics dashboard with charts, KPI cards, data tables, and filters using React and Recharts.
Code GenerationSQL Query Optimizer and Explainer
Paste any SQL query and get an optimized version with explanation of what was improved and why.
Code GenerationChrome Extension Builder
Build a functional Chrome extension with popup UI, content scripts, and background service worker from a single prompt.