7.1 KiB
Contributing to Rewindarr
Contributions are welcome and greatly appreciated! Please follow the guidelines below.
Development
Tools
- Git for source control
- Node.js 26 or higher (see
.node-version) - pnpm as a package manager. The version is pinned in
package.json, so enabling it withcorepack enable pnpmpicks the right one. Node 26 no longer ships corepack, so install it first withnpm install -g corepack. - VS Code is recommended as an editor. It suggests the extensions in
.vscode/extensions.jsonwhen you open the project. - A Plex or Jellyfin server and either a Tautulli or a Tracearr instance (Jellyfin needs Tracearr), if you want to work with real data. Seerr is optional. You enter their URLs and API keys under Settings → Connection once the app is running. Without them, you can use the mock data.
Getting started
-
Fork the repository to your own GitHub account and clone it to your local device:
git clone https://github.com/YOUR_USERNAME/rewindarr.git cd rewindarr -
Create
.env.localfrom.env.example. Everything in it is optional: the app creates a secret inconfig/auth-secreton first start and uses the address it's opened at.cp .env.example .env.local -
Install the project dependencies:
pnpm i -
Create a branch from
develop, named as described in the code guidelines:git checkout -b <YOUR_BRANCH_NAME> develop -
Run the development environment. The app is available at
http://localhost:3000:pnpm dev -
Make your changes and test them, following the code guidelines.
-
Should you need to update your fork, you can do so by rebasing from
upstream. Add the remote once:git remote add upstream https://github.com/RaunoT/rewindarr.gitThen fetch and rebase whenever you need to:
git fetch upstream git rebase upstream/develop git push origin BRANCH_NAME -f
Running with Docker
To try your changes in the production image, run docker compose up --build. The docker-compose.yml in the repository builds the image from the Dockerfile, reads its environment from .env.local and mounts ./config for the settings. It maps port 3000 on your machine to the container's 8383, so the app is available at http://localhost:3000.
Mock data
.github/scripts/mock-server.mjs stands in for Tautulli and Seerr with a made-up 15-person server, so you can work without a media server and take screenshots that don't show anyone's real history. Its users have stock portraits from randomuser.me as avatars, and the app still fetches real posters, ratings and links for its titles. The README screenshots in .github/screenshots are taken with it.
-
Start the mock with your own Plex account as one of its users, so you can sign in. Your ID, name, email and avatar URL are under
userat/api/auth/sessionwhile you're signed in to your dev server:MOCK_USER_ID=… MOCK_USER_NAME='…' MOCK_USER_EMAIL=… MOCK_USER_THUMB=… node .github/scripts/mock-server.mjs -
Run a second copy of the app, so your own settings stay untouched. Settings are read from the folder the app runs in, so a worktree gets its own:
git worktree add ../rewindarr-mock cp .env.local ../rewindarr-mock/ cd ../rewindarr-mock && pnpm installSave this as
config/settings.jsonthere, then start it withpnpm dev -p 3001and sign in. If your.env.localsetsNEXTAUTH_URLorNEXT_PUBLIC_SITE_URL, remove them from the copy:{ "connection": { "statisticsSource": "tautulli", "tautulliUrl": "http://localhost:8787", "tautulliApiKey": "mock", "plexUrl": "http://localhost:32400", "seerrUrl": "http://localhost:8787", "seerrApiKey": "mock", "complete": true }, "general": { "activeLibraries": ["movies", "shows", "music"], "activeExternalLinks": ["seerrStatus"], "complete": true }, "rewind": { "period": "calendarYear", "releaseDate": "11-01", "complete": true }, "dashboard": { "complete": true }, "activity": { "complete": true }, "history": { "complete": true }, "setupComplete": true }The home page announces the new year's Rewind from its release date to the end of January, so take the screenshots between July and January, with
releaseDate(MM-DD) set to a day before today. The mock's history goes back 400 days, which gives the Rewind tile its earlier years menu. -
For the README, take the screenshots in a 1440×810 window at 2× scale, with the Next.js dev badge hidden. At that width the Rewind tile's buttons fit on one row. Save them as WebP:
cwebp -q 82 -m 6 home.png -o .github/screenshots/home.webp
Pull requests
Run these and fix anything they report. The same checks run on every pull request.
pnpm lint:all
pnpm test
pnpm build
pnpm lint:all runs oxlint, the TypeScript check, Stylelint and an oxfmt check, and pnpm lint:all:fix fixes what it can. In VS Code, the recommended Oxc extension formats on save, and the TypeScript 7 extension gives the editor the same type checker as tsc.
Fill in the pull request template. For UI changes, add before and after screenshots, at phone and desktop widths where the layout differs. When the change moves or needs interaction, such as animations, transitions or multi-step flows, add a short recording too (MP4 under 10 MB). Drag the files into the description on GitHub.
Code guidelines
- If you are taking on an existing issue, comment on it first, so two people don't work on the same thing.
- Commits follow Conventional Commits. Run
pnpm commitfor a guided prompt, or write the message yourself. Besides the usual types (feat,fix,docs,choreand so on) there is auitype for UI changes. A commit hook checks the message. Make meaningful commits, or squash them before opening a pull request. - Branch names and pull request titles follow the same logic, for example
feat(dashboard)/new-featureorfix/bugfor a branch andfeat(dashboard): new featureorfix: bugfor a pull request. - Put user-facing text in
messages/*.jsoninstead of in the components, and add each new key to every language file, usingen-GB.jsonas the reference (en-US.jsononly changes the spelling). - Check your changes at phone, tablet and desktop widths.
- Use the proper Unicode characters for ellipses (…), arrows (→) and other symbols.
- Open pull requests against
develop, nevermain. Pull requests tomainare closed.