Skip to content
gyanesh-mauryaPublic

About

Flirtina is a flirty, emotionally engaging virtual girlfriend AI chatbot. It uses the Gemini API to generate intelligent, playful, and affectionate responses, designed to simulate lighthearted romantic conversations. Experience the charm of AI companionship with a modern, secure, and responsive web interface.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

3 Commits

Folders and files

Repository files navigation

πŸ’– Flirtina - AI Companion with Image Generation

Flirtina Banner

React Vite JavaScript Netlify

✨ Your AI Companion for Conversations & Visual Creativity ✨

Experience the future of AI companionship with intelligent conversations and stunning image generation

πŸš€ Live Demo β€’ πŸ“– Documentation β€’ 🀝 Contribute


Flirtina is a flirty, emotionally engaging virtual girlfriend AI chatbot created by Gyanesh Maurya. It uses the Gemini API to generate intelligent, playful, and affectionate responses, plus AI-powered image generation to bring your imagination to life. Experience the charm of AI companionship with a modern, secure, and responsive web interface.

πŸš€ Key Features

πŸ’­ Intelligent Conversations

  • 🧠 Context-Aware Responses - Remembers conversation history
  • πŸ’• Emotional Intelligence - Adapts tone to match your mood
  • ⚑ Real-Time Typing - Realistic typing animations
  • πŸ“ Rich Text Support - Markdown formatting for better readability
  • 🎭 Personality-Driven - Flirty, engaging, and emotionally responsive

🎨 AI Image Generation

  • πŸ–ΌοΈ FLUX.1-dev Integration - State-of-the-art image generation
  • πŸ’Ύ Download Options - Save generated images locally
  • 🎯 Smart Prompting - Optimized for best results

πŸ›‘οΈ Security & Performance

  • πŸ” Zero API Exposure - All keys secured server-side
  • ⚑ Lightning Fast - Optimized with Vite and modern architecture
  • πŸ“± Fully Responsive - Perfect experience on any device
  • πŸŒ™ Theme Support - Beautiful dark/light themes
  • πŸ’Ύ Persistent Storage - Your conversations are saved locally

πŸ› οΈ Technology Stack

Frontend Backend AI Services
React 18 Netlify Functions Google Gemini AI
Vite 5 Node.js Hugging Face FLUX
Modern CSS3 Serverless Image Generation
ES6+ JavaScript RESTful APIs Context Memory

πŸ”’ Security Architecture

Our security-first approach ensures your API keys are never exposed:

🌐 Browser β†’ οΏ½ Netlify Function β†’ πŸ€– Gemini AI
    ↑              ↑                    ↑
 No API Key    Secure Proxy        AI Processing
  • Zero Client Exposure: API keys never reach the browser
  • Serverless Security: All API calls proxied through Netlify functions
  • Environment Protection: Keys stored in secure Netlify environment
  • CORS Compliance: Proper cross-origin request handling

πŸš€ Quick Start

🌐 Deploy to Netlify (1-Click Deploy)

Deploy to Netlify

  1. Click the deploy button above
  2. Connect your GitHub account
  3. Configure environment variables:
    VITE_GEMINI_API_KEY=your_gemini_api_key_here
    HUGGING_FACE_API_KEY=your_hugging_face_api_key_here
  4. Get API Keys:
  5. Deploy - Your site will be live in minutes!

🌐 Deploy to Netlify (Recommended)

  1. Fork this repository to your GitHub account

  2. Connect to Netlify:

    • Go to Netlify and sign in
    • Click "New site from Git"
    • Choose your forked repository
  3. Configure build settings:

    Build command: npm run build
    Publish directory: dist
    Functions directory: netlify/functions
    
  4. Set environment variables:

    • Go to Site settings β†’ Environment variables
    • Add: VITE_GEMINI_API_KEY = your_gemini_api_key_here
    • Add: HUGGING_FACE_API_KEY = your_hugging_face_api_key_here
    • Get Gemini API key from Google AI Studio
    • Get Hugging Face API key from Hugging Face Settings
  5. Deploy: Your site will be live in minutes!

πŸ’» Local Development

