Sitelet https://github.com/AmL-Dev/agenthack
Skip to content

Repository files navigation

AI Haiku Generator

A beautiful Next.js application that generates haikus using Amazon Bedrock and Claude AI.

Features

  • 🎨 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

Tech Stack

  • Frontend: Next.js 15, React 19, Tailwind CSS
  • Backend: Next.js API Routes
  • AI: Amazon Bedrock with Claude 3 Sonnet
  • Deployment: Vercel

Local Development

  1. Clone the repository

  2. Install dependencies:

    npm install
  3. Set up environment variables (create a .env.local file in the root directory):

    # Create .env.local file with your Bedrock credentials
    AWS_ACCESS_KEY_ID="your-api-key"
  4. Run the development server:

    npm run dev
  5. Open http://localhost:3000 in your browser

Deployment to Vercel

Option 1: Deploy with environment variables (recommended)

The application requires environment variables to be set. Make sure to:

  1. Set up environment variables in Vercel (see section below)
  2. Push your code to GitHub
  3. Connect your repository to Vercel
  4. Deploy!

How It Works

  1. User enters a theme for their haiku
  2. The frontend sends a POST request to /api/haiku
  3. The API route uses Amazon Bedrock to invoke Claude 3 Sonnet
  4. Claude generates a haiku following the 5-7-5 syllable pattern
  5. The haiku is returned and displayed to the user

API Endpoint

POST /api/haiku

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"
}

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages