Skip to content

CecileSerene/uptv

 
 

Repository files navigation

UpTV

Build Status Python Django API

Never miss on your favorite TV shows' new episodes!

Contents

Production

The application is available at https://uptv.herokuapp.com/.

Sign up to start subscribing to TV shows and receive email alerts for the latest episodes!

Install

Create a .env file at the project root with your credentials (for details, see Settings):

TMDB_API_KEY=...
SENGRID_API_KEY=...

Depending on how you want to run UpTV, some extra steps may be necessary — see below.

Quickstart

Using Docker

This project requires Python 3.7+. If you don't have it installed on your machine, we provide a Docker Compose setup. You will need Docker and Docker Compose installed.

The Docker Compose setup runs UpTV in production mode: hot-reloading is disabled, a PostgreSQL database is used instead of SQLite, and the alerts worker will start.

To run UpTV using Docker, run:

docker-compose up -d

The app will be available at http://localhost:8000.

Using local Python 3.7+

If you have Python 3.7+, you can run UpTV without Docker. However, a few more installation steps are required:

python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
python manage.py migrate

You can now start the development server:

python manage.py runserver

The app will be available at http://localhost:8000.

By default, the alerts worker won't start in development. To activate it, use:

export ALERTS_ACTIVE=1  # or set it in .env
python manage.py runserver --noreload

Note : using this method, the alerts worker will run in sandbox mode and emails won't be delivered. To force email delivery, use the ALERTS_FORCE_EMAIL setting (see below).

To use the Gunicorn production server instead, use:

gunicorn uptv.wsgi -c uptv.gunicorn

Settings

The following settings are available and can be defined in your .env file:

  • TMDB_API_KEY (no default): used to query the TheMovieDatabase (TMDB) API, which provides our data. If you don't have an API key, you can create a (free) TMDB account. Refer to the Getting Started guide.
  • SENDGRID_API_KEY (no default): used to send alerts via email using SendGrid. For details, see django-sendgrid-v5.
  • ALERTS_ACTIVE (default: False): whether to start the alerts worker upon server startup.
  • ALERTS_FORCE_EMAIL (default: False): whether to force the alerts worker to deliver emails in development. If False, emails will not be delivered (useful for local testing). This setting has no effect in production mode.
  • ALERTS_RUN_TIME (default: 08:00:00): hh:mm:ss string representing the run time of the alerts worker.
  • ALERTS_MAIL_FROM (default: alerts@uptv.herokuapp.com): the email address from which alerts will be sent.

Features

Here's what UpTV can do for you:

  • Search for TV shows you'd be interested in.
  • Mark a show as a favorite.
  • Manage your list of favorite shows.
  • Look up episodes and read their summaries.
  • Receive daily alerts for new episodes.

It also features:

  • An intuitive design and minimal graphic charter.
  • Account signup and profile management.
  • Smart search capabilities.
  • Email alerts.
  • Display of last and next episode for each show.
  • Count of followers.
  • Sign up for an account.

Techniques

Here are the techniques we used to build UpTV:

  • Object Oriented Programming (OOP) in Python: API client, API parsers, API data representation, notifiers…
  • Threads: alerts worker running in the background.
  • Consuming a REST API: the TheMovieDB API.
  • Providing REST API endpoints: POST /api/subscribe/:show_id, DELETE /api/subscribe/:show_id.
  • Client-server architecture.
  • Web application development using Django.
  • HTML/CSS/JS web development.
  • Integration with third-party libraries.
  • Definition, usage and management of a SQL database (SQLite, Postgres)
  • OOP in JavaScript (e.g. series/static/series/counter.js).
  • Deployment to production using Heroku.
  • Containerization using Docker.
  • Collaborative development using GitHub, Pull Requests and Trello.
  • Automated testing of critical features.
  • CI/CD using TravisCI (test execution and automated deployments on git push).
  • Sending emails via a third-party web service (SendGrid).

Test notifications

Administrators can send notifications manually, regardless of the release date of the next episode. On the admin platform https://uptv.herokuapp.com/admin/, go to the Api shows section. Select a show, choose the Email followers of selected shows actions and hit Go. All followers of the show will then receive an email alert. Please be patient as it make take up to 15 minutes to receive the email.

Contributing

  • Create a branch, e.g. feature/awesome-feature or fix/very-nasty-bug.
  • Add commits.
  • When ready, push to remote: git push -u origin feature/awesome-feature.
  • Open a Pull Request: document the changes and provide any useful additional context.
  • Ask someone to review your code. 🔎🤝
  • When ready and tests pass: merge it!

Credits

About

📺 TV show alerting web app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 75.0%
  • HTML 14.8%
  • CSS 5.3%
  • JavaScript 4.3%
  • Other 0.6%