Skip to content

Latest commit

Β 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 Media Mate

Your Ultimate Entertainment Companion - A comprehensive web application for discovering, tracking, and getting personalized recommendations for movies, web series, music, and books.

🌟 Features

🎯 Core Functionality

  • Smart Recommendations: Hybrid recommendation system combining local machine learning models with Google Gemini AI
  • Multi-Media Support: Movies, Web Series, Music, and Books
  • User Authentication: Secure Firebase authentication with email/password
  • Personal Favorites: Save and manage your favorite media across all categories
  • Watchlist: Add items to your watchlist for later viewing
  • Chatbot Assistant: AI-powered chatbot to help you navigate and find content

πŸ€– Advanced Recommendation Engine

The recommendation system uses a hybrid approach:

  1. Local ML Models: Content-based filtering using similarity matrices

    • 4,806 movies
    • 12,109 web series
    • 5,000 songs
    • 243 books
  2. AI Fallback: Google Gemini AI provides recommendations when items aren't in the local database

  3. Intelligent Processing:

    • Processes each favorite individually
    • Requests 5 recommendations per favorite
    • Filters out duplicates and favorites from results
    • Returns 9 unique recommendations per category

πŸ“Š Data Sources & APIs

  • OMDB API: Movie and TV show details
  • Spotify API: Music tracks and albums
  • Google Books API: Book information
  • Google Gemini AI: AI-powered recommendations
  • Firebase: Authentication and database

πŸš€ Getting Started

Prerequisites

- Firebase account (for backend)
- API Keys (see Configuration section)

Installation

  1. Clone the repository
git clone https://github.com/watcher2105/Media_Mate.git
cd Media_Mate
  1. Configure API Keys

Edit config.js and add your API keys:

const API_CONFIG = {
    OMDB_API_KEY: 'your_omdb_key',
    SPOTIFY_CLIENT_ID: 'your_spotify_client_id',
    SPOTIFY_CLIENT_SECRET: 'your_spotify_client_secret',
    GEMINI_API_KEY: 'your_gemini_api_key',
    FIREBASE_CONFIG: {
        apiKey: 'your_firebase_api_key',
        authDomain: 'your_app.firebaseapp.com',
        databaseURL: 'https://your_app.firebaseio.com',
        projectId: 'your_project_id',
        storageBucket: 'your_app.appspot.com',
        messagingSenderId: 'your_sender_id',
        appId: 'your_app_id'
    }
};
  1. Get API Keys
  1. Run the application
# Using Python's built-in server
python -m http.server 8000

# Or using Node.js http-server
npx http-server -p 8000

# Or using Five Server (VS Code extension)
# Right-click on index.html -> "Open with Five Server"

πŸ“ Project Structure

Media_Mate/
β”œβ”€β”€ index.html                      # Landing page
β”œβ”€β”€ login.html                      # Login page
β”œβ”€β”€ signup.html                     # Registration page
β”œβ”€β”€ main.html                       # Main application dashboard
β”œβ”€β”€ profile.html                    # User profile management
β”œβ”€β”€ favourite.html                  # Favorites selection
β”œβ”€β”€ recommendations-movies.html     # Movie recommendations
β”œβ”€β”€ recommendations-series.html     # Web series recommendations
β”œβ”€β”€ recommendations-music.html      # Music recommendations
β”œβ”€β”€ recommendations-books.html      # Book recommendations
β”œβ”€β”€ chatbot.html                   # AI chatbot interface
β”œβ”€β”€ about.html                     # About page
β”œβ”€β”€ config.js                      # API configuration
β”œβ”€β”€ recomandation system/
β”‚   β”œβ”€β”€ Movie Recommedation/
β”‚   β”‚   β”œβ”€β”€ movies.json           # Movie dataset (4,806 movies)
β”‚   β”‚   β”œβ”€β”€ similarity.json       # Similarity matrix
β”‚   β”‚   └── movie-recommender.js  # Movie recommendation engine
β”‚   β”œβ”€β”€ Webseries Recommendation/
β”‚   β”‚   β”œβ”€β”€ shows.json            # Web series dataset (12,109 shows)
β”‚   β”‚   β”œβ”€β”€ shows_similarity.json # Similarity matrix
β”‚   β”‚   └── webseries-recommender.js
β”‚   β”œβ”€β”€ Music Recomendation/
β”‚   β”‚   β”œβ”€β”€ data.json             # Music dataset (5,000 songs)
β”‚   β”‚   β”œβ”€β”€ similarity.json       # Similarity matrix
β”‚   β”‚   └── music-recommender.js
β”‚   └── Book Recomendation/
β”‚       β”œβ”€β”€ books.json            # Books dataset (243 books)
β”‚       β”œβ”€β”€ similarity.json       # Similarity matrix
β”‚       └── book-recommender.js
β”œβ”€β”€ Jupyter Files Recomendation system/
β”‚   β”œβ”€β”€ Movie Recommedation/
β”‚   β”‚   └── Recomandation system content based.ipynb
β”‚   β”œβ”€β”€ Webseries Recommendation/
β”‚   β”‚   └── Recomandation system content based.ipynb
β”‚   β”œβ”€β”€ Music Recomendation/
β”‚   β”‚   └── Recomandation system content based.ipynb
β”‚   └── Book Recomendation/
β”‚       └── Recomandation system content based.ipynb
β”œβ”€β”€ README.md                      # This file
β”œβ”€β”€ LICENSE                        # MIT License
└── RECOMMENDATION_INTEGRATION.md  # Integration guide

🎨 Key Technologies

Frontend

  • HTML5/CSS3: Modern, responsive UI
  • JavaScript (ES6+): Core application logic
  • Anime.js: Smooth animations
  • Font Awesome: Icon library

Backend & Services

  • Firebase Authentication: User management
  • Firebase Realtime Database: Data storage
  • REST APIs: External data fetching

Machine Learning

  • Content-Based Filtering: Similarity matrices
  • Cosine Similarity: Recommendation scoring
  • Hybrid AI System: ML + Gemini AI
  • Python/Jupyter: Data processing and model training
  • Scikit-learn: Machine learning library for similarity computation

πŸ”§ Configuration

Firebase Setup

  1. Create a Firebase project at https://console.firebase.google.com/
  2. Enable Authentication (Email/Password)
  3. Enable Realtime Database
  4. Update security rules:
{
  "rules": {
    "users": {
      "$uid": {
        ".read": "$uid === auth.uid",
        ".write": "$uid === auth.uid"
      }
    }
  }
}

API Rate Limits

  • OMDB: 1,000 requests/day (free tier)
  • Spotify: 10,000 requests/day
  • Google Books: 1,000 requests/day
  • Gemini AI: Varies by tier

🎯 How It Works

Recommendation Flow

User selects favorites
        ↓
For each favorite:
        ↓
    Try local ML model
        ↓
    Found in database? ──Yes──→ Get 5 similar items
        ↓ No
    Use Gemini AI ──→ Get AI recommendations
        ↓
Combine all recommendations
        ↓
Remove duplicates & favorites
        ↓
Fetch details from APIs (OMDB/Spotify/Books)
        ↓
Display 9 unique recommendations

Hybrid Recommendation Algorithm

1. Process each favorite individually
2. Request 5 recommendations per favorite
3. Filter out items that match user's favorites
4. Fetch full details from external APIs
5. Remove duplicates by title (case-insensitive)
6. Limit to 9 final recommendations
7. Display with fallback placeholders for missing images

πŸ“š Jupyter Notebooks & Dataset Expansion

About the Jupyter Notebooks

The Jupyter Files Recomendation system/ folder contains Python notebooks that:

  • Load and preprocess media datasets
  • Calculate similarity matrices using cosine similarity
  • Generate .pkl (pickle) files for models
  • Convert models to JSON format for web use

Expanding the Dataset

To increase the dataset and regenerate recommendation models:

Prerequisites

pip install pandas numpy scikit-learn jupyter

Steps to Expand Dataset

1. Prepare Your Data

For Movies: Create a CSV with columns: id, original_title, overview, genre, keywords, cast, crew

For Web Series: CSV with: id, title, overview, genre, cast, network

For Music: CSV with: artist, song, text (lyrics)

For Books: CSV with: title, author, genre, description

2. Run Jupyter Notebooks

# Navigate to the appropriate folder
cd "Jupyter Files Recomendation system/Movie Recommedation"

# Launch Jupyter
jupyter notebook

3. Update Dataset in Notebook

In each notebook:

  • Locate the data loading cell
  • Replace the dataset file path with your new CSV
  • Run all cells sequentially

4. Convert PKL to JSON

Add this cell at the end of each notebook:

import json
import pickle

# Load the pickle files
with open('movies.pkl', 'rb') as f:
    movies = pickle.load(f)
    
with open('similarity.pkl', 'rb') as f:
    similarity = pickle.load(f)

# Convert to JSON-serializable format
movies_json = movies.to_dict('records')  # For pandas DataFrame
similarity_json = similarity.tolist()     # For numpy array

# Save as JSON
with open('../../recomandation system/Movie Recommedation/movies.json', 'w') as f:
    json.dump(movies_json, f)
    
with open('../../recomandation system/Movie Recommedation/similarity.json', 'w') as f:
    json.dump(similarity_json, f)

print("Successfully converted PKL to JSON!")

5. Verify the Output

Check that the JSON files are created in the recomandation system/ folder:

  • movies.json or shows.json or data.json or books.json
  • similarity.json or shows_similarity.json

6. Restart the Application

Reload the web app to use the new expanded dataset.

Dataset Size Recommendations

  • Minimum: 100 items per category
  • Optimal: 1,000 - 10,000 items
  • Maximum: Limited by browser memory (~50MB JSON)

Performance Considerations

  • Larger datasets = longer initial load time
  • Similarity matrices grow exponentially (NΓ—N)
  • Consider splitting very large datasets into chunks
  • Use lazy loading for datasets > 10,000 items

πŸ› Troubleshooting

Common Issues

1. API Key Errors (401 Unauthorized)

  • Solution: Update your API keys in config.js
  • OMDB keys expire - get a new one from omdbapi.com

2. Images Not Loading (404 errors)

  • Automatic fallback to placeholder images is implemented
  • Check browser console for CORS issues

3. Recommendations Not Showing

  • Ensure you've added favorites
  • Check browser console for API errors
  • Verify Firebase connection

4. Browser Cache Issues

  • Hard refresh: Ctrl + Shift + R (Windows/Linux) or Cmd + Shift + R (Mac)
  • Clear browser cache
  • Open in incognito/private mode

5. CORS Errors

  • Multi-tier proxy fallback is implemented
  • Check if external APIs are accessible

πŸ“Š Performance

  • Initial Load: ~2-3 seconds
  • Recommendation Generation: ~3-5 seconds
  • API Fetch Time: ~1-2 seconds per item
  • Total Dataset Size: ~30MB (JSON files)

πŸ”’ Security

  • Firebase Authentication for user management
  • Secure API key storage (move to backend in production)
  • Input sanitization to prevent XSS
  • HTTPS recommended for production deployment

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

What This Means

βœ… You CAN:

  • Use this project for personal or commercial purposes
  • Modify and distribute the code
  • Use it in private projects
  • Sublicense the code

❌ You CANNOT:

  • Hold the authors liable for damages
  • Use the authors' names for endorsement

πŸ“‹ You MUST:

  • Include the original copyright notice
  • Include the license text in distributions

Third-Party Licenses

This project uses external APIs and services:

  • OMDB API: Subject to OMDB terms of service
  • Spotify API: Subject to Spotify Developer terms
  • Google Books API: Subject to Google API terms
  • Google Gemini AI: Subject to Google AI terms
  • Firebase: Subject to Google Firebase terms

Please review each service's terms before deployment.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages