Skip to main content

movienight

A self-hosted movie-night voting app for friend groups.
Propose films, swipe through the shortlist, and let the group decide what you watch on Friday.

CI Python 3.12 FastAPI MIT License

Ranked poster grid with the current round, deadline countdown and voting progress

Swipe tab: dragging a card to the right to like it Phone view of the ranked grid Movie detail with votes, overview and comments

Screenshots use the demo data from scripts/seed_demo.py with placeholder poster art.

How it works

  1. The admin starts a round with a voting deadline.
  2. Everyone proposes up to three films (configurable), found through TMDB search or entered by hand.
  3. The group votes: like, nope, and one superlike per person and round, either in the ranked grid or by swiping through cards.
  4. After movie night, the admin closes the round and marks the film you watched. Everything else moves on to the next round with fresh votes, and films nobody picks for too long drop out on their own.

Note: The interface is in German, and deadlines are entered and shown in Europe/Berlin time.

Features

Voting

  • Ranked poster grid; a superlike counts like three likes, a nope subtracts one
  • Swipe mode with drag and flick gestures, keyboard shortcuts, undo, "later" and a summary at the end
  • Live countdown to the deadline; voting and proposals close automatically

Rounds

  • One active round at a time, with optional deadline
  • Unwatched films carry over and retire after a configurable number of rounds
  • History of every film you watched, with date and who proposed it

People

  • Invite-only accounts through single- or multi-use links
  • Regulars see every round; guests only the rounds they were invited to
  • Comments per film; everyone can change their own password
  • Admin panel for rounds, guests, invite links and accounts (roles, password reset, deactivation)

Under the hood

  • FastAPI, SQLite and plain JavaScript modules: no build step, no node_modules
  • Posters, genres, overviews and German or English trailers from TMDB; works without a TMDB key
  • Strict Content-Security-Policy, rate-limited login and invite redemption, tokens revoked on password change

Quickstart

Requires Python 3.12+ (or Docker).

Try the demo in one command (temporary SQLite DB, no .env needed):

uvx movienight-app demo

Open http://localhost:8000 and log in as demo_admin, alex, sam or robin (a guest), all with the password demo-password.

Install from PyPI:

uv tool install movienight-app        # or: pip install movienight-app

Create a .env file (see .env.example), then start the server:

movienight serve --host 127.0.0.1 --port 8000

Run with Docker Compose:

git clone https://github.com/nbomers/movienight.git
cd movienight
cp .env.example .env
# Set SECRET_KEY and FIRST_ADMIN_PASSWORD in .env (TMDB_API_KEY is optional).
docker compose up -d

Local development:

git clone https://github.com/nbomers/movienight.git
cd movienight
python -m venv .venv && source .venv/bin/activate
pip install -r requirements-dev.txt

cp .env.example .env
movienight seed-demo                  # optional: demo users, films and an active round
movienight serve --reload

Without demo data, the app creates the first admin from FIRST_ADMIN_USERNAME and FIRST_ADMIN_PASSWORD on first start, and refuses to start while no password is set. There is no default password.

Run the checks:

ruff check .
pytest

Configuration

All settings come from environment variables or a .env file.

Variable Default Purpose
SECRET_KEY (required) Signs login tokens. Generate with python -c "import secrets; print(secrets.token_urlsafe(48))"
DATABASE_URL sqlite:///./filmabend.db SQLite database file; .env.example uses movienight.db
TMDB_API_KEY (empty) Enables movie search; without it, films are entered by hand
MAX_MOVIES_PER_USER 3 Proposals per person and round (admins are not limited)
ACCESS_TOKEN_EXPIRE_MINUTES 10080 Login lifetime (7 days)
FIRST_ADMIN_USERNAME admin Initial admin, created on first start only
FIRST_ADMIN_PASSWORD (empty) At least 12 characters; required until an admin exists
AUTH_RATE_LIMIT 10 Failed logins or registrations per client IP …
AUTH_RATE_WINDOW_SECONDS 300 … within this window
CORS_ORIGINS [] Only needed when the frontend is served from another origin

Self-hosting

The app is a single process that serves the API and the frontend from the same origin. A typical setup:

Browser ──HTTPS──▶ Caddy ──▶ uvicorn / FastAPI ──▶ SQLite
                                    │
                                    └──▶ TMDB API (search, details, trailers)

Deployment files:

  • docker-compose.yml + Dockerfile: non-root container with read-only root filesystem, /health check and a persistent /data volume for SQLite
  • deploy/movienight.service: systemd unit that binds movienight serve to localhost and enables --proxy-headers, so the rate limit sees real client IPs
  • deploy/Caddyfile.example: reverse proxy with automatic HTTPS, plus a variant for use behind Cloudflare Tunnel

Run a single uvicorn worker: the login rate limit is kept in memory.

Backups. SQLite runs in WAL mode, so a plain file copy of a running database can miss recent writes. Use SQLite's backup command instead:

sqlite3 movienight.db ".backup movienight-$(date +%F).db"

Updating. Pull, install the requirements and restart the service. Schema changes are applied automatically at startup. Check the changelog for anything that needs attention, such as everyone having to log in again after 1.0.0.

Design decisions

SQLite instead of Postgres. A friend group produces a few hundred rows a year, with one writer most of the time. SQLite means no extra service, a single file to back up, and a test suite that runs against the same engine as production. WAL mode and a busy timeout let a group vote at the same moment. If this ever needed several app servers, the database would be the first thing to change.

No frontend framework. The UI is a handful of views over a small JSON API. Plain ES modules load directly in the browser, so there is no build step and deploying is copying files. The cost is manual DOM updates and manual escaping: every value from the API goes through one esc() helper before it reaches innerHTML, and the backend only accepts poster paths and trailer links in the exact shape TMDB produces.

Round logic. Exactly one round is active at a time. When the admin closes a round, they mark the film that was watched and it leaves the pool. When the next round starts, all other films from the last round move over, their votes are cleared, and their rounds_survived counter goes up. Once it reaches the configured limit (default 4), the film retires. The list stays fresh without anyone cleaning it up by hand.

Superlikes are derived, not stored. Whether someone has used their superlike is a query over the current round's votes. An earlier version kept a separate list that could drift from the votes, for example when a superliked film was removed.

Optimistic voting. A vote updates the UI immediately and is rolled back if the server rejects it. The grid, the detail view and the swipe deck share one store, so they never disagree.

Time zones. Deadlines are entered as Berlin time, converted to UTC for storage and sent to the browser with an explicit offset. SQLite does not store offsets, so the API attaches UTC when reading.

Security

  • Accounts exist only through invite links (secrets.token_urlsafe(32)). The token travels in the URL fragment, so it never reaches server or proxy logs.
  • Sessions are signed JWTs bound to the user id and a per-user token version. Changing or resetting a password logs out every other session; deactivating a user takes effect on their next request.
  • Login answers unknown users and wrong passwords with the same error in the same time. Usernames are unique ignoring case. Failed logins and invite redemptions are rate-limited per IP.
  • Access is checked on every round-scoped endpoint: guests only see the round they were invited to, including its comments and the TMDB search.
  • Frontend: no inline scripts or event handlers, and a strict Content-Security-Policy (script-src 'self'), so injected markup cannot run code even if an escaping mistake slipped through. A test keeps it that way.

Found a vulnerability? Please report it privately as described in SECURITY.md rather than opening a public issue.

Contributing

Issues and pull requests are welcome. Please run ruff check . and pytest before opening a pull request; CI runs both.

TMDB attribution

This product uses the TMDB API but is not endorsed or certified by TMDB.

License

MIT. The bundled Inter font is licensed under the SIL Open Font License.

Metadata

Release files for movienight-app 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for movienight-app 1.1.0
File Size Uploaded Provenance Actions
movienight_app-1.1.0.tar.gz 128.8 kB With provenance Details for movienight_app-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for movienight-app 1.1.0
File Interpreter ABI Platform Actions
movienight_app-1.1.0-py3-none-any.whl Python 3 none any Details for movienight_app-1.1.0-py3-none-any.whl

Total release size: 270.5 kB

Release files / movienight_app-1.1.0.tar.gz

Download URL movienight_app-1.1.0.tar.gz
Size 128.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2cd518ae83558d243fffb75a1d6052a93d61b755caf05dabefe5b671674a110e
BLAKE2b-256 checksum
How to use checksums
5ac77e3aa5bc2d712bab9033c54fc9eeac73b2857c610e51c5487e3750e4384b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / movienight_app-1.1.0-py3-none-any.whl

Download URL movienight_app-1.1.0-py3-none-any.whl
Size 141.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bb99a71bc71de52b6f3c09a3f8902ad4e6bcd57cd83aa560d1cac3d473c35d2
BLAKE2b-256 checksum
How to use checksums
f12cc717cf6ed256cfc493def028c11b0af6a7688cf1705641975dc7e88af40c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Security for movienight-app 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for movienight_app-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page