A modern web application that generates customized jokes using OpenAI's GPT-4o-mini model. Built with Next.js, TypeScript, and Tailwind CSS.
-
🎯 Customizable Joke Parameters
- Choose from various topics (Work, People, Animals, etc.)
- Select different tones (Witty, Sarcastic, Silly, etc.)
- Pick joke types (Pun, Knock-knock, Story, etc.)
- Adjust creativity level with temperature control
-
🤖 AI-Powered Generation
- Uses OpenAI's GPT-4o-mini model
- Smart prompt engineering for better results
- Automatic joke evaluation system
-
📊 Quality Assessment
- Evaluates humor level
- Checks appropriateness
- Monitors potential offensive content
-
💫 Modern UI/UX
- Responsive design
- Beautiful animations
- Real-time feedback
- Joke history with scrollable feed
- Frontend Framework: Next.js 13.5
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- AI Integration: OpenAI API
- Icons: Lucide React
- Toast Notifications: Sonner
- Node.js 16.8 or later
- OpenAI API key
- Clone the repository:
git clone https://github.com/yourusername/ai-joke-generator.git
cd ai-joke-generator
- Install dependencies:
npm install
- Create a
.env.local
file in the root directory and add your OpenAI API key:
NEXT_PUBLIC_OPENAI_API_KEY=your_api_key_here
- Start the development server:
npm run dev
- Open http://localhost:3000 in your browser.
-
Configure Joke Parameters
- Select a topic from the dropdown menu
- Choose the desired tone
- Pick a joke type
- Adjust the creativity slider
-
Generate Joke
- Click the "Generate Joke" button
- Wait for the AI to create and evaluate the joke
-
View Results
- Read the generated joke
- Check the evaluation metrics
- Browse previous jokes in the history section
ai-joke-generator/
├── app/
│ ├── layout.tsx
│ └── page.tsx
├── components/
│ ├── gradient-background.tsx
│ ├── joke-generator.tsx
│ ├── joke-history.tsx
│ └── ui/
├── lib/
│ ├── openai.ts
│ ├── types.ts
│ └── utils.ts
└── public/
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for providing the GPT-3.5 API
- shadcn/ui for the beautiful UI components
- Tailwind CSS for the styling system
- Next.js for the awesome framework