| status | done | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| depends | |||||||||||||
| specs |
|
||||||||||||
| issues |
|
||||||||||||
| pr | 207 |
The site becomes the system of record for Code for Philly's events, displacing
Meetup.com for the monthly hack night: staff create events, members RSVP with
one click, every RSVP gets a confirmation email with an .ics, and the events
show up on /events, on the home page, and in a subscribable calendar feed.
In: Event and EventRsvp sheets, schemas, indices, and importer-free
boot; the event and RSVP endpoints of api/events.md
including the two .ics routes; the one-click RSVP and its three-way
follow-up (plan + projectId) with the grouped attendee list; RSVP
confirmation, "event updated", and "cancelled" emails with calendar
attachments; /events, /events/past, /events/:slug, /events/new,
/events/:slug/edit screens; the home-page strip; header, footer, and
breadcrumb entries; /calendar and the /events/*past-style legacy
redirects; event-rsvp cascade on person purge.
Out: series and agendas (events-series-agenda
— the seriesId and agenda fields ship in the schema here as optional and
unused so no migration is needed later); the reminder sweep
(events-reminders); the four historical laddr events
(events-legacy-backfill); everything under
"Deferred" in deferred.md — private RSVPs,
recurrence, capacity, cover images, Slack announcements.
- data-model.md —
Event,EventRsvp, theeventSlugHistory type, cascade rules. - behaviors/events.md — everything except the Series, Agenda, and Reminders sections.
- api/events.md — the twelve
/api/eventsendpoints (not the/api/event-seriesgroup). - screens/events-index.md, screens/event-detail.md, screens/event-edit.md.
- screens/home.md — section 1b.
- behaviors/app-shell.md — nav, footer, breadcrumbs.
- behaviors/slug-handles.md — event slug rules and the new reserved words.
- behaviors/legacy-id-mapping.md —
the
/events/*…and/calendarrewrites. - api/conventions.md — the
text/calendarcarve-out. - api/people.md — purge cascade.
- Shared schemas.
packages/shared/src/schemas/event.tsandevent-rsvp.ts(Zod), exported from the index.remindersis an optional object with two optional ISO strings so pre-existing records validate. - Data repo configs. Add
.gitsheets/events.toml(root = 'events',path = '${{ slug }}') and.gitsheets/event-rsvps.toml(root = 'event-rsvps',path = '${{ eventSlug }}/${{ personSlug }}') tocodeforphilly-dataonempty,fixture, andpublished, following that repo's.claude/CLAUDE.md. Add two fixture events (one upcoming, one past) and a couple of RSVPs onfixture. The devsetup-dev-data.tsscript learns the two sheets. - Store. Register both sheets in
store/sheet-indices.tsandstate-apply.ts; indiceseventIdBySlug,eventIdByLegacyId,eventsByStartsAt,rsvpsByEvent,rsvpsByPerson. Hot reload replaces them like every other collection. - Services.
services/event.ts(reads: list bywhen, detail withviewerRsvp+ permissions, attendee list) andservices/event.write.ts(create, patch with slug-rename + RSVP path move +icsSequencebump, publish, cancel, delete,putRsvp,deleteRsvp).putRsvpnormalizes the follow-up:plan = projectrequires a resolvableprojectSlug; any other plan clearsprojectId. The attendee-list serializer emits records increatedAtorder and the client groups by project, then newcomer / no-project / unanswered. Reuse the existing slug-history helper. Permissions live inservices/permissions.ts. - iCalendar.
lib/ics.tsbuildsVCALENDARtext from anEventper the property table in the behavior spec; folded lines, escaped text,METHOD:PUBLISH. Pure function, unit-tested against fixed timestamps. Also exportsgoogleCalendarUrl(event). - Email. Extend
OutboundEmailwith optionalattachments: [{ name, contentType, content }]and map them inPostmarkTransport(Attachments[].Contentis base64). AddnotifyEventRsvp,notifyEventUpdated,notifyEventCancelledto theNotifierinterface,LoggingNotifier, andEmailNotifier, with templates innotify/templates.ts(HTML-escaped like the rest). All fire-and-forget from the services. - Routes.
routes/events.ts:feed.icsregistered before/:slug;.icsresponses setContent-Type: text/calendar; charset=utf-8andContent-Disposition. Standard envelope elsewhere. Add thecalendarandevents/*…rewrites toplugins/legacy-redirect.ts. - Web. Screens
EventsIndex,EventDetail,EventEditunderapps/web/src/screens/, routes inApp.tsx(/calendaras a<Navigate>), header/footer/breadcrumb entries, the home strip. Time formatting through one helper that always usesAmerica/New_YorkviaIntl.DateTimeFormatwithtimeZoneName: 'short'. - Tests. API: list windows (
when), draft visibility, RSVP create / update / withdraw / closed, project selection, slug rename moving RSVP files, cancel + delete guards,.icscontent, notifier spies. Web: RSVP control states, attendee grouping, form defaults (ends = start + 2h30), duplicate shift. Browser check of the three screens and the home strip.
-
GET /api/eventsreturns upcoming-by-end-time ascending;when=pastdescending; drafts only for staff. -
PUT …/rsvpcreates (201) then updates (200) and never duplicates;DELETEwithdraws; both answer409 rsvp_closedfor draft, cancelled, and ended events. - The follow-up round-trips:
plan = project+ slug stores both,plan = newcomerclearsprojectId,plan = projectwithout a slug is422; the detail page groups attendees by project, then "New to Code for Philly", "Looking for a project", "Not sure yet". - Confirmation email carries a
text/calendarattachment whoseUIDis<id>@codeforphilly.organd whoseSEQUENCEmatches the record. - Changing
startsAton a scheduled event with RSVPs bumpsicsSequenceand firesnotifyEventUpdatedonce per attendee; changingdescriptiondoes neither. -
cancelsetscancelledAt, keeps RSVPs, emails attendees withSTATUS:CANCELLED;DELETErefuses withhas_rsvpswhen RSVPs exist. - Renaming an event slug moves
event-rsvps/<old>/…toevent-rsvps/<new>/…in the same commit and writesSlugHistory. -
GET /api/events/feed.icslists scheduled and cancelled events from the last 90 days onward and never a draft; validates in a calendar client. -
/events,/events/past,/events/:slug,/events/new,/events/:slug/editrender per their screen specs in a browser; times showAmerica/New_Yorkwith the zone abbreviation regardless of the browser zone. - Home page shows the strip with an inline RSVP on the soonest event and hides the strip when nothing is upcoming.
-
/calendar,/events/*past,/events/*upcoming,/events/*all301 to their targets. - Person purge removes the person's event-rsvps.
-
npm run type-check && npm run lint && npm testclean.
- Postmark attachment size and MIME.
.icsfiles are tiny; the risk is Postmark rejecting an unexpectedContentType. Verifytext/calendaragainst the API before relying on it; fall back toapplication/octet-streamwith the.icsname if needed. - Gitsheets path move on slug rename. Moving a directory of RSVP records is a delete + write per record inside one transaction. Confirm the transact API handles the volume (tens of records) without special handling; project rename has the same shape today.
- Browser
webcal://handling. Some browsers won't open the scheme; the copy-to-clipboard fallback must be the visible second option, not a hidden one. - DST in the duplicate shift. "Same wall-clock time one month later"
must be computed in
America/New_York, not by adding seconds to the UTC instant, or a 6 PM hack night drifts to 5 PM across the November change.
- The feed was validated by content, not in a calendar client. The
.icstext is checked line-by-line intests/ics.test.ts(UID, SEQUENCE, folding at 75 octets, escaping, STATUS). Nobody subscribed a real calendar app to it yet; do that on sandbox before announcing thewebcal://link. - Develop moved under this plan. Seven PRs landed mid-build (gitsheets
2.7, incremental hot reload, vendored sheet configs, legacy-handle
normalization). Consequences:
store/sheet-indices.tsandscripts/setup-dev-data.tsno longer exist, so steps 2–3 above became "vendorevents.toml/event-rsvps.tomlintoapps/api/gitsheets/and register the sheets with the incremental-reload handlers (withunindex*inverses)";eventjoinedLegacyHandleEntitywith underscores allowed so the redirect plugin can resolvelaunchpad_2019. - RSVP records carry
eventSlugandpersonSlug. Like every composite-path sheet, the write service injects the path-template fields and the schema ispassthrough(); the sheet-config guard test lists them underWRITE_INJECTED_PATH_FIELDS. A slug rename rewrites every RSVP file under the new event slug in the same commit. - Direct
queryAll()after atransactis cached. The rename test asserts the moved files viagit ls-treeon the bare repo instead. agendais already accepted and validated byPOST/PATCH(range, sort, ≤ 50) and serialized withdescriptionHtml; only the form editor and series are left toevents-series-agenda.past,upcoming,all,feed,series,events,calendarare reserved slugs for every entity, per slug-handles.md's "any entity" rule. Backfilled records are unaffected (the check runs on user input).- Regenerating
.gitsheets/schemasalso refreshedProjectBuzzandTagAssignment, which had drifted from their Zod sources before this plan. - Data repo: sheet configs merged as codeforphilly-data #6 (
empty), #7 (fixture), #8 (published). No fixture event records were added there — the dev seed used here was a throwaway script; add fixture events when the series plan needs them. - Web resolutions worth knowing: a multi-day range crossing a DST change
labels both ends; the one-month shift clamps Jan 31 → Feb 28; the "Delete"
control is always shown to staff and disabled with a tooltip (spec aligned
in this PR); canonical URLs in Copy link / Google / webcal come from
window.location, so sandbox links point at sandbox. - Browser check on a seeded dev repo covered the index, detail (anonymous
and signed-in RSVP + follow-up), and home strip; it caught a null
descriptioncrash on the detail page, fixed here.
- Deferred to
events-series-agenda— duplicate mode copies the source event's series but not its agenda, because there is no agenda editor to review the copied rows in yet. - Tracked as: subscribe a real calendar client (Google Calendar, Apple
Calendar) to the sandbox
webcal://feed before the link is announced. - Tracked as: add one upcoming and one past fixture event (with RSVPs) to
codeforphilly-data
fixtureso dev boots show the screens populated.