Skip to content

A Gen AI project for content generation using OpenAI, it crafts custom jokes, Shayari, and stories based on your keywords. It's easy to use, learns from you, and values your privacy. If you want a quick laugh, personalized poetry, or a unique story, it's your simple, go-to tool for adding a touch of fun.

Notifications You must be signed in to change notification settings

DevnandanRaj/ContentGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Creative AI Studio - ContentGenerator 🎨✨

Full-Stack AI-Powered Creative Content Generator

Transform your keywords into engaging content with the power of Google Gemini AI. Creative AI Studio is a modern React application with a Node.js backend that creates personalized jokes, Shayari, stories, and much more on demand.

React Chakra UI Node.js Google Gemini


✨ Features

🎨 Content Generation

  • 14+ Content Types - Jokes, Shayari, Stories, Riddles, Pickup Lines, Roasts, Compliments, Dad Jokes, Haiku, Rap Lyrics, Tweet Threads, Acrostic Poems, Motivational Speeches, and Quotes
  • Tone Customization - Choose from Funny, Serious, Romantic, or Motivational tones
  • Length Control - Short, Medium, or Long output options
  • Trending Topics - Quick-start with curated keyword suggestions

🎯 User Experience

  • Modern UI - Beautiful gradient designs with smooth animations
  • Dark Mode - Toggle between light and dark themes
  • History Tracking - Save and revisit your last 50 generations
  • Quick Actions - Copy, Download, and Share generated content
  • Responsive Design - Works perfectly on desktop, tablet, and mobile
  • Confetti Celebrations - Fun animations on successful generation

⚑ Performance & Security

  • Rate Limiting - Protection against API abuse (100 requests per 15 minutes)
  • Error Handling - Comprehensive error messages and user feedback
  • Local Storage - Client-side history and preferences
  • Fast API - Optimized backend responses with Gemini 2.5 Flash

πŸ› οΈ Tech Stack

Frontend

  • React 18.2.0 - UI framework
  • Chakra UI 2.8.1 - Component library
  • Framer Motion 12.x - Smooth animations
  • React Icons 5.x - Icon library
  • React Confetti 6.x - Celebration effects
  • Axios 1.5.1 - API requests

Backend

  • Node.js + Express.js - Server framework
  • Google Gemini API (2.5 Flash) - AI content generation
  • Helmet - Security headers
  • CORS - Cross-origin resource sharing
  • Express Rate Limit - API rate limiting
  • dotenv - Environment configuration

πŸ“‹ Prerequisites

  • Node.js (v14.0.0 or higher)
  • npm (v6.0.0 or higher)
  • Google Gemini API Key (Get one free here)

πŸš€ Quick Start

1. Clone the Repository

git clone https://github.com/yourusername/ContentGenerator.git
cd ContentGenerator

2. Setup Backend

cd backend
npm install

Create a .env file in the backend directory:

GEMINI_API_KEY=your_gemini_api_key_here
PORT=5000

Start the backend server:

npm start

The backend will run on http://localhost:5000

3. Setup Frontend

Open a new terminal in the project root:

npm install

Create a .env file in the root directory:

REACT_APP_API_URL=http://localhost:5000

Start the React app:

npm start

The app will open at http://localhost:3000


πŸ“– Usage

  1. Select Content Type - Choose from 14+ content types (jokes, stories, quotes, etc.)
  2. Enter Keyword - Type your keyword or click a trending topic
  3. Customize - Select tone (funny, serious, romantic, motivational) and length (short, medium, long)
  4. Generate - Click the ✨ Generate button
  5. Enjoy - Copy, download, or share your AI-generated content!

🎯 Content Types

Type Description Icon
Shayari Urdu/Hindi poetry with elegant verses πŸ“œ
Joke Clever and witty humor πŸ˜‚
Quote Inspirational and meaningful quotes πŸ’­
Story Engaging short narratives πŸ“–
Riddle Brain teasers with answers πŸ€”
Pickup Line Charming and respectful lines πŸ’˜
Roast Playful, light-hearted roasts πŸ”₯
Compliment Genuine and heartwarming compliments 🌟
Dad Joke Classic pun-based humor πŸ‘¨
Haiku Traditional 5-7-5 syllable poems πŸŽ‹
Rap Lyrics Rhyming verses with wordplay 🎀
Tweet Thread Engaging social media threads 🐦
Acrostic Poems where first letters spell words ✍️
Motivational Speech Powerful and inspiring speeches πŸ’ͺ

πŸ“ Project Structure

ContentGenerator/
β”œβ”€β”€ backend/                    # Node.js Express backend
β”‚   β”œβ”€β”€ server.js              # Main server file
β”‚   β”œβ”€β”€ package.json           # Backend dependencies
β”‚   β”œβ”€β”€ .env                   # Environment variables (Gemini API key)
β”‚   └── README.md              # Backend documentation
β”œβ”€β”€ src/                       # React frontend source
β”‚   β”œβ”€β”€ Components/            # React components
β”‚   β”‚   β”œβ”€β”€ Content.jsx       # Main content generator
β”‚   β”‚   β”œβ”€β”€ ContentCard.jsx   # Generated content display
β”‚   β”‚   β”œβ”€β”€ Header.jsx        # App header with branding
β”‚   β”‚   β”œβ”€β”€ HistorySidebar.jsx # Generation history panel
β”‚   β”‚   └── Footer.jsx        # App footer
β”‚   β”œβ”€β”€ hooks/                # Custom React hooks
β”‚   β”‚   └── useLocalStorage.js # localStorage hook
β”‚   β”œβ”€β”€ utils/                # Utility functions
β”‚   β”‚   β”œβ”€β”€ animations.js     # Framer Motion configs
β”‚   β”‚   └── constants.js      # App constants
β”‚   β”œβ”€β”€ App.js                # Main app component
β”‚   β”œβ”€β”€ App.css               # App styles
β”‚   β”œβ”€β”€ index.js              # React entry point
β”‚   └── index.css             # Global styles
β”œβ”€β”€ public/                    # Public assets
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ favicon.ico
β”‚   └── manifest.json
β”œβ”€β”€ .env                       # Frontend env (API URL)
β”œβ”€β”€ package.json               # Frontend dependencies
└── README.md                  # This file

🌐 API Endpoints

Backend API

Base URL: http://localhost:5000

POST /api/generate

Generate content based on parameters.

Request Body:

{
  "type": "joke",
  "keyword": "programming",
  "tone": "funny",
  "length": "short"
}

Response:

{
  "success": true,
  "result": "Generated content here...",
  "metadata": {
    "type": "joke",
    "keyword": "programming",
    "tone": "funny",
    "length": "short",
    "model": "gemini-2.5-flash",
    "timestamp": "2025-12-15T13:00:00.000Z"
  }
}

GET /api/content-types

Get all available content types.

GET /api/health

Health check endpoint.

GET /

API information and available endpoints.


🎨 Customization

Adding New Content Types

Edit backend/server.js and add to the contentConfigs object:

'your-type': {
  systemPrompt: 'System instruction for AI...',
  userPromptTemplate: (keyword, tone, length) =>
    `Generate ${tone} content about "${keyword}". Length: ${length}.`
}

Changing Themes

Modify colors in src/index.css or update Chakra UI theme in src/index.js.


πŸ”§ Environment Variables

Backend (.env in backend/)

GEMINI_API_KEY=your_google_gemini_api_key
PORT=5000
NODE_ENV=development

Frontend (.env in root)

REACT_APP_API_URL=http://localhost:5000

πŸš€ Deployment

Frontend (Netlify/Vercel)

  1. Build the frontend: npm run build
  2. Deploy the build folder
  3. Set environment variable: REACT_APP_API_URL=your_backend_url

Backend (Render/Heroku)

  1. Deploy backend folder
  2. Set environment variables:
    • GEMINI_API_KEY
    • PORT (usually auto-set)
  3. Note the deployed URL and update frontend env

πŸ› Troubleshooting

API Key Issues

  • Ensure your Gemini API key is valid at Google AI Studio
  • Check that the .env file is in the correct location
  • Restart the backend server after updating .env

CORS Errors

  • Verify backend is running on port 5000
  • Check REACT_APP_API_URL in frontend .env
  • Ensure both servers are running

Rate Limit Errors

  • Wait a few moments between requests (free tier has limits)
  • The app enforces 100 requests per 15 minutes per IP

πŸ“ License

This project is open source and available under the MIT License.


πŸ™ Acknowledgments


πŸ“§ Support

For issues and questions:


Made with ❀️ and AI ✨
Powered by Google Gemini 2.5 Flash

About

A Gen AI project for content generation using OpenAI, it crafts custom jokes, Shayari, and stories based on your keywords. It's easy to use, learns from you, and values your privacy. If you want a quick laugh, personalized poetry, or a unique story, it's your simple, go-to tool for adding a touch of fun.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published