Skip to content

MuseMind is an AI-powered poem generator that transforms your thoughts and emotions into expressive poetry. Choose from one of the three themes - LoveLines, SoulScript, and MoodVerse - input your feelings, and let AI translate emotion into thoughtful art.

Notifications You must be signed in to change notification settings

luyandazuma/Week2-AIPoemGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MuseMind β€” AI Poem Generator

Your Mood. Our Muse.

MuseMind is an AI-powered web application that transforms your feelings, emotions, and mood into personalised poems. Choose a theme, type your prompt, and let AI weave your words into art that captures how you feel and thoughtfully expresses it.

πŸ’‘ Why We Created MuseMind

Have you ever felt something deeply but could not find the words to express it? That’s where MuseMind fits in, in the quiet spaces between emotion and language.

We wanted to build something that does not just generate text, but transforms feeling into form. MuseMind explores how AI can become a creative partner, helping anyone find the words to give what is in their heart artistic shape through language.

Try MuseMind now - No installation required!
πŸ”— Live Demo: MuseMind

Click the link above to start creating personalised poems! πŸ’•πŸŽ¨πŸŒŸ

🎨 Features

Three Themes. One Custom Creation:

  • πŸ’• LoveLines
  • 🎨 MoodVerse
  • 🌟 SoulScript

AI-Powered Generation - Utilises Google Gemini API for intelligent, contextual poem creation.
Real-time Generation - Watch your poem appear with smooth typewriter animation.
Beautiful Themed UI - Each theme has its own unique visual aesthetic.
Responsive Design - Works seamlessly on desktop, tablet, and mobile devices.

βš™ How MuseMind Works

  1. User selects a theme (LoveLines, SoulScript, or MoodVerse).
  2. User is redirected to the page where the poem will be generated and has to type an idea, emotion, or thought into the input field.
  3. MuseMind combines a fixed prompt template with user input.
  4. The backend sends this prompt to Gemini’s API.
  5. The AI returns a unique and beautiful poem matching the chosen theme and feelings.
  6. Users can regenerate another poem by clicking the "Generate" button again.

πŸ’Œ Themes

Theme Description Tone
LoveLines (Pinks, roses and whites) Heartfelt poems for loved ones. Romantic, emotional, and warm.
MoodVerse (Neon pinks, cyans, deep purples) Expressive poems based on your current feelings or mood. Emotive and expressive.
SoulScript (Purples, muted tones and background) Affirming and kind words to positively influence one's sense of self. Assuring, uplifting and gentle.

πŸ“· Preview

Landing page: 2025-10-18 (9) Users are prompted to click on the type of poem they want from the three given options

LoveLines Theme Landing Page (all Theme Pages have the same format/structure and functionality) 2025-10-18 (8) If there is no prompt, the user will be prompted to add text

LoveLines- Generated Poem 2025-10-18 (11) After a poem is generated, users can Select and Copy poem to paste onto the Clipboard or message. Users can also regenerate another poem by clicking the "Generate" button again

MoodVerse- Generated Poem 2025-10-18 (14)

SoulScript- Generated Poem 2025-10-18 (17)

β›“ Tech Stack

Frontend:

  • HTML β€” Structure and content.
  • CSS β€” Styling and responsiveness.
  • JavaScript β€” Interactivity and user input handling.

Backend:

  • Node.js + Express.js β€” Runs JavaScript on the server and handles API requests.
  • Gemini API β€” Powers AI poem generation (gemini-2.0-flash model).
  • Axios - HTTP client for API requests.
  • CORS - Cross-origin resource sharing.
  • dotenv - Environment variable management.

Deployment

  • Frontend: Hosted on Netlify.
  • Backend API: Hosted on Render.

πŸ–₯ How to Run

Note: MuseMind is already live at https://transcendent-croissant-e3163c.netlify.app/
These instructions are for running the project on your local machine for development.

Prerequisites

