Skip to content

MichaelKohler/tv-tracker

Repository files navigation

tv-tracker

Track TV shows you've watched. Note that this is mostly for myself, however feel free to contribute as well :)

Development

This project is based on Remix.

npm ci
npx playwright install
npm run setup
npm run dev

This starts your app in development mode, rebuilding assets on file changes.

The database seed script creates a new user with some data you can use to get started:

  • Email: rachel@remix.run
  • Password: rachelrox

Formatting

We use Prettier for auto-formatting in this project. It's recommended to install an editor plugin (like the VSCode Prettier plugin) to get auto-formatting on save. There's also a npm run format script you can run to format all files in the project.

Tests

To run all test, use

npm run validate

which will run all available tests.

Database

I am using Turso to run this project in production. Therefore we are using libsql here. Prisma has an adaptor for it and in development we just use a normal sqlite database.

Shows are stored in the Show table the first time a user adds a given show. Subsequent additions do not result in shows being added multiple times. At the same time episodes are fetched and stored in the Episode table.

Adding a show results in a link in ShowsOnUser to keep track which user has added which shows. This table also stores whether a user has archived a given show.

Episode links to users are stored in the EpisodeOnUser table. Whenever a new show is added, all episodes are marked as unwatched. When an episode gets marked as watched, a new entry in the EpisodeOnUser table is created. This saves storage space as not every episode needs to be added to every user.