I'm building a React e-commerce app. Create a product card component that displays product image, name, price, and add-to-cart button. Use Tailwind CSS for styling and include hover effects.
Create a React component for [component name] that:- [Feature 1]- [Feature 2] - [Feature 3]Requirements:- Use TypeScript- Style with [CSS framework]- Include [accessibility features]- Handle [error cases]Props interface should include: [list props]
Backend APIs
Copy
Ask AI
Build a [framework] API endpoint that:- Method: [GET/POST/PUT/DELETE]- Route: [/api/path]- Functionality: [what it does]Requirements:- Validate input with [validation library]- Connect to [database type]- Return [response format]- Handle errors: [error cases]- Include authentication: [auth method]
Database Schemas
Copy
Ask AI
Design a [database type] schema for [use case]:Tables needed:- [Table 1]: [fields and types]- [Table 2]: [fields and types]Relationships:- [relationship descriptions]Requirements:- Include indexes for [performance needs]- Add constraints for [data integrity]- Consider [scalability factors]
I'm getting this error: [error message]Context:- Framework: [framework name]- Environment: [development/production]- Browser/Node version: [version]Code that's causing the issue:[Insert problematic code]What I've tried:- [Attempted solution 1]- [Attempted solution 2]Please help me fix this and explain what caused it.
Create a React dashboard component with:- Sidebar navigation with icons- Header with user profile dropdown- Main content area with cards showing metrics- Responsive design using Tailwind CSS- Dark/light theme toggle- TypeScript interfaces for all props
Create an Express.js API for a blog platform:- Routes: GET /posts, POST /posts, PUT /posts/:id, DELETE /posts/:id- MongoDB integration with Mongoose- JWT authentication middleware- Input validation with Joi- Error handling middleware- Rate limiting
Create a full-stack task management app:Frontend (React + TypeScript):- Task list with add, edit, delete, complete functionality- Filter by status (all, active, completed)- Responsive design with Tailwind CSSBackend (Node.js + Express):- REST API with CRUD operations- PostgreSQL database with Prisma ORM- JWT authenticationFeatures:- User registration and login- Real-time updates with WebSocket- Dark mode toggle- Mobile-responsive design
The code you generated is good, but can you:1. Add error handling for [specific case]2. Optimize the [specific function] for performance3. Add comments explaining [complex logic]4. Make it more accessible by [specific improvement]
Vague Requirements❌ “Build me a website”
✅ “Create a React portfolio website with header, hero section, projects grid, and contact form”
Missing Context❌ “Fix this code [code snippet]”
✅ “This React component isn’t updating state correctly. It should [expected behavior]. Here’s the code: [snippet]”
Overloading Prompts❌ Asking for an entire application in one prompt
✅ Breaking it down into components, features, and iterations
API Endpoint Template:Create a [framework] API endpoint:Route: [method] [path]Purpose: [what it does]Authentication: [requirements]Validation: [input rules]Response format: [structure]Error handling: [scenarios]
Pro Tip: Start a conversation with “Help me build [project type]” and let the AI ask clarifying questions. This often leads to better, more targeted prompts.