diff --git a/.env.example b/.env.example index ecae912..b6b404b 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,10 @@ # App Configuration +# Per-standalone display name — sets browser tab title, PWA install +# name/short_name, and the brand string in console logs. Each standalone +# (events, wallet, chat, market, …) gets its own VITE_APP_NAME at build +# time via NixOS `services.webapp-standalones..displayName` (see +# server-deploy). cfaun ships the events app as "Bouge"; defaults to +# "Events" / "Wallet" / etc. when unset. VITE_APP_NAME=MyApp # Nostr Configuration @@ -14,7 +20,7 @@ VITE_WEBSOCKET_ENABLED=true # LNbits Nostr-transport server pubkey (kind-21000 RPC endpoint). # Logged by the LNbits server at startup: # `Nostr transport: starting with pubkey ... on N relay(s)` -# Required for the activities ticket scanner; legacy HTTP path still +# Required for the events ticket scanner; legacy HTTP path still # works without it. VITE_LNBITS_NOSTR_TRANSPORT_PUBKEY= @@ -35,8 +41,8 @@ VITE_PUSH_NOTIFICATIONS_ENABLED=true # Image Upload Configuration (pict-rs) VITE_PICTRS_BASE_URL=https://img.mydomain.com -# Activities / Sortir Configuration -# Default language for the standalone activities app (fr, en, es) +# Events App Configuration +# Default language for the standalone events app (fr, en, es) VITE_DEFAULT_LOCALE=fr # Default map center as "lat,lng" (defaults to France center if not set) VITE_DEFAULT_MAP_CENTER=42.9667,1.6000 @@ -64,7 +70,7 @@ VITE_MARKET_NADDR=naddr1qqjxgdp4vv6rydej943n2dny956rwwf4943xzwfc95ekyd3evenrsvrr # # In LOCAL DEV with `npm run dev:all` use the per-app dev ports (defined # in the vite configs): -# VITE_HUB_ACTIVITIES_URL=http://localhost:5181 +# VITE_HUB_EVENTS_URL=http://localhost:5181 # VITE_HUB_LIBRA_URL=http://localhost:5180 # VITE_HUB_WALLET_URL=http://localhost:5182 # VITE_HUB_CHAT_URL=http://localhost:5183 @@ -74,7 +80,7 @@ VITE_MARKET_NADDR=naddr1qqjxgdp4vv6rydej943n2dny956rwwf4943xzwfc95ekyd3evenrsvrr # VITE_HUB_RESTAURANT_URL=http://localhost:5187 # # In PATH-MODE production (recommended for demo) — note the trailing slash: -# VITE_HUB_ACTIVITIES_URL=https://demo.example.com/activities/ +# VITE_HUB_EVENTS_URL=https://demo.example.com/events/ # VITE_HUB_LIBRA_URL=https://demo.example.com/libra/ # VITE_HUB_WALLET_URL=https://demo.example.com/wallet/ # VITE_HUB_CHAT_URL=https://demo.example.com/chat/ @@ -84,11 +90,11 @@ VITE_MARKET_NADDR=naddr1qqjxgdp4vv6rydej943n2dny956rwwf4943xzwfc95ekyd3evenrsvrr # VITE_HUB_RESTAURANT_URL=https://demo.example.com/restaurant/ # # In SUBDOMAIN-MODE production: -# VITE_HUB_ACTIVITIES_URL=https://sortir.example.com +# VITE_HUB_EVENTS_URL=https://events.example.com # VITE_HUB_LIBRA_URL=https://libra.example.com # ...etc # ─────────────────────────────────────────────────────────────────────── -VITE_HUB_ACTIVITIES_URL= +VITE_HUB_EVENTS_URL= VITE_HUB_LIBRA_URL= VITE_HUB_WALLET_URL= VITE_HUB_CHAT_URL= diff --git a/CLAUDE.md b/CLAUDE.md index b85fab5..5b890de 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -717,7 +717,7 @@ VITE_WEBSOCKET_ENABLED=true ## Payment Rails Pattern Shared primitives for modules that mix Lightning + fiat (and, future, -cash / internal-wallet) payment rails. Activities is the first +cash / internal-wallet) payment rails. Events is the first consumer; restaurant + marketplace will adopt the same primitives as their backends gain fiat support. @@ -784,7 +784,7 @@ type PaymentMethod = { ``` Module usage: -- **Activities** passes `[lightning, ...one entry per organizer provider]`. +- **Events** passes `[lightning, ...one entry per organizer provider]`. - **Restaurant** (future) passes the subset of `[lightning, cash, internal, ...fiat providers]` enabled by the restaurant's `accepts_*` flags. diff --git a/docs/nostr-patterns/README.md b/docs/nostr-patterns/README.md index b69da5a..237b681 100644 --- a/docs/nostr-patterns/README.md +++ b/docs/nostr-patterns/README.md @@ -1,7 +1,7 @@ # Nostr patterns Living reference for reusable Nostr patterns that show up across modules -(activities, forum, market, chat, tasks, base, nostr-feed). +(events, forum, market, chat, tasks, base, nostr-feed). **Read before writing any new Nostr code in this repo.** **Update whenever you introduce, refine, or correct a pattern.** Each section has a "Canonical diff --git a/docs/nostr-patterns/publishing.md b/docs/nostr-patterns/publishing.md index 3fa9f4a..b0dbccb 100644 --- a/docs/nostr-patterns/publishing.md +++ b/docs/nostr-patterns/publishing.md @@ -2,7 +2,7 @@ ## Treat `result.success === 0` as failure, not success -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `if (!result || result.success <= 0) return null`. ```ts @@ -23,7 +23,7 @@ composable. Don't write code that silently treats both as success. ## Optimistic-on-success, not optimistic-on-click -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — local +**Canonical:** `src/modules/events/composables/useRSVP.ts` — local cache update after the `await` resolves with `success > 0`, before the relay echoes the event back through the subscription. @@ -39,7 +39,7 @@ button flip twice. ## Pending-coord debounce: disable the button during in-flight publish -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `pendingCoords: ref>` + `isPending(...)` predicate + `try { … } finally { pendingCoords.value.delete(coord) }`. @@ -66,7 +66,7 @@ while a previous publish on activity B is still flying. A global ## Sign with `nostr-tools.finalizeEvent`, take privkey as bytes -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `hexToUint8Array` helper + `finalizeEvent(template, signingKey)`. `finalizeEvent` expects a `Uint8Array`, not a hex string. Several composables diff --git a/docs/nostr-patterns/replaceable-events.md b/docs/nostr-patterns/replaceable-events.md index 602a623..0cad379 100644 --- a/docs/nostr-patterns/replaceable-events.md +++ b/docs/nostr-patterns/replaceable-events.md @@ -7,7 +7,7 @@ in this file follows from that single fact. ## Strictly-monotonic `created_at` per coord -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `lastPublishAt` map + the `Math.max(now, previous + 1)` line. ```ts @@ -31,7 +31,7 @@ than the last click on the same coord. ## Per-pubkey latest-wins state for derived counts -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `rsvpStates: ref>>` + `upsertRSVPState` + `getRSVPCount` (count entries where status === 'accepted'). @@ -51,7 +51,7 @@ any "who's currently in state X" question. ## Replaceable list, full-rewrite on toggle -**Canonical:** `src/modules/activities/composables/useBookmarks.ts` — +**Canonical:** `src/modules/events/composables/useBookmarks.ts` — NIP-51 kind 10003 bookmark list. For replaceable lists (10003 bookmarks, 10000 mute list, 10006 communities, @@ -66,7 +66,7 @@ diverges on next refresh. ## Vue 3 reactivity for nested `ref` -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `upsertRSVPState` (the `rsvpStates.value.set(coord, inner)` after mutating `inner`). diff --git a/docs/nostr-patterns/subscriptions.md b/docs/nostr-patterns/subscriptions.md index 5921351..3dcb1cd 100644 --- a/docs/nostr-patterns/subscriptions.md +++ b/docs/nostr-patterns/subscriptions.md @@ -2,7 +2,7 @@ ## Subscribe, store the unsubscribe handle, clean up on unmount -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `loadRSVPs()` (subscribe block) + the matching `onUnmounted(() => unsubscribe?.())`. ```ts @@ -33,7 +33,7 @@ session-long vs view-long), not by accident. ## EOSE means "backfill done", not "all events delivered" -**Canonical:** `src/modules/activities/composables/useRSVP.ts` — +**Canonical:** `src/modules/events/composables/useRSVP.ts` — `onEose: () => { isLoaded.value = true }`. `onEose` fires once, after the relay flushes everything stored that matches diff --git a/activities.html b/events.html similarity index 68% rename from activities.html rename to events.html index b555a4d..ef24349 100644 --- a/activities.html +++ b/events.html @@ -1,5 +1,5 @@ - + @@ -9,12 +9,12 @@ - Sortir — Activités - - + %VITE_APP_NAME% + +
- + diff --git a/nginx.conf.example b/nginx.conf.example index d3163ee..0c75a52 100644 --- a/nginx.conf.example +++ b/nginx.conf.example @@ -15,7 +15,7 @@ http { # PATH-MODE deployment (recommended) # # demo../ — minimal AIO chakra hub - # demo../activities/ — Sortir / activities standalone + # demo../events/ — events standalone # demo../market/ — marketplace standalone # demo../wallet/ — wallet standalone # demo../chat/ — chat standalone @@ -46,11 +46,11 @@ http { try_files $uri $uri/ /index.html; } - # ── Activities (Sortir) ────────────────────────────────────────── - location = /activities { return 301 /activities/$is_args$args; } - location /activities/ { - alias /var/www/aio/dist-activities/; - try_files $uri $uri/ /activities.html; + # ── Events ────────────────────────────────────────── + location = /events { return 301 /events/$is_args$args; } + location /events/ { + alias /var/www/aio/dist-events/; + try_files $uri $uri/ /events.html; } # ── Market ─────────────────────────────────────────────────────── @@ -107,13 +107,13 @@ http { # If you want pretty subdomain URLs that funnel into the path-mode # canonical, add 301 redirects per app. Example: # - # events.demo.. → demo../activities/ + # events.demo.. → demo../events/ # market.demo.. → demo../market/ # ─────────────────────────────────────────────────────────────────────── server { listen 8080; server_name events.demo..; - return 301 https://demo../activities/$request_uri; + return 301 https://demo../events/$request_uri; } server { listen 8080; @@ -154,7 +154,7 @@ http { # # server { server_name app.; root /var/www/aio/dist; ... } # server { server_name market.; root /var/www/aio/dist-market; ... } - # server { server_name sortir.; root /var/www/aio/dist-activities; ... } + # server { server_name events.; root /var/www/aio/dist-events; ... } # server { server_name wallet.; root /var/www/aio/dist-wallet; ... } # server { server_name chat.; root /var/www/aio/dist-chat; ... } # server { server_name forum.; root /var/www/aio/dist-forum; ... } diff --git a/package.json b/package.json index 1770e19..4fea5ac 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,9 @@ "build": "vue-tsc -b && vite build", "preview": "vite preview --host", "analyze": "vite build --mode analyze", - "dev:activities": "vite --host --config vite.activities.config.ts", - "build:activities": "vue-tsc -b && vite build --config vite.activities.config.ts", - "preview:activities": "vite preview --host --config vite.activities.config.ts", + "dev:events": "vite --host --config vite.events.config.ts", + "build:events": "vue-tsc -b && vite build --config vite.events.config.ts", + "preview:events": "vite preview --host --config vite.events.config.ts", "dev:libra": "vite --host --config vite.libra.config.ts", "build:libra": "vue-tsc -b && vite build --config vite.libra.config.ts", "preview:libra": "vite preview --host --config vite.libra.config.ts", @@ -33,8 +33,8 @@ "dev:restaurant": "vite --host --config vite.restaurant.config.ts", "build:restaurant": "vue-tsc -b && vite build --config vite.restaurant.config.ts", "preview:restaurant": "vite preview --host --config vite.restaurant.config.ts", - "dev:all": "concurrently -n hub,libra,sortir,wallet,chat,forum,market,tasks,restaurant -c blue,magenta,cyan,yellow,green,blue,red,gray,green \"npm:dev\" \"npm:dev:libra\" \"npm:dev:activities\" \"npm:dev:wallet\" \"npm:dev:chat\" \"npm:dev:forum\" \"npm:dev:market\" \"npm:dev:tasks\" \"npm:dev:restaurant\"", - "build:demo": "npm run build && VITE_BASE_PATH=/sortir/ npm run build:activities && VITE_BASE_PATH=/libra/ npm run build:libra && VITE_BASE_PATH=/wallet/ npm run build:wallet && VITE_BASE_PATH=/chat/ npm run build:chat && VITE_BASE_PATH=/forum/ npm run build:forum && VITE_BASE_PATH=/market/ npm run build:market && VITE_BASE_PATH=/tasks/ npm run build:tasks && VITE_BASE_PATH=/restaurant/ npm run build:restaurant", + "dev:all": "concurrently -n hub,libra,events,wallet,chat,forum,market,tasks,restaurant -c blue,magenta,cyan,yellow,green,blue,red,gray,green \"npm:dev\" \"npm:dev:libra\" \"npm:dev:events\" \"npm:dev:wallet\" \"npm:dev:chat\" \"npm:dev:forum\" \"npm:dev:market\" \"npm:dev:tasks\" \"npm:dev:restaurant\"", + "build:demo": "npm run build && VITE_BASE_PATH=/events/ npm run build:events && VITE_BASE_PATH=/libra/ npm run build:libra && VITE_BASE_PATH=/wallet/ npm run build:wallet && VITE_BASE_PATH=/chat/ npm run build:chat && VITE_BASE_PATH=/forum/ npm run build:forum && VITE_BASE_PATH=/market/ npm run build:market && VITE_BASE_PATH=/tasks/ npm run build:tasks && VITE_BASE_PATH=/restaurant/ npm run build:restaurant", "electron:dev": "concurrently \"vite --host\" \"electron-forge start\"", "electron:build": "vue-tsc -b && vite build && electron-builder", "electron:package": "electron-builder", diff --git a/src/activities-app/App.vue b/src/activities-app/App.vue deleted file mode 100644 index ac80413..0000000 --- a/src/activities-app/App.vue +++ /dev/null @@ -1,139 +0,0 @@ - - - diff --git a/src/app.config.ts b/src/app.config.ts index c1447ea..6753927 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -3,8 +3,8 @@ import type { AppConfig } from './core/types' /** * Minimal AIO hub configuration. * The all-in-one app at app.${domain} ships only the base module — - * each feature module (wallet, chat, market, tasks, forum, activities, - * libra) is now its own standalone PWA at its own subdomain. + * each feature module (wallet, chat, market, tasks, forum, events, + * libra) is now its own standalone PWA at its own subdomain. */ export const appConfig: AppConfig = { modules: { diff --git a/src/app.ts b/src/app.ts index 557c324..48ce5e9 100644 --- a/src/app.ts +++ b/src/app.ts @@ -20,7 +20,7 @@ import { installLenientAuthGuard, markAuthReady, catchAllRoute } from '@/lib/rou * * The all-in-one app at app.${domain} now ships only the base module * plus a chakra icon hub linking out to the standalone module apps - * (wallet, chat, market, tasks, forum, activities, libra). + * (wallet, chat, market, tasks, forum, events, libra). */ export async function createAppInstance() { console.log('🚀 Starting AIO hub...') diff --git a/src/components/layout/AppShell.vue b/src/components/layout/AppShell.vue index c59b54c..20affdd 100644 --- a/src/components/layout/AppShell.vue +++ b/src/components/layout/AppShell.vue @@ -4,24 +4,23 @@ import { useRoute } from 'vue-router' import { Toaster } from '@/components/ui/sonner' import { useTheme } from '@/components/theme-provider' import BottomNav, { type BottomTab } from './BottomNav.vue' -import HubPill from './HubPill.vue' +import StandaloneMenu, { type SidebarNavItem } from './StandaloneMenu.vue' interface Props { /** App-specific tabs displayed before the constant Profile entry. */ tabs: BottomTab[] /** Active-tab matcher. Forwarded to BottomNav. */ isActive: (path: string) => boolean - /** Hide the top-right HubPill — only true when this shell is rendering - * the hub itself. Standalones leave this false (default). */ + /** Hide the top-right standalone menu — only true when this shell is + * rendering the hub itself. Standalones leave this false (default). */ hideHub?: boolean - /** Forwarded to BottomNav. Hub passes true so logged-out users can still - * reach prefs from the sheet. Standalones leave it false. */ - loggedOutOpensSheet?: boolean + /** App-specific nav items rendered at the top of the standalone menu. */ + sidebarNav?: SidebarNavItem[] } const props = withDefaults(defineProps(), { hideHub: false, - loggedOutOpensSheet: false, + sidebarNav: () => [], }) const route = useRoute() @@ -45,11 +44,13 @@ const isLoginPage = computed(() => route.path === '/login') v-if="!isLoginPage" :tabs="props.tabs" :is-active="props.isActive" - :logged-out-opens-sheet="props.loggedOutOpensSheet" /> - + - diff --git a/src/components/layout/HubPill.vue b/src/components/layout/HubPill.vue deleted file mode 100644 index dbe4f5a..0000000 --- a/src/components/layout/HubPill.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - diff --git a/src/components/layout/ProfileSheetContent.vue b/src/components/layout/ProfileSheetContent.vue index d08735a..26667b1 100644 --- a/src/components/layout/ProfileSheetContent.vue +++ b/src/components/layout/ProfileSheetContent.vue @@ -53,6 +53,9 @@ function goLogin() { + + +
+import { ref, type Component } from 'vue' +import { useI18n } from 'vue-i18n' +import { useRouter } from 'vue-router' +import { Menu } from 'lucide-vue-next' +import { + Sheet, + SheetContent, + SheetTrigger, +} from '@/components/ui/sheet' +import { Separator } from '@/components/ui/separator' +import ProfileSheetContent from './ProfileSheetContent.vue' + +export interface SidebarNavItem { + /** Display label. */ + name: string + /** Lucide (or any) component to render as the leading icon. */ + icon: Component + /** Optional route to navigate to on click. */ + path?: string + /** Optional click handler. Runs after navigation if both are set. */ + onClick?: () => void + /** Visual-only "active" predicate for highlight state. */ + isActive?: () => boolean +} + +interface Props { + /** App-specific nav items rendered at the top of the sheet. */ + items?: SidebarNavItem[] +} + +const props = withDefaults(defineProps(), { items: () => [] }) + +const { t } = useI18n() +const router = useRouter() +const open = ref(false) + +function handleClick(item: SidebarNavItem) { + if (item.path) router.push(item.path) + item.onClick?.() + open.value = false +} + + + diff --git a/src/components/ui/avatar/index.ts b/src/components/ui/avatar/index.ts index 5367952..0cc8926 100644 --- a/src/components/ui/avatar/index.ts +++ b/src/components/ui/avatar/index.ts @@ -5,7 +5,7 @@ export { default as AvatarFallback } from './AvatarFallback.vue' export { default as AvatarImage } from './AvatarImage.vue' export const avatarVariant = cva( - 'inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden', + 'inline-flex items-center justify-center font-normal text-secondary-foreground select-none shrink-0 bg-secondary overflow-hidden', { variants: { size: { diff --git a/src/composables/useModularNavigation.ts b/src/composables/useModularNavigation.ts index a29efd2..17a6abc 100644 --- a/src/composables/useModularNavigation.ts +++ b/src/composables/useModularNavigation.ts @@ -26,7 +26,7 @@ export function useModularNavigation() { items.push({ name: t('nav.home'), href: '/', requiresAuth: true }) // Add navigation items based on enabled modules - if (appConfig.modules.activities?.enabled) { + if (appConfig.modules.events?.enabled) { items.push({ name: t('nav.events'), href: '/events', @@ -67,14 +67,20 @@ export function useModularNavigation() { const userMenuItems = computed(() => { const items: NavigationItem[] = [] - // Activities module items (events + tickets) - if (appConfig.modules.activities?.enabled) { + // Events module items (tickets + my events) + if (appConfig.modules.events?.enabled) { items.push({ name: 'My Tickets', href: '/my-tickets', icon: 'Ticket', requiresAuth: true }) + items.push({ + name: 'My Events', + href: '/my-events', + icon: 'CalendarPlus', + requiresAuth: true + }) } // Market module items diff --git a/src/core/di-container.ts b/src/core/di-container.ts index fa6e762..f406812 100644 --- a/src/core/di-container.ts +++ b/src/core/di-container.ts @@ -147,9 +147,9 @@ export const SERVICE_TOKENS = { // Nostr transport (kind-21000 RPC over relays — LNbits backend) NOSTR_TRANSPORT_SERVICE: Symbol('nostrTransportService'), - // Activities services (Nostr-native events + ticketing module) - ACTIVITIES_NOSTR_SERVICE: Symbol('activitiesNostrService'), - ACTIVITIES_TICKET_API: Symbol('activitiesTicketApi'), + // Events services (Nostr-native NIP-52 calendar events + LNbits ticketing) + EVENTS_NOSTR_SERVICE: Symbol('eventsNostrService'), + EVENTS_TICKET_API: Symbol('eventsTicketApi'), TICKET_API: Symbol('ticketApi'), // Invoice services diff --git a/src/events-app/App.vue b/src/events-app/App.vue new file mode 100644 index 0000000..ee16fb1 --- /dev/null +++ b/src/events-app/App.vue @@ -0,0 +1,164 @@ + + + diff --git a/src/activities-app/app.config.ts b/src/events-app/app.config.ts similarity index 92% rename from src/activities-app/app.config.ts rename to src/events-app/app.config.ts index eaada70..983c0f8 100644 --- a/src/activities-app/app.config.ts +++ b/src/events-app/app.config.ts @@ -8,8 +8,8 @@ function parseMapCenter(envValue: string | undefined, fallback: { lat: number; l } /** - * Standalone activities app configuration. - * Only enables base + activities modules. + * Standalone events app configuration. + * Only enables base + events modules. */ export const appConfig: AppConfig = { modules: { @@ -34,8 +34,8 @@ export const appConfig: AppConfig = { } } }, - activities: { - name: 'activities', + events: { + name: 'events', enabled: true, lazy: false, config: { diff --git a/src/activities-app/app.ts b/src/events-app/app.ts similarity index 80% rename from src/activities-app/app.ts rename to src/events-app/app.ts index 581a6e2..4e6963f 100644 --- a/src/activities-app/app.ts +++ b/src/events-app/app.ts @@ -7,7 +7,7 @@ import { container } from '@/core/di-container' import appConfig from './app.config' import baseModule from '@/modules/base' -import activitiesModule from '@/modules/activities' +import eventsModule from '@/modules/events' import App from './App.vue' @@ -16,30 +16,35 @@ import { i18n, changeLocale, type AvailableLocale } from '@/i18n' import { installLenientAuthGuard, markAuthReady, catchAllRoute } from '@/lib/router-helpers' import { acceptTokenFromUrl } from '@/lib/url-token' +const APP_NAME = (import.meta.env.VITE_APP_NAME as string) || 'Events' +// Console label shows the brand in parens only when it differs from the +// default — avoids the redundant "Events (Events)" on unbranded builds. +const APP_LABEL = APP_NAME.toLowerCase() === 'events' ? 'Events' : `Events (${APP_NAME})` + /** - * Initialize the standalone activities app + * Initialize the standalone events app */ export async function createAppInstance() { - console.log('🚀 Starting Sortir — Activities App...') + console.log(`🚀 Starting ${APP_LABEL}...`) // Accept token from URL before anything else (cross-subdomain auth relay) - acceptTokenFromUrl('Sortir') + acceptTokenFromUrl(APP_NAME) const app = createApp(App) // Collect routes from enabled modules only const moduleRoutes = [ ...baseModule.routes || [], - ...activitiesModule.routes || [], + ...eventsModule.routes || [], ].filter(Boolean) const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ - // Activities page is the home page in standalone mode + // Events page is the home page in standalone mode { path: '/', - redirect: '/activities' + redirect: '/events' }, { path: '/login', @@ -87,9 +92,9 @@ export async function createAppInstance() { ) } - if (appConfig.modules.activities?.enabled) { + if (appConfig.modules.events?.enabled) { moduleRegistrations.push( - pluginManager.register(activitiesModule, appConfig.modules.activities) + pluginManager.register(eventsModule, appConfig.modules.events) ) } @@ -114,7 +119,7 @@ export async function createAppInstance() { ;(window as any).__container = container } - console.log('✅ Sortir app initialized') + console.log(`✅ ${APP_LABEL} initialized`) return { app, router } } @@ -122,10 +127,10 @@ export async function startApp() { try { const { app } = await createAppInstance() app.mount('#app') - console.log('🎉 Sortir app started!') + console.log(`🎉 ${APP_LABEL} started!`) eventBus.emit('app:started', {}, 'app') } catch (error) { - console.error('💥 Failed to start Sortir app:', error) + console.error(`💥 Failed to start ${APP_LABEL}:`, error) document.getElementById('app')!.innerHTML = `

Failed to Start

diff --git a/src/activities-app/main.ts b/src/events-app/main.ts similarity index 82% rename from src/activities-app/main.ts rename to src/events-app/main.ts index e3bb49d..0cc2a0a 100644 --- a/src/activities-app/main.ts +++ b/src/events-app/main.ts @@ -14,7 +14,7 @@ registerSW({ }, intervalMS) }, onOfflineReady() { - console.log('Sortir app ready to work offline') + console.log(`${(import.meta.env.VITE_APP_NAME as string) || 'Events'} ready to work offline`) } }) diff --git a/src/activities-app/views/SettingsPage.vue b/src/events-app/views/SettingsPage.vue similarity index 83% rename from src/activities-app/views/SettingsPage.vue rename to src/events-app/views/SettingsPage.vue index be6b437..1594ac2 100644 --- a/src/activities-app/views/SettingsPage.vue +++ b/src/events-app/views/SettingsPage.vue @@ -35,27 +35,27 @@ async function handleLogout() {