Code Monkey home page Code Monkey logo

moviemancer's Introduction

Coverage Status Build Status

Moviemancer

Moviemancer is a website for movie recommendation.

Production: http://moviemancer-api.herokuapp.com/

moviemancer on action

Getting Started

Requirements

Instalation

  • $ make setup

Running Locally

Setting the Database

Inside the project directory run: $ make recreate_db

This will drop the moviemancer database and user in case you already have one and recreate those with the proper configuration.

If you wish just setup a moviemancer db that you already created, just run $ make setup_db

Configuring settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'moviemancer',
        'USER': 'moviemancer',
        'PASSWORD': moviemancer,
        'HOST': 'localhost',
        'PORT': 5432,
    }
}

Runing

Inside the project directory run:

  • $ make run
  • open http://127.0.0.1:8000

Deploying to Heroku

$ heroku create
$ git push heroku master

$ heroku run python manage.py migrate
$ heroku open

moviemancer's People

Contributors

betinacosta avatar becosta-tw avatar lipemorais avatar dependabot[bot] avatar

Stargazers

snoop2head avatar Pack Typebot avatar Caesar C. Cesar avatar Gustavo Goulart avatar Pavel Shibaev avatar

Watchers

James Cloos avatar  avatar

Forkers

dafinoer mondaini

moviemancer's Issues

Create README

Description:

In order to facilitate the set up of the application, a README is necessary.

Acceptance Criteria:

The README must contain:

  • What is the project.
  • Link to the website.
  • Installation guide.
  • Deploy to Heroku guide.
  • How to run the application
  • How to run the tests

Report of activities

The user should be able to visualize a report of your activities at the site:

  • Number of movies seen in time period(week, month, year)
  • Most watched genres;
  • Preferred duration;
  • Preferred years;

Fix at least 3 movies for registration

It is necessary to choose at least three movies at the registration, but the frontend gives no information about it and it allows to continue even if selected less than 3 movies

How to reproduce:

  • Create a account and rate just 1 movie
  • Press Enviar button
  • You will be logged out and no able to login with your just created user.

Review recommendation algorithm

Study other type of recommendation system, to see if is possible have only the active user as input in a trained system;

Possibilities

  • Content Based
  • Matrix Fatorization
  • Item-based collaborative filtering

Separate backend from frontend

Currently, the backend and frontend of Moviemancer are very coupled. The idea is to transform moviemancer's backend in an API

Investigate 429 Too Many Requests Error

Sometimes when logging as a new user, this error is thrown and is not possible to login in the first attempt

Maybe, just maybe that was the purpose of the mysterious time.sleep that I so naively removed

Create interface Tests

The project has no frontend tests, the idea is create some UI tests to assure that basic functionalities of the site are working properly.

Happy Path

  1. Create profile;
  2. Rate at leat 3 movies;
  3. Finish registering;
  4. Log In;
  5. Se movies in recommendation;
  6. Expand recommendation;
  7. Rate a recommendation (The recommendation should be removed from the list);
  8. Add a movie to watchlist;
  9. See movie at watchlist;
  10. Rate a movie in watchlist (The movie should be removed from list)
  11. Select a movie (A detail page should be displayed)
  12. Exit (should go back to login screen)

Fix unit-tests configuration

All sort of errors occur when trying to run tests:

Reproduce

  • run make unit-test
  • see the errors
./manage.py test
Creating test database for alias 'default'...
System check identified some issues:

WARNINGS:
?: (1_7.W001) MIDDLEWARE_CLASSES is not set.
	HINT: Django 1.7 changed the global defaults for the MIDDLEWARE_CLASSES. django.contrib.sessions.middleware.SessionMiddleware, django.contrib.auth.middleware.AuthenticationMiddleware, and django.contrib.messages.middleware.MessageMiddleware were removed from the defaults. If your project needs these middleware then you should configure this setting.
System check identified some issues:

WARNINGS:
?: (1_7.W001) MIDDLEWARE_CLASSES is not set.
	HINT: Django 1.7 changed the global defaults for the MIDDLEWARE_CLASSES. django.contrib.sessions.middleware.SessionMiddleware, django.contrib.auth.middleware.AuthenticationMiddleware, and django.contrib.messages.middleware.MessageMiddleware were removed from the defaults. If your project needs these middleware then you should configure this setting.
System check identified some issues:

WARNINGS:
?: (1_7.W001) MIDDLEWARE_CLASSES is not set.
	HINT: Django 1.7 changed the global defaults for the MIDDLEWARE_CLASSES. django.contrib.sessions.middleware.SessionMiddleware, django.contrib.auth.middleware.AuthenticationMiddleware, and django.contrib.messages.middleware.MessageMiddleware were removed from the defaults. If your project needs these middleware then you should configure this setting.
