Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Watchapedia API

Watchapedia ERD

Project Overview

Watchapedia API is a RESTful API service that analyzes movie information and user preferences. It provides personalized movie recommendations and statistics by analyzing users' movie viewing history, ratings, and preferences.

Technical Highlights

Advanced SQL Analytics

  • Complex user preference analysis using window functions (PERCENT_RANK)
  • Sophisticated rating calculations with weighted scoring
  • Multi-table joins for comprehensive movie metadata analysis
  • Subquery optimization for performance

Smart Recommendation System

  • Weighted scoring algorithm for actor/director preferences
  • Genre and country preference analysis with normalized scores
  • User style classification based on rating patterns
  • Personalized movie recommendations based on viewing history

Performance Optimizations

  • Efficient database connection pooling
  • Query parameterization for security and performance
  • Optimized JOIN operations for complex queries
  • Smart caching of frequently accessed data

Key Features

1. Home API (/home/<user_id>)

  • Box office movie recommendations
  • Recent review history
  • Movies from favorite directors
  • Movies from favorite actors

2. Preference Analysis API (/preference/<user_id>)

  • Movie rating statistics
  • Rating distribution analysis
  • Preferred tags analysis
  • Favorite actors/directors analysis
  • Preferred countries/genres analysis
  • Movie watching time statistics
  • User movie preference style analysis

3. Storage API (/storage/<user_id>)

  • Rated movies and ratings
  • Watchlist movies
  • Currently watching movies

4. MyPage API (/mypage/<user_id>)

  • Average rating
  • Favorite actors list
  • Favorite directors list

5. Movie Information API (/movies)

  • Highest rated movies
  • Most commented movies
  • Latest movies

Technology Stack

  • Python 3.x
  • Flask (Web Framework)
  • PyMySQL (Database Connector)
  • MySQL (Database)

Installation and Setup

  1. Install required packages:
pip install flask pymysql python-dotenv
  1. Set up MySQL database:
  • Database name: watchapedia
  • User: root
  • Password: (configure in .env file)
  1. Create .env file with the following variables:
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_password_here
DB_NAME=watchapedia
DB_CHARSET=utf8mb4
FLASK_ENV=development
FLASK_DEBUG=True
PORT=5000
LOG_LEVEL=DEBUG
  1. Run the servers:
python home.py
python preference.py
python storage.py
python mypage.py
python movie.py

API Endpoints

Home

  • GET /home/<user_id>: Get personalized home screen information

Preference Analysis

  • GET /preference/<user_id>: Get user preference analysis information

Storage

  • GET /storage/<user_id>: Get user's movie storage information

MyPage

  • GET /mypage/<user_id>: Get user profile information

Movie Information

  • GET /movies: Get movie recommendations and statistics

Database Schema

The project includes the following main tables:

  • users: User information
  • movies: Movie information
  • comments: Movie ratings and comments
  • actors: Actor information
  • directors: Director information
  • genres: Genre information
  • countries: Country information
  • movie_state: Movie watching status
  • favorite_actors: Favorite actors
  • favorite_directors: Favorite directors
  • movie_tags: Movie tags
  • tags: Tag information
  • movieactors: Movie-actor relationships

About

WatchaPedia의 핵심 기능을 분석해 영화, 사용자, 평가, 코멘트, 선호도 등의 테이블을 MySQL로 모델링한 프로젝트입니다.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages