You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update README and vitest configuration for YouTube app
- Enhanced the README to provide clearer descriptions of the channel dashboard, video scoring, and AI features, improving user understanding of the app's capabilities.
- Updated the vitest configuration to adjust coverage thresholds for statements, branches, functions, and lines, ensuring more accurate test coverage reporting.
Made-with: Cursor
Copy file name to clipboardExpand all lines: apps/imdb-best-season/README.md
+70-49Lines changed: 70 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,38 +4,63 @@ A web application that ranks TV show seasons based on their episode ratings. Sea
4
4
5
5
## Features
6
6
7
-
- Search for any TV series with autocomplete suggestions
8
-
- Seasons ranked by median episode rating (combining IMDb and TMDB scores when available)
9
-
- Episode-by-episode breakdown with IMDb links and dual-source ratings
10
-
- Best season highlighted in the results table
11
-
- Dark/light theme with system preference detection
12
-
- Fully responsive layout
7
+
-**Search with autocomplete** -- type a show name and get instant suggestions from OMDb. The home page includes quick-access links to popular shows (Breaking Bad, The Wire, The Office) to get started immediately.
8
+
9
+
-**Season ranking** -- every season is ranked by its median episode rating. When TMDB data is available, each episode's rating is the average of its IMDb and TMDB scores, combining two independent audiences. The median (rather than mean) is used so a single bad episode doesn't tank an otherwise great season.
10
+
11
+
-**Episode-by-episode breakdown** -- click any season to open a dialog showing every episode with its title, IMDb link, and ratings from both sources. Episodes missing a TMDB score display a tooltip explaining the fallback to IMDb-only data.
12
+
13
+
-**Best season highlight** -- the top-ranked season is visually highlighted in the table so it's immediately obvious which season comes out on top.
14
+
15
+
-**Show metadata** -- alongside the rankings, the app displays the show's poster, title, plot summary, total season count, and aggregate ratings from IMDb, Rotten Tomatoes, and TMDB (when available).
16
+
17
+
-**Dark/light theme** -- toggle between themes with system preference detection.
18
+
19
+
-**Responsive layout** -- works on desktop, tablet, and mobile.
13
20
14
21
### How Ranking Works
15
22
16
-
Each season's score is the **median** of its episode ratings. When TMDB data is available, episode ratings are averaged across both sources for more robust results. The median (rather than mean) reduces the impact of outlier episodes on a season's ranking.
23
+
Each season's score is the **median** of its episode ratings:
24
+
25
+
1. Fetch all episode ratings from OMDb (IMDb scores)
26
+
2. If TMDB is configured, fetch per-episode ratings from TMDB as well
27
+
3. For each episode, compute the average across available sources
28
+
4. Take the median of all episode averages within each season
29
+
5. Rank seasons from highest to lowest median
30
+
31
+
The median was chosen over the mean because TV seasons often have one or two outlier episodes (a weak finale, a bottle episode) that would disproportionately drag down an otherwise strong season. The median gives a more representative picture of the typical episode quality.
17
32
18
33
### Data Sources
19
34
20
-
-**OMDb API** (required) -- primary source for show metadata, season info, and IMDb episode ratings
21
-
-**TMDB API** (optional) -- when configured, adds per-episode ratings as a second data point, improving accuracy
35
+
**OMDb API** (required) -- the primary source. Provides show metadata (title, year, poster, plot, ratings), season structure, and per-episode IMDb ratings. Free tier allows 1,000 requests/day.
36
+
37
+
**TMDB API** (optional) -- when a TMDB API key is configured, the app searches for the show on TMDB, fetches per-episode ratings from their community, and averages them with IMDb scores. This dual-source approach smooths out biases inherent in any single rating platform.
22
38
23
-
Both sources are cached in-memory (24h TTL, up to 1000 entries) and rate-limited (30 req/min for search, 60 req/min for suggestions).
39
+
Both sources are cached in-memory with a 24-hour TTL and a max of 1,000 entries. Search and suggestion endpoints are rate-limited (30 req/min for search, 60 req/min for suggestions) using the shared rate limiter from `@data-projects/shared`.
| GET |`/api/search/[title]`| Search for a show, fetch all seasons and episodes, compute rankings. Combines OMDb + TMDB data. Cached 24h, rate-limited 30 req/min |
61
+
| GET |`/api/suggest/[query]`| Autocomplete suggestions from OMDb series search. Cached 1h, rate-limited 60 req/min |
62
+
63
+
Both routes include CORS headers and input validation (title sanitization, length limits, allowed characters).
|`OMDB_API_KEY`| Yes | Get a free key at [omdbapi.com](https://www.omdbapi.com/apikey.aspx) (1,000 req/day)|
60
-
|`TMDB_API_KEY`| No | Get a key at [themoviedb.org](https://www.themoviedb.org/settings/api). Adds a second rating source |
61
-
|`NEXT_PUBLIC_POSTHOG_KEY`| No | PostHog project key (client-side, write-only) |
84
+
|`OMDB_API_KEY`| Yes | Get a free key at [omdbapi.com](https://www.omdbapi.com/apikey.aspx). Free tier: 1,000 req/day |
85
+
|`TMDB_API_KEY`| No | Get a key at [themoviedb.org](https://www.themoviedb.org/settings/api). When set, adds a second rating source for more robust rankings|
86
+
|`NEXT_PUBLIC_POSTHOG_KEY`| No | PostHog project API key (client-side, write-only -- safe to expose) |
62
87
63
88
### Installation
64
89
65
90
From the monorepo root:
66
91
67
92
```bash
68
93
pnpm install
69
-
pnpm dev --filter imdb-best-season
70
-
```
71
-
72
-
Or from this directory:
73
-
74
-
```bash
75
-
pnpm dev # starts on port 3001
94
+
pnpm dev --filter imdb-best-season # starts on port 3001
76
95
```
77
96
78
97
### Running Tests
79
98
99
+
Playwright E2E tests cover the home page, search flow, theme toggling, show results, and accessibility:
100
+
80
101
```bash
81
-
pnpm test# run Playwright E2E tests (headless)
102
+
pnpm test# run all E2E tests (headless Chromium)
82
103
pnpm test:headed # run tests with browser visible
83
-
pnpm test:ui # open Playwright UI mode
84
-
pnpm test:debug # run tests with Playwright inspector
85
-
pnpm test:report #view test report
104
+
pnpm test:ui # open Playwright's interactive UI mode
105
+
pnpm test:debug # run tests with the Playwright inspector attached
106
+
pnpm test:report #open the HTML test report
86
107
```
87
108
88
109
## Project Structure
89
110
90
111
```
91
112
src/
92
113
├── app/
93
-
│ ├── page.tsx # Home (search, suggestion links, theme toggle)
Configured for Vercel with `npx turbo-ignore` for smart builds. API routes include CORS headers for cross-origin access.
146
+
Configured for Vercel with `npx turbo-ignore` for smart builds -- only rebuilds when files in this app or its shared dependencies change. API routes include CORS headers (`Access-Control-Allow-Origin: *`) and `X-Content-Type-Options: nosniff`.
0 commit comments