Node.js (v14 or higher).
npm (comes with Node.js.
Google Gemini API key Get one here.

1. Clone the Repository
Open your terminal and run:

git clone https://github.com/luyandazuma/Week2-AIPoemGenerator.git
cd Week2-AIPoemGenerator

2. Install Backend Dependencies

cd server
npm install

3. Configure Environment Variables
Create a .env file in the server folder.
Copy the content from .env.example into your new .env file.
Add your Gemini API key:

GEMINI_API_KEY=your_actual_gemini_api_key_here

4. Start the Backend Server:

npm run dev

The backend will run on http://localhost:3000 by default.

5. Serve the Frontend Open a new terminal window:

cd ../public
npx http-server -p 8080

Or use the Live Server extension in VS Code.
The frontend will run on http://localhost:8080.

6. Open in Browser
Navigate to http://localhost:8080 and start creating poems!

πŸš€ Deployment

This project is deployed using:

  • Frontend: Netlify (serves static files from public/ folder).
  • Backend: Render (Node.js/Express server from server/ folder).

Deploy Your Own Instance:

Backend (Render):

  1. Create an account at Render.
  2. New Web Service β†’ Connect Git repo.
  3. Root Directory: server.
  4. Build: npm install.
  5. Start: npm start.
  6. Add GEMINI_API_KEY environment variable.

Frontend (Netlify):

  1. Create an account at Netlify.
  2. Import from Git or drag the public/ folder.
  3. Base Directory: public.
  4. Publish Directory: public.
  5. Update API URLs in JS files to point to your backend.

πŸ“‚ API Documentation

Backend Endpoints
Health Check

GET /api/health

Returns server status and timestamp.

Generate Poem

POST /api/generate-poem
Content-Type: application/json

Body:
{
  "userInput": "string",  // User's feelings or thoughts.
  "theme": "string"       // "lovelines" | "moodverse" | "soulscript"
}

Response:
{
  "success": true,
  "poem": "string",       // Generated poem text.
  "theme": "string",
  "timestamp": "string"
}

πŸ“Š Project Structure

Week2-AIPoemGenerator/
β”œβ”€β”€ public/                   # Frontend files.
β”‚   β”œβ”€β”€ index.html            # Landing page.
β”‚   β”œβ”€β”€ lovelines.html        # LoveLines theme page.
β”‚   β”œβ”€β”€ moodverse.html        # MoodVerse theme page.
β”‚   β”œβ”€β”€ soulscript.html       # SoulScript theme page.
β”‚   β”œβ”€β”€ styles/
β”‚   β”‚   β”œβ”€β”€ styles.css        # Base styles.
β”‚   β”‚   └── themes.css        # Theme-specific styles.
β”‚   └── Script/
β”‚       β”œβ”€β”€ landing.js        # Landing page logic.
β”‚       β”œβ”€β”€ lovelines.js      # LoveLines functionality.
β”‚       β”œβ”€β”€ moodverse.js      # MoodVerse functionality.
β”‚       └── soulscript.js     # SoulScript functionality.
β”‚
β”œβ”€β”€ server/                  # Backend files.
β”‚   β”œβ”€β”€ server.js            # Express server & API logic.
β”‚   β”œβ”€β”€ package.json         # Dependencies.
β”‚   β”œβ”€β”€ .env.example         # Environment variables template.
β”‚   └── .gitignore           # Git ignore rules.
β”‚               
└── README.md                # This file.

πŸ”’ Security Notes

⚠️ Never commit .env files - They contain sensitive API keys.
βœ”οΈ Always use an .env.example as a template for team members.
βœ”οΈ Regenerate API keys if accidentally exposed.
βœ”οΈ Use environment variables for all secrets.

πŸ“„ License

This project was created as part of a coding bootcamp group's generative AI project.

πŸ“ž Support

If you encounter any issues:

  • Check that your Gemini API key is valid.
  • Ensure both frontend and backend servers are running.
  • Check browser console for errors.

πŸ‘©πŸ½β€πŸ’» The Git Girls Team

Member Role Responsibilities
Aobakwe Modillane Frontend Developer. Web content creation and page styling.
Boikanyo Maswi Junior Developer. README.md, interactivity and user input handling, GitHub About section.
Luyanda Zuma Scrum Master. Project management, repository setup, interactivity and user input handling, documentation.
Nqobile Masombuka Fullstack Developer. Page styling, Backend Integration & API Development, Application deployment, documentation, README.md.

Made with πŸ’œ by Git Girls.

Transform your emotions into poetry. One verse at a time.

About

MuseMind is an AI-powered poem generator that transforms your thoughts and emotions into expressive poetry. Choose from one of the three themes - LoveLines, SoulScript, and MoodVerse - input your feelings, and let AI translate emotion into thoughtful art.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •