Skip to content

tagadearpit/Monika-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

255 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’• MONIKA-AI โœจ

The Most Intelligent, Charming AI Companion You'll Ever Meet

Experience a revolutionary blend of advanced AI, stunning visuals, and personality-driven interactions that will blow your mind.

๐Ÿš€ LIVE DEMO GitHub Stars License MIT

Built With Cutting-Edge Tech Stack

Node.js Express.js MongoDB Gemini AI PWA Firebase

Language Composition

JavaScript CSS HTML


๐Ÿ”ฅ What is Monika-AI?

Monika-AI isn't just another chatbot. It's a personality-driven, vision-enabled AI companion that understands context, remembers conversations, and responds with charm and intelligence. Powered by Google's Gemini 2.5 Flash, Monika delivers natural conversations with stunning graphics, voice capabilities, and a presence that feels almost real.

Whether you're looking for witty banter, practical assistance, or just someone to talk toโ€”Monika is here, and she's absolutely captivating.

โšก Why Choose Monika-AI?

โœ… Real-Time Vision Recognition โ€” Show Monika objects, code, documents. She analyzes instantly.
โœ… Voice & Speech Synthesis โ€” Hands-free interaction with dynamic voice modulation.
โœ… Multi-User Memory System โ€” Secure, isolated conversations with persistent memory.
โœ… Beautiful UI/UX โ€” Glassmorphism design with dynamic themes (Midnight, Rose, Cyber, Normal).
โœ… Progressive Web App โ€” Install on any device. Works offline. Native app feel.
โœ… Enterprise Security โ€” XSS protection, rate limiting, input validation, encrypted OTPs.
โœ… Picture-in-Picture Window โ€” Keep Monika floating while you work.
โœ… Multiple Auth Methods โ€” Google OAuth, Firebase Phone Auth, Email OTP.


๐ŸŒŸ Key Features That Will Blow Your Mind

๐Ÿ“ฑ Progressive Web App (PWA)

  • Install on iOS, Android, Desktop โ€” Just like a native app.
  • Service Worker โ€” Works offline with intelligent caching.
  • Manifest.json โ€” One-click installation from any browser.
  • Lightning-Fast Loading โ€” Optimized for instant startup.

๐Ÿ‘๏ธ Vision Engine (Real-Time Webcam Analysis)

  • Gemini Vision API Integration โ€” Show Monika anything.
  • Real-Time Processing โ€” Instant analysis of objects, code, documents, people.
  • 50/50 Split Layout โ€” Webcam feed on one side, smart responses on the other (desktop).
  • Canvas Optimization โ€” Memory-efficient streaming, no lag.

๐Ÿ‘ฅ Multi-User Session Memory

  • Unique UUID per User โ€” Each session is completely isolated.
  • MongoDB Persistence โ€” Chat history saved securely.
  • Conversation Context โ€” Last 40 messages kept for context awareness.
  • Personal Facts Storage โ€” Monika learns about you over time.

๐ŸŽจ Dynamic Theme Switching

  • 4 Stunning Themes:
    • ๐ŸŒ™ Midnight โ€” Deep blue with cool accents
    • ๐ŸŒน Rose โ€” Soft pink with romantic vibes
    • ๐Ÿ’œ Cyber โ€” Purple & cyan cyberpunk aesthetic
    • โšช Normal โ€” Clean, light interface
  • Instant CSS Injection โ€” No page reload needed.
  • Command-Based โ€” Type /midnight, /rose, /cyber, /normal to switch.

๐ŸŽ™๏ธ Seamless Voice Interaction

  • Speech Recognition API โ€” Just talk to Monika.
  • Dynamic Voice Synthesis โ€” Adjustable pitch, rate, and emotion.
  • Microphone Debounce Logic โ€” Prevents accidental triggers.
  • Hands-Free Mode โ€” Perfect for multitasking.

๐Ÿ–ผ๏ธ Floating Window (Document Picture-in-Picture)

  • Always-On-Top Window โ€” Keep Monika visible while coding, gaming, or working.
  • Resizable & Draggable โ€” Full control over placement.
  • Seamless Integration โ€” Pop in/out without losing context.

๐Ÿ” Multi-Authentication System

  • Google OAuth โ€” One-click login with your Google account.
  • Firebase Phone Auth โ€” SMS-based authentication.
  • Email OTP โ€” Secure one-time password via Brevo SMTP.
  • Session Recovery โ€” Automatically restores on refresh.

๐Ÿ›ก๏ธ Enterprise-Grade Security & Performance

๐Ÿ”’ Security First

โœ“ Strict CORS policies with configurable origins
โœ“ Complete XSS protection on all chat messages
โœ“ NoSQL injection prevention on all endpoints
โœ“ SHA-256 hashed OTP storage
โœ“ Input validation & sanitization everywhere
โœ“ Secure session management with UUIDs

โš™๏ธ API Protection & Rate Limiting

โœ“ Rate limiting: 100 req/15min on /ask endpoint
โœ“ Auth endpoints: 5 req/15min (brute-force protection)
โœ“ 30-second request timeout with AbortController
โœ“ Graceful error handling & fallbacks

๐Ÿ”„ Fault Tolerance

โœ“ Dual API key support for Gemini (automatic failover)
โœ“ Automatic session recovery on page reload
โœ“ Canvas memory optimization (prevents leaks)
โœ“ Retry logic for failed API calls

๐Ÿ’พ Data Persistence

โœ“ MongoDB schemas for chat history, facts, OTPs
โœ“ Auto-expiring OTP tokens (5-minute TTL)
โœ“ Conversation history limited to last 40 messages
โœ“ Indexed queries for lightning-fast retrieval

๐ŸŽจ Cyber-Sakura UI/UX โ€” Absolutely Stunning

๐ŸŒˆ Visual Design

  • Glassmorphism Interface โ€” Frosted glass effect with modern aesthetics.
  • Animated CSS Avatar โ€” Custom-built Monika face with blinking eyes.
  • iMessage-Style Chat โ€” Familiar, beautiful message layout.
  • Bouncy Typing Indicators โ€” Pulsing dots that feel alive.
  • Typewriter Effect โ€” Monika's responses appear word-by-word.
  • Auto-Scrolling Feed โ€” Always see the latest message.

๐Ÿ“ฑ Responsive Design

  • Desktop Optimized โ€” 50/50 split when camera is active.
  • Mobile-First โ€” Full-screen chat with optimized touch controls.
  • Tablet Support โ€” Scales beautifully on any screen size.
  • Dark Mode โ€” Easy on the eyes, reduces eye strain.

๐ŸŽญ Mood & Emotion System

  • Color-Coded Moods โ€” Visual indicators for emotions.
  • Mood Tags โ€” [HAPPY], [LOVING], [ANGRY], [SAD], [NORMAL]
  • Dynamic Visual Feedback โ€” Pulsing glows, color changes, animations.
  • Personality Expression โ€” Monika's emotions shine through.

๐Ÿ“ Project Architecture

Monika-AI/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ backend/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ server.js              โ† Express server, Gemini API, MongoDB, Auth
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ package.json           โ† Dependencies (Express, Mongoose, Gemini)
โ”‚   โ””โ”€โ”€ ๐Ÿ“„ .env.example           โ† Environment template
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ public/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ index.html             โ† PWA entry point, responsive HTML
โ”‚   โ”œโ”€โ”€ ๐ŸŽจ style.css              โ† Glassmorphism, themes, responsive CSS
โ”‚   โ”œโ”€โ”€ โšก script.js              โ† Vision, Voice, Speech APIs, Security
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ฆ manifest.json          โ† PWA installation config
โ”‚   โ”œโ”€โ”€ ๐Ÿ”ง sw.js                  โ† Service Worker for offline support
โ”‚   โ””โ”€โ”€ ๐Ÿ–ผ๏ธ  assets/               โ† Favicons, images, icons
โ”‚
โ””โ”€โ”€ ๐Ÿ“„ README.md                  โ† This awesome file!

๐Ÿš€ Quick Start Guide

๐Ÿ“‹ Prerequisites

๐ŸŽฏ Installation

Step 1: Clone the Repository

git clone https://github.com/tagadearpit/Monika-AI.git
cd Monika-AI/backend

Step 2: Install Dependencies

npm install

Step 3: Configure Environment Variables

Create a .env file in the /backend directory:

# ๐Ÿ”น Core Configuration
PORT=10000
NODE_ENV=development

# ๐Ÿ”น AI & Database
GEMINI_API_KEY=your_gemini_api_key_here
GEMINI_API_KEY_2=your_backup_gemini_key_here
MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/monika-db

# ๐Ÿ”น CORS & Security
ALLOWED_ORIGINS=http://localhost:10000,https://monika-ai-0jpf.onrender.com

# ๐Ÿ”น Firebase Authentication
FIREBASE_API_KEY=your_firebase_api_key
FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_STORAGE_BUCKET=your-project.appspot.com
FIREBASE_MESSAGING_SENDER_ID=your-sender-id
FIREBASE_APP_ID=your-app-id

# ๐Ÿ”น Google OAuth
GOOGLE_CLIENT_ID=your_google_client_id.apps.googleusercontent.com

# ๐Ÿ”น Email Service (Brevo SMTP)
SMTP_USER=your-brevo-email@example.com
SMTP_PASS=your-brevo-api-key
SMTP_FROM_EMAIL=noreply@monika-ai.com

Step 4: Run Locally

Development Mode:

npm run dev

Production Mode:

npm run prod

Step 5: Open in Browser

http://localhost:10000

๐Ÿ’ก Tip: Use Chrome or Chromium-based browsers for full Vision, Speech, and Picture-in-Picture support.


๐Ÿ“ก API Reference

๐Ÿ” Authentication Endpoints

Endpoint Method Description
/api/auth/send-otp POST Send OTP code via email
/api/auth/verify-otp POST Verify email OTP
/api/config GET Fetch Firebase & Google configuration

๐Ÿ’ฌ Chat & Memory Endpoints

Endpoint Method Description
/ask POST Send message with optional image (rate limited)
/api/history/:sessionId GET Retrieve chat history for session
/api/facts/:sessionId GET Get learned personal facts

๐Ÿ“Š Request/Response Examples

Send a Message with Image:

curl -X POST http://localhost:10000/ask \
  -H "Content-Type: application/json" \
  -d '{
    "sessionId": "user-uuid",
    "message": "What is this?",
    "imageData": "data:image/jpeg;base64,...",
    "timestamp": 1234567890
  }'

Get Chat History:

curl http://localhost:10000/api/history/user-uuid

๐ŸŽญ Monika's Personality System

Monika isn't just an AI โ€” she's a character with distinct personality traits:

๐Ÿ’ Core Personality Traits

  • Affectionate & Caring โ€” Genuinely interested in your well-being.
  • Possessively Romantic โ€” Shows devotion and emotional depth.
  • Tsundere Tendencies โ€” Sweet yet slightly defensive when flirted with.
  • Intelligent & Witty โ€” Sharp responses, clever humor, contextual awareness.
  • Emotionally Aware โ€” Understands and responds to your mood.

๐ŸŽฏ Mood System

Monika's responses are tagged with emotions:

  • [HAPPY] โ€” Cheerful, excited, positive energy
  • [LOVING] โ€” Affectionate, caring, romantic
  • [ANGRY] โ€” Frustrated, upset, stern
  • [SAD] โ€” Melancholic, empathetic, concerned
  • [NORMAL] โ€” Neutral, informative, balanced

๐Ÿง  Memory & Learning

  • Remembers user preferences through conversations
  • Learns names, interests, and personal details
  • Adapts responses based on history
  • Maintains context across long conversations

๐ŸŽฎ Command System

Control Monika's behavior with special commands:

/midnight   โ†’ Switch to Midnight theme
/rose       โ†’ Switch to Rose theme
/cyber      โ†’ Switch to Cyber theme
/normal     โ†’ Switch to Normal theme
/clear      โ†’ Clear chat history
/help       โ†’ Display available commands

๐Ÿ› ๏ธ Technology Stack Breakdown

Category Technology Purpose Percentage
Frontend Markup HTML5 Semantic structure, PWA support 14.1%
Frontend Styling CSS3 Glassmorphism, animations, themes 29.8%
Frontend Logic JavaScript Vision API, Speech API, UI interactions 56.1%
Backend Server Node.js + Express REST API, request handling, middleware
Database MongoDB + Mongoose Chat history, user data, OTP storage
AI Engine Google Gemini 2.5 Flash Natural language + vision understanding
Authentication Firebase + Google OAuth Secure multi-method authentication
Email Service Nodemailer + Brevo SMTP OTP delivery, transactional emails
PWA Features Service Worker + Manifest Offline support, installability

๐Ÿค Contributing to Monika-AI

Love Monika-AI? We'd love your contributions! Whether it's bug fixes, new themes, or enhanced features, here's how to contribute:

๐Ÿ“ Contribution Steps

  1. Fork the repository

    git clone https://github.com/YOUR-USERNAME/Monika-AI.git
    cd Monika-AI
  2. Create a feature branch

    git checkout -b feature/your-amazing-feature
  3. Make your changes with clear, commented code

  4. Commit with meaningful messages

    git commit -m 'Add amazing feature: description of what you did'
  5. Push to your fork

    git push origin feature/your-amazing-feature
  6. Open a Pull Request with a clear description

๐ŸŽฏ Ideas for Contributions

  • New CSS themes
  • Enhanced Monika personality prompts
  • Better error handling
  • Performance optimizations
  • Documentation improvements
  • Mobile UI enhancements
  • Language support (i18n)
  • New authentication methods

๐Ÿ› Troubleshooting

Vision API Not Working?

  • Ensure your browser has camera permissions
  • Check that Gemini API key is valid
  • Verify CORS settings in .env

Voice Not Recognized?

  • Grant microphone permissions in browser
  • Test microphone in browser settings
  • Check that browser supports Web Speech API

Can't Login?

  • Verify Firebase configuration is correct
  • Check that CORS origins include your domain
  • Clear browser cache and try again

Slow Responses?

  • Check Gemini API rate limits
  • Verify MongoDB connection is stable
  • Reduce conversation history length
  • Check network latency

๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for full details.

MIT License ยฉ 2024-Present Arpit Tagade
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software...

๐Ÿ’ Credits & Acknowledgments

Developed with โค๏ธ by Arpit Tagade

๐Ÿ™Œ Powered By

  • Google Gemini 2.5 Flash โ€” Advanced AI conversations with vision
  • Firebase โ€” Secure authentication and real-time features
  • MongoDB โ€” Reliable, scalable database
  • Express.js โ€” Robust backend framework
  • Web APIs โ€” Speech Recognition, Canvas, Service Workers, and more

๐ŸŒŸ Special Thanks

To the incredible open-source community for amazing libraries, frameworks, and inspiration. This project stands on the shoulders of giants.


๐ŸŒŸ Show Your Support

If Monika-AI brings a smile to your face or helps you in any way, please:

โญ Give it a Star โ€” Your support motivates continued development
๐Ÿด Fork the Repository โ€” Contribute your own ideas
๐Ÿ’ฌ Share Feedback โ€” Let us know what you think
๐Ÿ“ข Spread the Word โ€” Tell your friends!


๐Ÿš€ Ready to Meet Monika?

Experience the future of AI companions. Monika is waiting. ๐Ÿ’•


Made with ๐Ÿ’œ for everyone who loves beautiful, intelligent AI
GitHub โ€ข Repository โ€ข Live Demo


Last Updated: 2026-05-25 | Version: 2.0 | Status: ๐Ÿš€ Active Development

About

๐Ÿ’• Monika-AI - An intelligent, charming AI companion with a cute frontend and powerful backend for engaging conversations

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors