Design and develop a modern question and answer (Q&A) web application using Next.js and TypeScript. The application should prioritize a clean user experience, efficient data management, and adherence to current web development best practices.
Don't implement user Authentication:
# Core Features:
Question Management:
1) Add New Question: Implement a form allowing users to submit new questions. Each question entry must include three distinct fields:
- Question Text: The user-submitted question.
- User Answer: The user's provided answer to the question.
- AI-Generated Answer: A field to store an answer generated by an external AI service - OpenAI - Consider how this AI answer will be generated by in a button.
2) List All Questions: Display a comprehensive list of all submitted questions. Each item in the list should clearly present the question, the user's answer, and the AI-generated answer.
3) Edit/Delete Questions: Allow users to modify or remove existing questions.
4) Search/Filter: Implement functionality to search or filter questions based on keywords or categories.
# Technical Requirements & Best Practices:
Next.js Fundamentals:
- Utilize Next.js App Router for routing and layout management.
- Implement Server Components and Client Components appropriately to optimize performance and user experience.
- Consider data fetching strategies (e.g., fetch in Server Components, SWR/React Query in Client Components) for efficient data retrieval.
- TypeScript: Enforce strong typing throughout the application for improved code quality, maintainability, and developer experience. Define clear interfaces for data structures (e.g., Question, Answer).
- Styling: Choose a modern styling approach - Tailwind CSS, CSS Modules, Styled Components - and apply it consistently for a visually appealing and responsive UI.
- Data Persistence: Determine a suitable method for storing question data in the Supabase
User Interface (UI) / User Experience (UX):
- Design an intuitive and user-friendly interface for adding and viewing questions.
- Implement form validation for the question submission form.
- Provide clear loading states and error handling messages.
Code Quality & Structure:
- Organize code logically into components, services, and utilities.
- Write clean, readable, and well-commented code.
- Consider implementing basic error logging and debugging strategies.
Created
July 5, 2025 14:16
-
-
Save johnidm/70413691e1526ad013dbd755018972a5 to your computer and use it in GitHub Desktop.
Interview Q&A App Prompts
Develop a Question and Answer web application using Next.js and TypeScript, following modern best practices for scalability, performance, and maintainability.
# Core Features
### Add a New Question
Input form with three required fields:
- question: string
- answer: string (manual answer)
- AI answer: string (AI-generated answer)
List All Questions
- Display all existing questions in a clean and paginated UI (if necessary).
Edit a Question
- Allow users to update any of the three fields.
Delete a Question
- Implement a safe deletion mechanism with user confirmation.
# Technical Guidelines
Use Next.js App Router and Server Actions where appropriate.
Organize code following a scalable folder structure (e.g., app/, components/, lib/, types/).
Use TypeScript throughout the project.
Apply React Hooks (e.g., useState, useEffect, useOptimistic) for interactivity.
Use Tailwind CSS for styling.
Store data in Supabase, create a SQL script to update the database schema:
Add basic form validation using zod
Add AI integration for auto-generating the AI answer field using OpenAI API.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prompt Two