Skip to content

refactor: optimize API, harden client, fix docs/CI issues - #13

Merged
injoon5 merged 1 commit into
mainfrom
claude/codebase-optimization-audit-8vvb7l
Jul 21, 2026
Merged

injoon5 merged 1 commit into
mainfrom
claude/codebase-optimization-audit-8vvb7l

Conversation

@injoon5

@injoon5 injoon5 commented Jul 20, 2026

Copy link
Copy Markdown
Owner

API (src/):
- Mask unknown/internal errors behind a generic 500 and log server-side
  instead of leaking error.message to clients
- Remove `credentials: true` from CORS (public, unauthenticated API)
- Make CORS origins env-overridable and add docs.timefor.school
- Drop the redundant handleRoute wrapper (onError already maps errors)
- Remove dead validation on /school and duplicate manual validation on
  /timetable (Typebox schemas already enforce it)
- Filter /classes by current academic year to avoid stale class names
- Use a total-order comparator for class sorting
- Consolidate NEIS client construction behind createNeisClient()
- Centralize the version string (API_VERSION) across / and OpenAPI
- Allow array-valued error `details` in the schema (matches actual bodies)
- Drop minItems:1 from list schemas so empty results don't 500
- Fix self-contradicting school example; simplify meal <br/> stripping

Client (packages/client/):
- Add fetch timeouts (AbortSignal.timeout) to NEIS and Comcigan requests
- Fix teacher-index decoding (% 1000 to match the /1000 subject radix)
- Cache the Comcigan /st code table (TTL) to cut a scrape per request
- Harden Comcigan parsing (guard 학교검색, matrix/list fields, NaN)
- Raise default NEIS pSize to 1000; correct the key doc comment
- Remove needless structuredClone of freshly-parsed homeroom data

Docs / CI / repo:
- Fix GitHub source links (apps/docs/ path prefix)
- Least-privilege workflow permissions + concurrency guard on auto-commit
- Untrack .idea/, .vscode/, and the local timetable.json dump; gitignore them
- Regenerate OpenAPI spec

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016iMMfLu3hPuAoBvaJbNfff
@vercel

vercel Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
school-api Ready Ready Preview, Comment Jul 20, 2026 1:33am
school-api-docs Ready Ready Preview, Comment Jul 20, 2026 1:33am

@cursor

cursor Bot commented Jul 20, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@injoon5
injoon5 merged commit 5ff7478 into main Jul 21, 2026
5 checks passed

This branch was successfully deployed

2 active deployments
Preview – school-api-docs — 82b69fde Deployed Jul 20, 2026 by vercel[bot]
Preview – school-api — 82b69fde Deployed Jul 20, 2026 by vercel[bot]
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.

2 participants