{"id":23878367,"url":"https://github.com/mike014/movieranker","last_synced_at":"2026-04-21T09:31:16.997Z","repository":{"id":270405782,"uuid":"910281980","full_name":"Mike014/MovieRanker","owner":"Mike014","description":"A Django-based web application that fetches and displays movies from The Movie Database (TMDB) API, allowing users to filter movies by genre.","archived":false,"fork":false,"pushed_at":"2025-01-19T18:30:15.000Z","size":5868,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T22:41:27.025Z","etag":null,"topics":["algorithm","algorithms","api","black","django","html-css-javascript","isort","justwatch-api","open-source","precommit-hooks","pytest","python","test","tmdb-api","tox"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mike014.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["Mike014"]}},"created_at":"2024-12-30T21:52:37.000Z","updated_at":"2025-01-19T18:30:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"932d95d4-3fec-4e00-a27b-e60cff7852b0","html_url":"https://github.com/Mike014/MovieRanker","commit_stats":null,"previous_names":["mike014/movieranker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mike014/MovieRanker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mike014%2FMovieRanker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mike014%2FMovieRanker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mike014%2FMovieRanker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mike014%2FMovieRanker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mike014","download_url":"https://codeload.github.com/Mike014/MovieRanker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mike014%2FMovieRanker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32085402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T06:27:27.065Z","status":"ssl_error","status_checked_at":"2026-04-21T06:27:21.250Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","algorithms","api","black","django","html-css-javascript","isort","justwatch-api","open-source","precommit-hooks","pytest","python","test","tmdb-api","tox"],"created_at":"2025-01-03T21:35:39.847Z","updated_at":"2026-04-21T09:31:16.541Z","avatar_url":"https://github.com/Mike014.png","language":"JavaScript","funding_links":["https://github.com/sponsors/Mike014"],"categories":[],"sub_categories":[],"readme":"# MovieRanker\n\n**MovieRanker** is a prototype web application written in Django. Its primary goal is to help users discover movies tailored to their preferences using The Movie Database (TMDB) API.\n\n---\n\n## Features\n\n- **Integration with TMDB API:** Fetch movie genres, ranks, and other details using TMDB API endpoints.\n- **Genre Filtering:** Filter movies by selecting genres from a dropdown menu.\n- **Dynamic Movie List:** Display a ranked list of movies based on the selected genre.\n- **Movie Details Page:** View detailed information about a selected movie.\n\n---\n\n## Key Components\n\n1. **`api.py`**:\n   - Interacts with the TMDB API.\n   - Fetches genres, movies by genre, and detailed movie information.\n\n2. **`views.py`**:\n   - Handles user requests and business logic.\n   - Includes views for the movie list and movie details.\n\n3. **`models.py`**:\n   - Defines the data structure for movies.\n\n4. **`movie_list.html`**:\n   - Frontend template for viewing and filtering movies by genre.\n\n5. **`movie_details.html`**:\n   - Frontend template for displaying detailed information about a specific movie.\n\n---\n\n## Installation and Setup\n\nFollow these steps to set up and run **MovieRanker** locally:\n\n### Prerequisites\n\n- Python 3.9 or higher\n- Django installed\n- TMDB API Key (for API integration)\n\n### Steps\n\n1. **Clone the Repository**:\n   ```bash\n   git clone https://github.com/Mike014/MovieRanker.git\n   cd MovieRanker\n   ```\n\n2. **Set Up a Virtual Environment**:\n   ```bash\n   python3 -m venv venv\n   source venv/bin/activate  # Mac/Linux\n   venv\\\\Scripts\\\\activate     # Windows\n   ```\n\n3. **Install Dependencies**:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. **Run Database Migrations**:\n   ```bash\n   python manage.py migrate\n   ```\n\n5. **Set Up TMDB API Key**:\n   \t•\tCreate a .env file in the root directory.\n\t•\tAdd your TMDB API key:\n    ```bash\n    TMDB_API_KEY=your_api_key_here\n    ```\n\n6.\t**Run the Development Server**:\n    ```bash\n    python manage.py runserver\n    ```\n\n7.\t**Access the Application**:\n    ```plaintext\n    http://127.0.0.1:8000/\n    ```\n\n## Development Workflow\n\n### Linting and Formatting\n\n- This project uses Pylint, Black, and isort for linting and formatting.  Pre-commit hooks are set up to enforce these standards.\n\n\t1.\t**Install pre-commit**:\n        ```bash\n        pip install pre-commit\n        pre-commit install\n        ```\n    2.\t**Run pre-commit hooks**:\n        ```bash\n        pre-commit run --all-files\n        ```\n\n    ### Running Tests\n    To run tests, use:\n    ```bash\n    pytest\n    ```\n\n    **Using Tox**\n    Tox is configured to automate testing and linting:\n    ```bash\n    tox\n    ```\n\n    **GitHub Actions**\n    The project includes a GitHub Actions workflow for automated testing and linting. The configuration is in .github/workflows/lint-and-test.yml.\n\n    **Running Django Tests**\n    To run Django tests for the Movies app and discover any bugs, you can use the following command:\n    ```bash\n     python manage.py test movies\n    ```\n\n## Useful TMDB API Endpoints\n\n1. Fetch Genre List:\n    ```bash\n    https://api.themoviedb.org/3/genre/movie/list\n    ```\n\n2.\tDiscover Movies by Genre:\n    ```bash\n    https://api.themoviedb.org/3/discover/movie\n    ```\n\n3.\tGet Movie Details:\n    ```bash\n    https://api.themoviedb.org/3/movie/{movie_id}\n    ```\n\n4.\tFetch Similar Movies:\n    ```bash\n    https://api.themoviedb.org/3/movie/{movie_id}/similar\n    ```\n\n## Back-End Database with PostgreSQL\n\n### Install and Configure Docker\n\n1. **Install Docker**:\n   - Visit [Docker Desktop](https://www.docker.com/) and download the version for your operating system (Windows, macOS, Linux).\n   - Follow the installation instructions.\n\n2. **Start a PostgreSQL Container**:\n   ```bash\n   docker run --name postgres -e POSTGRES_PASSWORD=your_password_here -d -p 5432:5432 postgres\n   ```\n\n3. **Verify the PostgreSQL Container is Running:**:\n   ```bash\n   docker ps\n   ```\n\n   - Displays all active containers.\n\n4. **Test Database Connection:**:\n   ```bash\n   docker ps\n   ```\n\n   OR\n\n   ```bash\n   python manage.py dbshell\n   ```\n\n   - Perform Database Migrations\n   ```bash\n   python manage.py makemigrations\n   python manage.py migrate\n   ```\n\n## Querying the Database\n- First i have created a Custom Management Command:\n```plaintext\nmovies/\n    management/\n        __init__.py\n        commands/\n            __init__.py\n            query_movies.py\n```\n- To run the command, use:\n ```bash\n python manage.py query_movies --type all\n ```\n- Check in the **query_mvovies.py** which command you can use for querying the database\n\n## Documentation\n\n- The documentation for MovieRanker is available at: [MovieRanker Documentation](https://Mike014.github.io/MovieRanker/)\n- Created a new requirements.txt file with command:\n\n```bash\npip install pipreqs\npipreqs .\n```\n- created docker file, you can buld the image with this command:\n```bash\ndocker build . -t movies:latest \u0026\u0026 docker run -e PYTHONUNBUFFERED=1 -p 8000:8000 movies\n```\n- Go to [Link](http://localhost:8000/movies/)\n  \n## Future Goals\n\n- Implement content-based and collaborative filtering for advanced movie recommendations.\n- Enhance user interface and add user authentication.\n- Deploy the application on a cloud platform.\n\n## License\n\nThis project is licensed under the **MIT License**.\n\n## Contributing\n\nContributions are welcome! Feel free to fork the repository and submit pull requests.\n\n## Contact\n\nMaintainer: Michele Grimaldi\nGitHub: Mike014[Mike014](https://github.com/Mike014)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmike014%2Fmovieranker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmike014%2Fmovieranker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmike014%2Fmovieranker/lists"}