Traceback (most recent call last):
  File "./manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/core/management/commands/test.py", line 50, in run_from_argv
    super(Command, self).run_from_argv(argv)
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/core/management/commands/test.py", line 71, in execute
    super(Command, self).execute(*args, **options)
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/core/management/commands/test.py", line 88, in handle
    failures = test_runner.run_tests(test_labels)
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/test/runner.py", line 147, in run_tests
    old_config = self.setup_databases()
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/test/runner.py", line 109, in setup_databases
    return setup_databases(self.verbosity, self.interactive, **kwargs)
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/test/runner.py", line 299, in setup_databases
    serialize=connection.settings_dict.get("TEST_SERIALIZE", True),
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/db/backends/creation.py", line 382, in create_test_db
    self.connection._test_serialized_contents = self.serialize_db_to_string()
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/db/backends/creation.py", line 418, in serialize_db_to_string
    serializers.serialize("json", get_objects(), indent=None, stream=out)
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/core/serializers/__init__.py", line 128, in serialize
    s.serialize(queryset, **options)
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/core/serializers/base.py", line 52, in serialize
    for obj in queryset:
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/db/backends/creation.py", line 414, in get_objects
    for obj in queryset.iterator():
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/db/models/query.py", line 265, in iterator
    for row in compiler.results_iter():
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 700, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
    cursor.execute(sql, params)
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/Users/becosta/.local/share/virtualenvs/moviemancer-vZib5vRM/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "comments" does not exist
LINE 1: ... "comments"."movie_id", "comments"."comment" FROM "comments"...
                                                             ^

make: *** [unit-test] Error 1

Theories

  • Something wrong with database migrations

Set database passwords in a safe way

The seetings.py use to have the database password, its removed, but now we have to manually set it to deploy and/or run locally.

Ideas

  • Set it at an Environment variable

Upgrade tmdbsimple

The TMDb wrapper is currently in version 2.2.0, the version used in moviemancer is 1.6.1

Upgrade Djago Rest Framework

The current Django Rest version at moviemancer is 3.0, however, the framework is already at the 3.9.0.

Acceptance Criteria

  • Have Django 3.9.0 in Moviemancer

Improve views error handling

Description

The views only throw error for empty request body, no considering empty responses on the methods that get information. The messages are also pretty vague.

AC's

  • Improve errors
  • Improve messages

Move TMDb related methods to a separeted file

There are several TMDb related methods lost in the queries file. They should have it's own file/class to live

ACCs:

  • Have all TMDb related methods in a different script
  • Have all TMDb related test in a different script

Upgrade Python

The Python version used in Moviemancer is 2.7.

  • Upgrade to Python 3

Upgrade from Django

The Django version used in moviemancer is 1.10, which is a very very old version.

  • Upgrade Django 1.10 to 2.1

Refactor all Filter Functionality

Now, this is implemented in total 'Orientada a Gambiarra'.

  • Set a contract for the frontend
    • Not selected = false
    • genres: A String with genre separated by comas e.g. ("13,58")
    • language: A String containing one language e.g. pt
    • maxRuntime: An Integer e.g. 300
    • maxYear: An *Integer *e.g. 2017
    • minRuntime: An Integer e.g. 50
    • minYear: An Integer e.g. 1919
    • user_id: An Integer e.g. 32

Fix repeated movies being add to recommendation

Sometimes a recommended movie is add two times to the database;

Ideas

  • No longer save recommendations to Database, generate them in the beginning of the the session and store it in memory;

Review Database

Review checklist:

  • Check if all tables are still necessary;
  • Check if the connection among all tables are correct;
  • Check if serializers and database mapping are correct;
  • Update migration Files

Rename parameters in tests

start using named parameters at tests:

self.assertFalse(is_movie_on_list(user_id=2, movie_id=1, type_id=2))

instead of

self.assertFalse(is_movie_on_list(2, 1, 2))

Create a method to add new movie

There are some code duplications in the following methods from the classe queries that could be fixed by adding a add_new_movie method:

  • rate_external_movie
  • add_to_list_external

Mobile version

Today, moviemancer is not mobile friendly, being almost impossible to use it any other device other than desktop.

  • Create a design for mobile version

Suffle Movies on Registration

Whenever a new user starts registering in moviemancer, a movie list is displayed so she can pre-rate some movies. Right Now those movies never seem to change. It would be nice either shuffle them or create a strategy to choose which movies will be displayed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.