Skip to content

docs: add design notes to README - #55

Merged
enlorik merged 3 commits into
mainfrom
readme/design-notes
Jul 24, 2026
Merged

docs: add design notes to README#55
enlorik merged 3 commits into
mainfrom
readme/design-notes

Conversation

@enlorik

@enlorik enlorik commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Adds a 'Design notes' section on why the Express proxy exists (CORS + HTML parsing + rate limiting), why deterministic daily picks are a feature, why the rating band is asymmetric, and why Promise.allSettled instead of Promise.all.

@enlorik

enlorik commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 285a19fd94

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md Outdated

**Why a proxy server for a frontend app** — Codeforces doesn't send CORS headers, so the browser can't call the API directly. The Express proxy handles that, and also scrapes problem statement HTML, which is impossible cross-origin from the browser. A side benefit: one chokepoint for rate limiting, so a buggy client can't hammer Codeforces and get the shared hosting IP temporarily banned.

**Why the daily pick is deterministic** — The same UTC date produces the same problem for every user. Refreshing doesn't reroll (no slot-machine effect), the pick is trivially cacheable, and two people can discuss "today's graph problem" the way people discuss Wordle answers. It also makes the selection logic easy to test: fix the date and inputs, snapshot the expected output.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Clarify daily pick is per user, not global

This design note says the same UTC date produces the same problem for every user, but the daily selection first filters by userRating and solvedIds before applying the date seed (pickDailyProblem), so different handles/ratings/solved histories can get different candidates and different picks on the same day. This can mislead anyone using the README to reason about caching or user-visible behavior; it should say the result is deterministic for the same date and inputs rather than globally identical.

Useful? React with 👍 / 👎.

@enlorik

enlorik commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec9afe9a89

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md Outdated

## Design notes

**Why a proxy server for a frontend app** — Codeforces doesn't send CORS headers, so the browser can't call the API directly. The Express proxy handles that, and also scrapes problem statement HTML, which is impossible cross-origin from the browser. A side benefit: one chokepoint for rate limiting, so a buggy client can't hammer Codeforces and get the shared hosting IP temporarily banned.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Align the proxy note with direct contest fetches

This design note overstates the proxy as a single rate-limiting chokepoint: the Timeline and Bounty pages still call fetchCodeforcesContests(), which fetches https://codeforces.com/api/contest.list directly from the browser instead of going through /api/cf, so those requests bypass the Express rate limiter. As written, the README can mislead maintainers into thinking all Codeforces traffic is protected by the proxy; either qualify the note to the proxied endpoints or route contest fetching through the proxy too.

Useful? React with 👍 / 👎.

@enlorik

enlorik commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 81827fbcdc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@enlorik
enlorik merged commit f1031cb into main Jul 24, 2026
1 check passed
@enlorik
enlorik deleted the readme/design-notes branch July 24, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant