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.
- 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 thegemini-flash-latestmodel. - Developer UI Support: Integrated with Genkit's Developer UI for inspecting and testing AI flows locally.
- 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
To run the application and communicate with the Gemini API, you need to configure your environment variables.
-
Copy the example environment file:
cp .env.example .env # Or on Windows PowerShell: copy .env.example .env -
Add your Gemini API Key: Open
.env(or.env.localif 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.
Ensure you have Node.js installed, then run:
npm installStart the Next.js development server:
npm run devThe application will run on http://localhost:9002.
To test, run, and inspect your AI flows in the Genkit local playground, open a separate terminal and start Genkit:
npm run genkit:devOr with watch mode enabled:
npm run genkit:watchKey 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).
To build the application for production deployment:
npm run buildTo start the production server:
npm run start