# Clone the repository
git clone https://github.com/gyanesh-maurya/Flirtina.git
cd Flirtina

# Install dependencies
npm install

# Create environment file
# πŸ”‘ Create environment file
echo "VITE_GEMINI_API_KEY=your_api_key_here" > .env.local
echo "HUGGING_FACE_API_KEY=your_hf_api_key_here" >> .env.local

# Start development server
npm run dev

# Open http://localhost:5173 in your browser

πŸ“¦ Available Scripts

npm run dev        # Start development server
npm run build      # Build for production
npm run preview    # Preview production build
npm run lint       # Run ESLint

πŸ”§ Environment Setup

For local development, create a .env.local file:

VITE_GEMINI_API_KEY=your_actual_api_key_here
HUGGING_FACE_API_KEY=your_actual_hf_api_key_here

πŸ“ Project Structure

Clean, organized, and scalable architecture

πŸŽ€ Flirtina/
β”œβ”€β”€ πŸ“ src/
β”‚   β”œβ”€β”€ πŸ“ components/          # 🧩 React UI components
β”‚   β”‚   β”œβ”€β”€ ChatInput.jsx       # ✍️  Message input component with image mode
β”‚   β”‚   β”œβ”€β”€ ChatMessages.jsx    # πŸ’¬ Chat message display container
β”‚   β”‚   β”œβ”€β”€ ConfirmationModal.jsx # βœ… Confirmation dialogs
β”‚   β”‚   β”œβ”€β”€ GeneratedImage.jsx  # πŸ–ΌοΈ  AI-generated image display component
β”‚   β”‚   β”œβ”€β”€ Header.jsx          # 🎯 App header with theme toggle
β”‚   β”‚   β”œβ”€β”€ Message.jsx         # πŸ’Œ Individual message component
β”‚   β”‚   β”œβ”€β”€ Preloader.css       # 🎨 Loading animation styles
β”‚   β”‚   β”œβ”€β”€ Preloader.jsx       # ⏳ Loading animations
β”‚   β”‚   β”œβ”€β”€ Sidebar.jsx         # πŸ“‹ Chat sidebar navigation
β”‚   β”‚   └── ThinkingIndicator.jsx # πŸ€” AI typing animation
β”‚   β”œβ”€β”€ πŸ“ hooks/               # πŸͺ Custom React hooks
β”‚   β”‚   β”œβ”€β”€ useChatApp.js       # πŸ’­ Main chat logic and state management
β”‚   β”‚   β”œβ”€β”€ usePreloader.js     # ⚑ Loading state management
β”‚   β”‚   └── useTheme.js         # 🎨 Theme management (dark/light)
β”‚   β”œβ”€β”€ πŸ“ services/            # πŸ”Œ API communication layer
β”‚   β”‚   β”œβ”€β”€ geminiAPI.js        # πŸ€– Chat API calls to Gemini
β”‚   β”‚   └── imageGenerationAPI.js # πŸ–ΌοΈ  Image generation API service
β”‚   β”œβ”€β”€ πŸ“ utils/               # πŸ› οΈ  Helper functions
β”‚   β”‚   └── messageUtils.js     # πŸ“ Message processing utilities
β”‚   β”œβ”€β”€ App.jsx                 # πŸŽͺ Main application component
β”‚   β”œβ”€β”€ App.css                 # πŸ’… Application styles
β”‚   β”œβ”€β”€ main.jsx                # πŸš€ React application entry point
β”‚   └── index.css               # 🌍 Global styles and CSS variables
β”œβ”€β”€ πŸ“ netlify/
β”‚   └── πŸ“ functions/           # ⚑ Serverless functions
β”‚       β”œβ”€β”€ chat.js             # πŸ’¬ Chat serverless API function
β”‚       └── image-generation.js # πŸ–ΌοΈ  Image generation serverless function
β”œβ”€β”€ πŸ“ public/                  # πŸ“‚ Static assets
β”‚   β”œβ”€β”€ favicon.svg             # 🎭 App favicon
β”‚   β”œβ”€β”€ logo.png                # 🏷️  Application logo
β”‚   └── main-logo.png           # 🌟 Main branding logo
β”œβ”€β”€ index.html                  # πŸ“„ HTML template
β”œβ”€β”€ package.json                # πŸ“¦ Dependencies and scripts
β”œβ”€β”€ vite.config.js              # βš™οΈ  Vite build configuration
β”œβ”€β”€ netlify.toml                # 🌐 Netlify deployment configuration
└── README.md                   # πŸ“– Project documentation

🎨 AI Image Generation

Flirtina includes powerful AI image generation capabilities! Simply toggle the image mode in the chat input and describe what you want to create.

✨ Features

  • Natural Language Prompts: Describe your image in plain English
  • High Quality: Generates High Quality pixel images
  • Download Support: Click any generated image to view full-size or download
  • Smart Fallbacks: Graceful handling when services are temporarily unavailable

πŸ–ΌοΈ How to Generate Images

  1. Toggle Image Mode: Click the image icon (🎨) in the chat input
  2. Describe Your Vision: Type what you want to see (e.g., "a beautiful sunset over mountains")
  3. Wait for Magic: Flirtina will generate your image using AI
  4. View & Download: Click the generated image to view full-size or download

πŸ’‘ Example Prompts

πŸŒ… A romantic sunset scene with roses
🎨 Abstract art with pink and purple colors
🐱 A cute kitten playing with yarn
πŸ”οΈ Majestic mountain landscape at dawn
✨ Fantasy magical forest with glowing lights

πŸ’‘ How Flirtina Works

  1. πŸ’¬ User Interaction: You type a message to Flirtina or request image generation
  2. πŸš€ Secure Transmission: Message sent to Netlify serverless function
  3. 🧠 AI Processing: Gemini AI generates a flirty, contextual response
  4. 🎨 Image Creation: AI-powered image generation from natural language prompts
  5. ✨ Response Delivery: AI response streams back with typing animation
  6. πŸ’Ύ Memory: Conversation history maintained for context

πŸ“‘ API Architecture

Serverless Function Endpoint

POST /.netlify/functions/chat

Request Body:
{
  "message": "Your message to Flirtina",
  "messageHistory": [
    { "role": "user", "content": "Previous message" },
    { "role": "assistant", "content": "Previous response" }
  ]
}

Response:
{
  "response": "Flirtina's flirty AI response"
}

🀝 Contributing

We welcome contributions to make Flirtina even more charming! Here's how you can help:

οΏ½ Bug Reports

  • Found a bug? Open an issue
  • Include steps to reproduce and your environment details

✨ Feature Requests

  • Have ideas for new features? Start a discussion
  • Suggest personality improvements or new conversation topics

πŸ”§ Development Workflow

  1. Fork & Clone

    git clone https://github.com/YOUR_USERNAME/Flirtina.git
    cd Flirtina
  2. Setup Development Environment

    npm install
    echo "VITE_GEMINI_API_KEY=your_api_key" > .env.local
    echo "HUGGING_FACE_API_KEY=your_hf_api_key" >> .env.local
  3. Create Feature Branch

    git checkout -b feature/your-amazing-feature
  4. Develop & Test

    npm run dev    # Start development server
    npm run lint   # Check code style
    npm run build  # Test production build
  5. Submit Pull Request

    • Write clear commit messages
    • Include tests if applicable
    • Update documentation if needed

πŸ“‹ Contribution Guidelines

  • Code Style: Follow existing patterns and ESLint rules
  • Commits: Use conventional commit messages
  • Testing: Test your changes thoroughly
  • Documentation: Update README if you add features

οΏ½πŸ‘¨β€πŸ’» Creator

Gyanesh Maurya

Made with πŸ’– by Gyanesh Maurya

Experience the future of AI companionship with Flirtina ✨

⭐ Star this repo β€’ πŸ› Report Bug β€’ πŸ’‘ Request Feature

About

Flirtina is a flirty, emotionally engaging virtual girlfriend AI chatbot. It uses the Gemini API to generate intelligent, playful, and affectionate responses, designed to simulate lighthearted romantic conversations. Experience the charm of AI companionship with a modern, secure, and responsive web interface.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Contributors

Languages