Repository navigation
feat(calendar): serve the advent calendar at /calendrier with an admin - #50
Merged
maxitect merged 12 commits intoNov 13, 2026
Merged
Conversation
✅ Deploy Preview for clarksbowlingclub ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…the down migration
maxitect
marked this pull request as ready for review
November 13, 2026 00:09
maxitect
deleted the
feat/29-advent-calendar-live-at-calendrier-by-1-december
branch
November 13, 2026 00:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Loïc's advent calendar now lives at
/calendrier, with its doors, demos and look editable from the Payload admin. Built on Payload from #33 (the ticket still names #32).Changes
src/app/(calendar)/calendrier/_page/and rendered by a React page with its own root layout. Design is unchanged: at default settings the page is pixel-identical to the original (0 differing pixels, 1280 and 390 wide, closed and opened doors).calendar-doorscollection (day 1 to 24, localised title and note, MP3, optional colour and image) andcalendar-settingsglobal (behaviour, localised texts, five named colours with a picker, door colours, three font lists, background and share images). Two migrations: generated tables, thenCHECKconstraints on the day and the opening hour (registered indatabase.md).paper,inkororange(defaults reproduce the original hex values), so one setting moves them all.next/fontwith no preload; only the three selected are requested.font-synthesis: nonestops faked bold or italic./api/calendar(open doors, Paris time),/api/calendar/preview(members, all 24),/api/calendar/audio/[day](date check on every request, streams from the privatedemosbucket through Payload's own range-aware handler, no signed URL, nothing public). Demo files are not readable through/api/calendar-doors: that collection is members-only.visibleoff, orafterEnd = holdingafter 24 December, gives visitors a holding page and 404 on both endpoints; members keep the preview.?isFrench=true|false, else the browser language. Every string of the page exists in French and English; the editable ones are localised in the admin.DATABASE_URL./calendrieris rewritten to 404 like/adminand/api/*; the build passes without it.calendrierentry added toroutePolicies.docs/admin-guide.mdhas a calendar section for Loïc.Acceptance criteria
orangesetting changes every orangeclarksbowlingclub.com/calendriermatches on mobile and desktop/calendrier, endpoints and preview show no violations (#34)Closes
Closes #29
Notes
Deviations and decisions
@payloadcms/ui3.93.0 (already in the lockfile through@payloadcms/next). The colour picker needsuseField, and pnpm does not expose a transitive package. Same version as Payload.œand’(the site's own font file). The stack falls back to Bebas Neue for those two characters, so Bebas is only requested if one appears. A replacement font file would fix it properly.ink, notorange, so it does not follow theorangesetting./api/calendarresponse addsopen,memberand?v=on the audio URL (cache-busting for replaced demos); the download link uses&download=1accordingly.calendar-settingstag and the cache lifetime is capped at 50 seconds. In dev the first request after a save can still serve the old page for a few seconds.clientUploads: the browser PUTs the file straight to the bucket with a presigned URL. That needs a CORS rule on the bucket (post-merge step 2). Playing a demo goes through the function with range support: an 8 MB demo streamed in full and by range on the deploy preview.calendrierentry has empty extras. What/calendrierneeds: inline<style>and<script>('unsafe-inline'), fonts from'self'(next/font, no Google at runtime), audio from'self'(/api/calendar/audio/*; the opening sound is adata:MP3 decoded in memory, no fetch), door and background images from the storage origin (img-src).connect-src 'self'covers itsfetch. The page setsdocument.cookie(Path=/calendrier).Post-merge steps (production)
Production already has
DATABASE_URL,PAYLOAD_SECRET, theS3_*variables and the band admin account. The production build runspayload migrate, which applies the two new migrations on top of20261112_223859_initial.mainbefore anyone uploads a demo:NEON_PROFILE=tandem neon buckets create demos --branch main(private is the default). No new environment variable: the bucket name defaults todemos(S3_DEMOS_BUCKEToverrides it).demosbucket onmain: a CORS rule withAllowedMethods: ["PUT"],AllowedHeaders: ["*"],ExposeHeaders: ["ETag"]andAllowedOriginsset tohttps://clarksbowlingclub.com(addhttps://www.clarksbowlingclub.comif it serves the site). For example, with themainbranch's storage credentials inAWS_*:aws s3api put-bucket-cors --bucket demos --endpoint-url "$S3_ENDPOINT" --cors-configuration '{"CORSRules":[{"AllowedMethods":["PUT"],"AllowedOrigins":["https://clarksbowlingclub.com"],"AllowedHeaders":["*"],"ExposeHeaders":["ETag"],"MaxAgeSeconds":3600}]}'. Without it, uploads from the admin fail in the browser./admin, create the 24 doors, check Calendar settings, then open/calendriersigned in and use Mode test. Visible is off by default, so visitors get the holding page until the band ticks it and saves./calendrieron the live site on mobile and desktop.Review
Verdict: ALL CLEAR
Rounds: 2
20261112_232319_calendardown fails: the locked-documents FK is dropped afterDROP TABLE … CASCADEalready removed it/calendrierwould be public before the band is readyœor’; those two glyphs render in Bebas NeueRe-verified: migrations (db, Neon
previewreset to production's state: initial + imported content, no dev row) up PASS, down PASS, up again PASS · AC8 (api, browser) PASS: unsaved settings givevisible:false, visitor/calendrierholding page with noindex,/api/calendar404,/api/calendar/audio/1404,/api/calendar/preview403, member preview 200 · AC11 (code run ofgetCalendarDay) PASS at 30 Nov 23:00Z, opening hours 0/8/23 and 24–25 Dec · AC12 (api) PASS:/api/calendar-doorsand/file/01.mp3403, directdemosbucket URL 403 with the object present, signed-URL endpoint 403 signed out · missingdemosbucket: member audio 404, no 500 · AC16 (browser) PASS: no console violations on/calendrier(visitor, member, Mode test) or the admin colour picker · check.sh PASSEvidence
Local runs use the Neon
devbranch; the clock-dependent checks run with the server'sDateshifted to 10 December 2026, 12:00 Paris.AC1
Saving fires
revalidateTag("calendar-settings"); cache lifetime is capped at 50 s.AC2
AC3
AC4
AC5
AC6
AC7
AC8
AC9
Production is not reachable from a branch; checked on the deploy preview
https://deploy-preview-50--clarksbowlingclub.netlify.appinstead (390 px, English, screenshot taken; the layout matches the local one):AC10
AC11
AC12
AC13
AC14
AC15
AC16
Deploy preview
The preview build runs
payload migrateon a freshly reset Neonpreviewbranch, so the two new migrations apply on top of20261112_223859_initialexactly as they will onmain.DB (migration on Neon preview)