feat: port 3000, Stripe redirect, tryout date fix #52
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/westside-app!52
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "51-feat-port-fix-stripe-redirect-handler-tr"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Changes
Dockerfile: EXPOSE 80 → 3000nginx.conf: listen 80 → 3000src/routes/+page.svelte: Banner day text "This Saturday" → "This Tuesday"src/routes/register/+page.svelte: Photo upload endpoint/upload/photo→/api/register/upload-photo, added Stripe redirect handlerTest Plan
Review Checklist
Related
plan-wkq— Phase 1 (Commit Uncommitted Work)PR #52 Review
PR: feat: port 3000, Stripe redirect, tryout date fix
Branch:
51-feat-port-fix-stripe-redirect-handler-tr(from issue #51)Files changed: 4 (+10 / -4)
DOMAIN REVIEW
Tech stack: SvelteKit (static build) + nginx + Docker, deployed to k8s. Frontend consumes a FastAPI backend (
basketball-api).1. Port change (Dockerfile + nginx.conf) -- CORRECT
The
EXPOSE 80toEXPOSE 3000andlisten 80tolisten 3000changes align with the existing k8s manifests:k8s/deployment.yamlline 23:containerPort: 3000k8s/deployment.yamllines 69-70:port: 3000,targetPort: 3000k8s/ingress.yamlline 13:number: 3000This was a mismatch that would have caused the container to serve on port 80 while k8s probed port 3000 -- meaning the app was unreachable. This fix is correct and necessary.
2. Photo upload endpoint (
/upload/phototo/api/register/upload-photo) -- CORRECTThe old path
/upload/photodoes not match any route in the basketball-api. The new path/api/register/upload-photofollows the API's route prefix convention. TheapiUploadfunction in$lib/api.jsprependsAPI_BASE(https://basketball-api.tail5b443a.ts.net), so the full URL becomeshttps://basketball-api.tail5b443a.ts.net/api/register/upload-photo-- consistent with the API's/api/registernamespace.3. Stripe redirect handler -- CORRECT, NO OPEN REDIRECT RISK
The new code at lines 145-149 of
register/+page.svelte:I verified the backend source (
basketball-api/src/basketball_api/routes/register.pyline 1279):The
redirect_urlvalue is server-controlled -- it comes fromsettings.stripe_tryout_link, which resolves to a hardcoded Stripebuy.stripe.comURL. The backend test (test_promo_registration.pyline 157) even asserts"stripe.com" in body["redirect_url"]. There is no user-supplied input flowing into this URL. No open redirect risk.This also follows an established codebase pattern --
src/routes/jersey/+page.svelteline 69 does the identical thing:window.location.href = data.checkout_url.4. Tryout date "This Tuesday" -- FUNCTIONALLY CORRECT BUT FRAGILE
The change from "This Saturday" to "This Tuesday" fixes the immediate inaccuracy (March 24 is a Tuesday). However, this is a hardcoded relative day reference that will go stale after March 24.
BLOCKERS
None. All four changes are correct, security review passes, and the PR scope is tight.
Regarding test coverage: this repo has zero project-level tests (no
*.test.*or*.spec.*files outsidenode_modules). The changes here are:Given that (a) no test infrastructure exists in this repo, (b) the Stripe redirect is tested on the backend side (
test_promo_registration.py::TestCardRegistration::test_card_payment_returns_redirect_url), and (c) the changes are minimal config/wiring fixes, I am not blocking on missing frontend tests for this PR.NITS
"This Tuesday" will go stale. After March 24, the banner will be misleading. Consider either:
This is not blocking since it is a pre-existing pattern and the PR is fixing an already-stale value, but it will need attention again soon.
No loading/disabled state during Stripe redirect. After
window.location.href = result.redirect_url, thefinallyblock setssubmitting = false, which briefly re-enables the submit button before the browser navigates away. This is cosmetic -- thereturnprevents further execution and the navigation is near-instant -- but asubmitting = truehold until navigation completes would be slightly cleaner. Non-blocking.SOP COMPLIANCE
51-feat-port-fix-stripe-redirect-handler-trreferences #51)plan-wkq)PROCESS OBSERVATIONS
VERDICT: APPROVED