Dorms API route #123
Labels
No labels
backend
beginner friendly
bug
chore
documentation
enhancement
frontend
needs-triage
no-stale
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
size/XS
stage/backlog
stage/done
stage/in progress
stage/in-progress
stage/ready
stale
wontfix
needs/docs
needs/research
needs/upstream
type/bug
type/external
type/feature
type/refactor
urgency
high
urgency
immediate
urgency
low
urgency
medium
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ScottyLabs/housing#123
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Overall Objective
Serve dorm data from the backend so the frontend stops shipping 26 buildings of JSON in its bundle and so building data can be corrected without a frontend release.
This is also our first public route. Dorm data is not user-specific, and guests browse buildings today via the "Continue as guest" path on the launch page, so this must work with no session cookie at all.
Requires Seeding Issue to be finished or picked up concurrently.
Suggested Approach
apps/backend/src/routes/dorms.tswith:GET /api/dorms, list all dorms.GET /api/dorms/:slug, one dorm, with a typed 404 when the slug is unknown..use(dbPlugin)and not.use(sessionAuth), with noif (!user)check.apps/backend/src/routes/health.tsis the unauthenticated shape;preferences.tsis the authenticated one.apps/backend/src/index.tsalongside.use(healthRoute).scoring.tsfilters 26 records in the browser and that is fine. We'll move it later maybehttp://localhost:3001/api/docs, then test again in a private window with no session cookie.Help & Resources