A beautiful Next.js application that generates haikus using Amazon Bedrock and Claude AI.
- 🎨 Beautiful, responsive UI with dark mode support
- 🤖 AI-powered haiku generation using Amazon Bedrock
- 📱 Mobile-friendly design
- ⚡ Fast and efficient API routes
- 🌙 Dark/light theme support
- Frontend: Next.js 15, React 19, Tailwind CSS
- Backend: Next.js API Routes
- AI: Amazon Bedrock with Claude 3 Sonnet
- Deployment: Vercel
-
Clone the repository
-
Install dependencies:
npm install
-
Set up environment variables (create a
.env.localfile in the root directory):# Create .env.local file with your Bedrock credentials AWS_ACCESS_KEY_ID="your-api-key"
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser
The application requires environment variables to be set. Make sure to:
- Set up environment variables in Vercel (see section below)
- Push your code to GitHub
- Connect your repository to Vercel
- Deploy!
- User enters a theme for their haiku
- The frontend sends a POST request to
/api/haiku - The API route uses Amazon Bedrock to invoke Claude 3 Sonnet
- Claude generates a haiku following the 5-7-5 syllable pattern
- The haiku is returned and displayed to the user
Generates a haiku based on the provided theme.
Request Body:
{
"theme": "sunset"
}Response:
{
"haiku": "Golden light fades\nAcross the horizon's edge\nNight whispers softly"
}- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License