Skip to content

trakt/trakt-time

 
 

Repository files navigation

trakt-time

Note: This is an experiment. We're rebuilding a Trakt client app with a mobile-first, TV Time-like feel. Started as an AI hackathon project, kept alive for fun and learning. It's not affiliated with Trakt and not aiming to replace anything — just a sandbox.


Open source, contributions welcome! PRs of any size are encouraged. Bug fixes, polish, new features, translations — dive in. See CONTRIBUTING.md for the details.


What's in here

The repo is a Deno workspace with one project today:

  • projects/client — the SvelteKit frontend that talks to the Trakt API and renders the trakt-time UI. Deployed to a Cloudflare Worker.

Getting started

You need Deno installed. Once you have it:

  1. Clone the repository.
  2. Install dependencies: deno task install
  3. Start the dev server: deno task client:dev

Trakt API credentials

You need a personal Trakt application to develop against:

  1. Create one at Trakt Settings → Applications.

  2. Add these Redirect URIs (one per line):

    http://localhost:5173
    http://localhost:5173/callback
    http://localhost:4173
    http://localhost:4173/callback
    
  3. Add the same values to Javascript (cors) origins.

  4. Export the credentials before running tasks:

    export TRAKT_CLIENT_ID=...
    export TRAKT_CLIENT_SECRET=...

External contributors should use deno task client:dev:contrib so the dev server points at the public Trakt environment instead of the private one.

Port 5173 is for vite dev, 4173 is for vite preview.

Workspace tasks

From the repo root:

Task What it does
deno task install Install dependencies
deno task format deno fmt + deno lint --fix
deno task client:dev Run the client dev server
deno task client:dev:contrib Same, but against the public Trakt API

From projects/client/:

Task What it does
deno task check svelte-kit sync + svelte-check
deno task test:unit Run Vitest
deno task build Build for Cloudflare Workers (adapter-cloudflare)
deno task preview Serve the production build locally

Build & local preview

cd projects/client
deno task build
deno task preview

If you want a real Cloudflare Worker preview locally (instead of vite preview):

cd projects/client
deno task build
npx wrangler dev   # or `bunx wrangler dev`

Wrangler currently can't run under Deno because Deno doesn't yet support Node VM modules (deno#26349). Use npm or bun for the wrangler step.

Deploy

The Cloudflare Worker is deployed from CI on every push to main (see .github/workflows/ci_cd.yml). For ad-hoc deploys from your machine:

cd projects/client
deno task build
npx wrangler deploy

You'll need wrangler login once and the right secrets configured (see INFRASTRUCTURE.md).

Updating dependencies

We use npm-check-updates because the client is a package.json project living inside a Deno workspace.

deno install -g --allow-all -n ncu npm:npm-check-updates

For minor bumps:

ncu --dep prod -t minor       # check
ncu --dep prod -t minor -u    # update
ncu --dep dev -t minor
ncu --dep dev -t minor -u

For majors: ncu --dep prod -t latest, do them one at a time, build, fix breakage, commit.

Tech stack & acknowledgements

trakt-time stands on the shoulders of:

Built with SvelteKit Hosted on Cloudflare Workers

Built on top of the original trakt/trakt-web codebase, which we forked and reshaped for this experiment. Huge thanks to the upstream maintainers.

For infrastructure-flavored details (env vars, wrangler secrets, Typesense, etc.), see INFRASTRUCTURE.md.

About

Unlock the secrets of your watch history, explore hidden connections between films, and delve into the depths of personalized recommendations. But tread carefully, for the Trakt API holds powers that could reshape your very perception of entertainment...

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors

Languages

  • TypeScript 61.5%
  • Svelte 34.1%
  • SCSS 2.0%
  • CSS 1.6%
  • Other 0.8%