refactor(events): rename activities module to events + wire VITE_APP_NAME for per-deployment branding #94
No reviewers
Labels
No labels
app:activities
app:chat
app:events
app:forum
app:libra
app:market
app:restaurant
app:tasks
app:wallet
app:webapp
bug
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
aiolabs/webapp!94
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor/events-module-rename"
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?
Why
The module was named
activitiesoriginally to avoid colliding with Nostr'sEventtype. In practice that defense added friction without preventing confusion — the backend extension is namedevents, NIP-52 calls them "Calendar Events", and the UI already displayed "Events". The collision withnostr-toolsEventis handled cleanly by the existingimport { Event as NostrEvent }alias pattern (already in 5 files inside the module). Renaming collapses the 4-way mismatch into one consistent term.Separately, deployments needed per-instance app names.
VITE_APP_NAMEwas already plumbed per-standalone via NixOSservices.webapp-standalones.<app>.displayName(e.g. cfaun shipped"Sortir", now rebranded to"Bouge"), but nothing in the standalone consumed it — PWA manifest, HTML title, and runtime branding were all hardcoded. This PR wires the env through every app-name display point so any deploy can flipdisplayName = "Bouge"(or anything) and pick up the brand end-to-end.What
Nine commits on the branch:
refactor(events): rename activities module to events— 70-file rename.src/modules/activities/→src/modules/events/,src/activities-app/→src/events-app/, types/services/composables/views/components/store renamed (Activity→Event,Activities→Events). Routes/activities/*→/events/*; the legacy/events(ticketing management) moves to/my-eventsso/eventsbelongs to the canonical feed. DI tokensACTIVITIES_*→EVENTS_*. i18n namespace renamed; English domain strings updated, French/Spanish title key realigned. npm scripts:activities→:events. Build outputdist-activities/→dist-events/.feat(events): wire VITE_APP_NAME through PWA manifest, HTML, runtime— PWA manifestname/short_nametemplate fromprocess.env.VITE_APP_NAMEwith fallback'Events'.events.htmluses Vite's%VITE_APP_NAME%substitution.src/events-app/app.ts+main.tsruntime brand string drives console logs, offline notification, andacceptTokenFromUrl().events.titleroute meta sources from VITE_APP_NAME..env.exampleupdated with per-standalone scoping notes.docs(events): update activities→events references—docs/nostr-patterns/*.md"Canonical: src/modules/activities/composables/useRSVP.ts" anchors point at renamed paths. CLAUDE.md Payment Rails Pattern section updated.fix(events): drop lowercase from PWA description brand name— minor casing fix caught during verification.fix(events): use domain noun in description, not brand name— manifest + HTML description switched from"Discover ${BRAND} near you"to static"Discover events near you". Description is about what the app does, not the brand.chore(events): scrub leftover sortir/activities references— nginx.conf.example, package.json (concurrently process label +build:demoBASE_PATH), router-helpers comment, useMarket comment, and vite.events.config.ts doc-comment.refactor(events): conditional brand in console label, tighten docs— addsAPP_LABELnext toAPP_NAMEinevents-app/app.ts. Reads asEventson unbranded builds andEvents (Bouge)(etc.) whenVITE_APP_NAMEis set to anything other than "Events" (case-insensitive). Used by all four console messages;acceptTokenFromUrlkeeps the rawAPP_NAME(it's a token-namespace identifier, not display copy). Also collapses the redundant "cfaun sets X; future deployments can override (e.g. X)" doc-comment.i18n(events): finish activité/actividad → événement/evento sweep— completes the i18n rename in fr.ts and es.ts (search placeholders, favorites prompts, settings prompt) and fixes five gender-agreement errors that came along with the masculineévénement/eventoswitch (French:Aucune ... trouvée→Aucun ... trouvé,préférées→préférés,d'une ... la sauvegarder→d'un ... le sauvegarder; Spanish:favoritas→favoritos,guardarla→guardarlo).chore(events): finish sortir → bouge sweep in .env.example— four remaining doc-comment refs in.env.example(cfaun branding, ticket-scanner comment, section header, subdomain-mode URL example).Cross-repo coordination
This PR has matching changes already pushed to two other repos. They have to land in a coordinated bump because the names are tightly coupled.
aiolabs/webapp-modulemain — commit9d82016. RenameshubActivitiesUrl→hubEventsUrlandVITE_HUB_ACTIVITIES_URL→VITE_HUB_EVENTS_URL. No backwards-compat shim.aiolabs/server-deploymain — commitsf15e1eb,bf4698b,d46a520:standalones.nixapps.eventsusesbuild:events/dist-events/events.html;hubUrlOptionmapsevents → "hubEventsUrl"; comment + cfaun-as-example doc switched from sortir/Sortir to bouge/Bouge.hosts/cfaun/default.nixrebranded:subdomain = "bouge"+displayName = "Bouge". (Native-French feedback retired the "Sortir" branding as awkward.)hosts/atio/default.nixstale "activities app" comment dropped (atio'sdisplayName = "Eventos"config is unchanged).server-deploy's
flake.lockstill pins the OLD webapp + OLD webapp-module, so nix builds from server-deploy main will fail until the bumps. Suggested order after this PR merges todev: one server-deploy commit that doesnix flake lock --update-input webapp-module+--update-input webapp-demotogether. DNS forbouge.ariege.ioneeds to point at the cfaun host before the deploy lands.Verification
pnpm typecheck— clean ✓pnpm build:events(default) —dist-events/manifest.webmanifesthasname: "Events", description "Discover events near you" ✓VITE_APP_NAME=Bouge pnpm build:events—name: "Bouge", HTML title "Bouge", console label resolves toEvents (Bouge)✓Sortir/sortir/activities/Activitiesreferences in events-module scope. (Domain false positives — "Market Activity" in market dashboard, "time-based activities" in nostr-feed content filters, "Activity Lifecycle Kills" in CLAUDE.md mobile-browser docs — are unrelated and intentionally left alone.)Not verified in-browser (no GUI in this session) — needs a manual smoke at
app.ariege.io/bouge/once the coordinated flake bump lands on cfaun. Watch for: feed loads,/events/calendar,/events/map,/events/favorites,/events/:idroutes work; "My Events" appears in the user dropdown and/my-eventsshows the management page; PWA install prompt shows "Bouge".Out of scope (deferred)
aiolabs/eventsis already named correctly.services.webapp-standalones.eventsis already correct.VITE_APP_NAMEcovers app-name only./activities/*to/events/*— pre-launch, public URL was/sortir/(path-mode) orsortir.ariege.io(subdomain-mode), never/activities/. No external bookmarks to preserve. (sortir.ariege.io→bouge.ariege.iois a separate decision; up to the deploy operator whether to keep a 301 for word-of-mouth referrers.)The module name "activities" was originally chosen to avoid colliding with Nostr's `Event` type. In practice the defense added friction without preventing confusion: the backend extension is named `events`, NIP-52 calls them "Calendar Events", and the UI already displayed "Events". The collision with `nostr-tools` `Event` is handled cleanly by the existing `import { Event as NostrEvent }` alias pattern (already in 5 files inside the module). Renames `src/modules/activities` → `src/modules/events` and `src/activities-app` → `src/events-app`. Touches: - Module dir + 48 internal files (types, services, composables, views, components, store) renamed with case-sensitive replacement (`Activity`→`Event`, `Activities`→`Events`). - Route paths: `/activities/*` → `/events/*`. The existing legacy `/events` route (ticketing management view) moves to `/my-events`, freeing `/events` for the canonical feed/discovery page. A new "My Events" entry is added to the user dropdown menu for access. - Standalone PWA entry: `activities.html` → `events.html`, `vite.activities.config.ts` → `vite.events.config.ts`. - npm scripts: `dev:activities`/`build:activities`/`preview:activities` → `:events`. `build:demo` and `dev:all` updated accordingly. - DI tokens: `SERVICE_TOKENS.ACTIVITIES_*` → `EVENTS_*`. - Hub config: `appConfig.modules.activities` → `modules.events`. - i18n: `activities.*` namespace → `events.*` in en/fr/es locales; English domain strings updated ("Activities"→"Events", "Search activities..."→"Search events..."). French/Spanish display values realigned to "Événements"/"Eventos" at the title key; deeper translation cleanup left for a follow-up. - Hub icon label: "Activities" → "Events"; env key `VITE_HUB_ACTIVITIES_URL` → `VITE_HUB_EVENTS_URL` (also updated in `.env.example`). - Stale `CreateActivityDialog.vue` removed (only referenced from a defunct comment; `CreateEventDialog.vue` is the live one). Build-output dir renamed `dist-activities/` → `dist-events/`; the `build:events` npm script reflects the new name. server-deploy still hardcodes `buildScript = "build:activities"` and `distDir = "dist-activities"` in `modules/services/standalones.nix:46-47`; a matching update there needs to land before this branch's webapp commit gets a flake-input bump. `Event` naming inside the module no longer collides with the Nostr `Event` import — those 5 files already use the `NostrEvent` alias. Disambiguation inside `EventsNostrService.queryCalendarEvents` was needed: local `events`/`event` variables for the domain side, with `nostrEvent`/`nostrEvents` for the protocol side. vue-tsc passes. PWA manifest still hardcodes "Sortir" branding; that is templated through `VITE_APP_NAME` in a follow-up commit on the same branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>The standalone events app was hardcoded to "Sortir" branding (PWA name "Sortir — Activités & Événements", HTML title, console logs, URL token handler ID). VITE_APP_NAME was already plumbed per-standalone via NixOS `services.webapp-standalones.<app>.displayName` in server-deploy, but nothing inside the app consumed it. Routes the env through every app-name display point: - PWA manifest `name` / `short_name` (vite.events.config.ts): both pull from `process.env.VITE_APP_NAME`, defaulting to `'Events'` when unset. Description, `id`, and `lang` un-frenched to brand-agnostic defaults. The Vite config also writes the resolved value back to `process.env` so Vite's built-in HTML `%VITE_APP_NAME%` substitution picks up the fallback. - HTML title + apple-mobile-web-app-title + description (events.html): use `%VITE_APP_NAME%` for build-time substitution. `<html lang>` drops the hardcoded `fr` (locale is now runtime-driven via i18n). - Runtime branding (events-app/app.ts, main.ts): a top-level `APP_NAME = (import.meta.env.VITE_APP_NAME as string) || 'Events'` feeds the console logs, the offline-ready notification, and the `acceptTokenFromUrl()` cross-subdomain handler. - Main events route title (modules/events/index.ts:32): reads VITE_APP_NAME so document.title / breadcrumbs show the deployment brand. Sub-route titles (Calendar, Map, Favorites) stay literal — they're contextual labels, not the app name. - .env.example now explains the per-standalone scoping and points at the NixOS knob for production deploys. Domain-noun strings ("Search events…", RSVP labels, "Your event was created") stay in i18n and translate per language — VITE_APP_NAME does not flow into those. Verification: `pnpm dev:events` → default `Events` brand; `VITE_APP_NAME=Bouge pnpm dev:events` → PWA manifest, tab title, console logs all show "Bouge". cfaun's existing `displayName = "Sortir"` keeps producing a Sortir-branded build via the same path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>Updates documentation that referenced the pre-rename `src/modules/ activities/` paths, useActivities composables, and ACTIVITIES_* SERVICE_TOKENS to match the new `src/modules/events/` layout. Touched: - docs/nostr-patterns/{README,publishing,subscriptions,replaceable-events}.md: the "Canonical: src/modules/activities/composables/useRSVP.ts" anchors used throughout these pattern docs now point at the renamed paths. - CLAUDE.md Payment Rails Pattern section: "Activities is the first consumer" / "Activities passes [...]" → "Events". The mobile-browser docs reference to "Activity Lifecycle Kills" (line 810) is left alone — that's Android browser terminology, not the events module. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>The description template was `Discover ${APP_NAME.toLowerCase()} near you`, producing "Discover bouge near you" / "Discover events near you" — inconsistent with the title casing. The brand should match the PWA name/short_name, not be lowercased. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>PWA manifest description and HTML meta description were templating the brand name in ("Discover Bouge near you" / "Discover Sortir near you"), which conflates app-name with domain noun. The description should say what the app does, not repeat the brand. Switches to static "Discover events near you" so the description remains stable across deployments while the title and short_name still flex per VITE_APP_NAME. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>