Skip to content

Repository files navigation

Floral Muse — AI Poem Generator

Floral Muse is an elegant, responsive, and AI-powered poem generator. It allows users to write custom poems by providing a theme and choosing from various poetry styles. The project is built using Next.js 15, Tailwind CSS, and Google GenAI SDK with the gemini-flash-latest model.


🎨 Features

  • Custom Poetic Styles: Generate poems in various styles including Haiku, Sonnet, Free Verse, Limerick, Ode, Ballad, Villanelle, Acrostic, and Cinquain.
  • Elegant UI/UX: A responsive, themed interface with smooth animations, custom scrollbars, loading states, and toast notifications.
  • AI-Powered: Built with Google GenAI SDK (@google/genai) using the gemini-flash-latest model.
  • Developer UI Support: Integrated with Genkit's Developer UI for inspecting and testing AI flows locally.

🛠️ Tech Stack

  • Framework: Next.js 15 (App Router, Turbopack)
  • AI SDK: Google GenAI SDK
  • AI Model: Google Gemini Flash (gemini-flash-latest)
  • Styling: Tailwind CSS, Radix UI (accessible components), Lucide Icons
  • Language: TypeScript

⚙️ Environment Setup

To run the application and communicate with the Gemini API, you need to configure your environment variables.

  1. Copy the example environment file:

    cp .env.example .env
    # Or on Windows PowerShell:
    copy .env.example .env
  2. Add your Gemini API Key: Open .env (or .env.local if preferred) and add your Google Gemini API Key:

    GEMINI_API_KEY=your_actual_gemini_api_key_here

    🔑 Note: You can obtain a Gemini API key from the Google AI Studio.


🚀 Getting Started

1. Install Dependencies

Ensure you have Node.js installed, then run:

npm install

2. Run the Development Server

Start the Next.js development server:

npm run dev

The application will run on http://localhost:9002.

3. Run the Genkit Developer UI

To test, run, and inspect your AI flows in the Genkit local playground, open a separate terminal and start Genkit:

npm run genkit:dev

Or with watch mode enabled:

npm run genkit:watch

📂 Project Structure

Key folders and files:

  • 📂 src/ai — Genkit initialization and AI flows.
    • 📄 genkit.ts — Configures the Genkit instance and registers the Google AI plugin.
    • 📂 flows — Definitions of prompt schemas and generator flows.
  • 📂 src/app — Next.js routing and layout definition.
  • 📂 src/components — React components for the generator UI.
    • 📄 poem-generator.tsx — Main interactive panel and API call handlers.
  • 📂 src/hooks — Custom React hooks (e.g. for toast messaging).

🏗️ Production Build

To build the application for production deployment:

npm run build

To start the production server:

npm run start

About

A next js app that uses ai to generate poem based on nature

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages