Database - Shravsssss/MovieRecommender GitHub Wiki

Database

The application uses SQLite to manage data. The database schema consists of the following tables:

User Table

  • id: Unique identifier for each user.
  • username: User’s username (must be unique).
  • email: User’s email (must be unique).
  • password_hash: Hashed password for secure login.
  • favorite_genres: User’s favorite genres for recommendations.
  • watchlist_count: The number of movies added to the watchlist.
  • rec_movies_count: The number of movie recommendations received.

Recommendation Table

  • id: Unique identifier for each recommendation.
  • user_id: The ID of the user who received the recommendation.
  • movie_title: Title of the recommended movie.
  • recommended_on: Timestamp when the movie was recommended.

Watchlist Table

  • id: Unique identifier for each watchlist item.
  • movie_title: Title of the movie added to the watchlist.
  • imdb_rating: IMDb rating of the movie.
  • user_id: The ID of the user who added the movie to the watchlist.

To initialize the database, the following command is run in app.py:

with app.app_context():
    db.create_all()