# feluiz/agavepass architecture

> Architecture diagram of the GitHub repository feluiz/agavepass, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/feluiz/agavepass
- Repository: https://github.com/feluiz/agavepass

## Overview

1. **Overall shape**
   - This is a **React + TypeScript single-page invitation site** for Danna’s XV, built with **Vite** and deployed through **Firebase Hosting**.
   - The app is split into a **public guest experience** and a **protected admin/operations area**.

2. **Public invitation experience**
   - The main guest-facing flow lives under `src/pages/InvitationPage.tsx`, likely assembled as the central landing/invitation screen.
   - The README describes 6 intended sections: introduction, photo gallery, event details/location, Pinterest outfit inspiration, lodging suggestions, and countdown + WhatsApp RSVP.

3. **Content and media subsystem**
   - Static assets are bundled in `src/assets`, including images and at least one music track (`Dancing-Queen.mp3`).
   - `FloatingPlayer.tsx` suggests persistent background audio playback, which is part of the invitation ambiance rather than core navigation.

4. **RSVP and guest interaction**
   - `RSVP.tsx`, `RSVPModal.tsx`, and `ActionModal.tsx` indicate a dedicated interaction flow for confirming attendance or triggering guest actions.
   - The README’s “boton de confirmación por WhatsApp” suggests the RSVP path may ultimately hand off to WhatsApp rather than only storing responses locally.

5. **Event and venue information**
   - `EventsSelector.tsx`, `Accomodations.tsx`, and `VenueCheckIn.tsx` point to multiple event-related pages:
     - selecting among event details,
     - showing lodging recommendations for out-of-town guests,
     - and a check-in workflow for the venue or event staff.
   - This implies the site supports both **informational guest browsing** and **operational event management**.

6. **Admin subsystem**
   - `AdminLogin.tsx`, `AdminDashboard.tsx`, and `layouts/AdminLayout.tsx` define a separate admin experience.
   - `AdminAuthContext.tsx` centralizes admin authentication state, while `ProtectedRoute.tsx` gates access to restricted routes.
   - This is the main boundary between public invitation content and privileged operational tools.

7. **App routing and composition**
   - `src/main.tsx` boots the app, and `src/App.tsx` is the likely route orchestrator.
   - Pages are organized by route-level screens, while reusable pieces live in `src/components`, making the architecture fairly clean: **pages for navigation targets, components for shared UI**.

8. **Firebase integration**
   - `src/context/firebaseConfig.ts` and the presence of the `functions/` directory show Firebase is a real part of the architecture, not just hosting.
   - The exact Firebase products are not explicit in the tree, but the project is set up for a **client app plus serverless backend** model.

9. **Serverless backend**
   - `functions/src/index.ts` is the entry point for Firebase Cloud Functions.
   - That backend is likely used for privileged or asynchronous workflows such as RSVP handling, event/admin actions, or data processing that should not live purely in the client.

10. **Deployment boundary**
   - `firebase.json`, `.firebaserc`, and `.firebase/hosting...cache` indicate the site is configured for **Firebase Hosting** deployment.
   - The frontend build is the primary deliverable, with Cloud Functions acting as the backend extension when needed.

11. **Shared UI and state boundaries**
   - `src/types/invitation.ts` defines the domain model for invitation-related data.
   - Shared state and app-wide behavior are concentrated in contexts and reusable components rather than duplicated across pages.

12. **Diagramming takeaway**
   - A good architecture diagram should show:
     - **Guest browser** → Firebase-hosted React app,
     - public pages/components for invitation content and RSVP,
     - a separate **admin-authenticated branch** for dashboard/check-in tools,
     - and a **Firebase Functions backend** behind any privileged or server-side actions.

Main entry points: [`src/App.tsx`](https://github.com/feluiz/agavepass/blob/main/src/App.tsx) (App), [`src/pages/InvitationPage.tsx`](https://github.com/feluiz/agavepass/blob/main/src/pages/InvitationPage.tsx) (Invitation), [`src/components/RSVP.tsx`](https://github.com/feluiz/agavepass/blob/main/src/components/RSVP.tsx) (RSVP), [`functions/src/index.ts`](https://github.com/feluiz/agavepass/blob/main/functions/src/index.ts) (Functions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend app"]
  node_main["main.tsx<br/>bootstrap<br/>[main.tsx]"]
  node_app["App<br/>router<br/>[App.tsx]"]
  node_invite["Invitation<br/>guest page<br/>[InvitationPage.tsx]"]
  node_landing["Landing<br/>public page"]
  node_events["Events<br/>event selector<br/>[EventsSelector.tsx]"]
  node_accom["Lodging<br/>guest info<br/>[Accomodations.tsx]"]
  node_checkin["Check-in<br/>venue flow<br/>[VenueCheckIn.tsx]"]
  node_rsvp["RSVP<br/>guest action<br/>[RSVP.tsx]"]
  node_rsvpmodal["RSVP modal<br/>guest modal<br/>[RSVPModal.tsx]"]
  node_actionmodal["Action modal<br/>guest modal<br/>[ActionModal.tsx]"]
  node_player["Music player<br/>media player<br/>[FloatingPlayer.tsx]"]
  node_adminlogin["Admin login<br/>auth page<br/>[AdminLogin.tsx]"]
  node_admindash["Dashboard<br/>admin page<br/>[AdminDashboard.tsx]"]
  node_adminlayout["Admin layout<br/>admin shell<br/>[AdminLayout.tsx]"]
  node_protect["Protected route<br/>route guard<br/>[ProtectedRoute.tsx]"]
  node_authctx["Admin auth<br/>context"]
  node_firebasecfg["Firebase config<br/>client config<br/>[firebaseConfig.ts]"]
  node_types["Invitation types<br/>domain model<br/>[invitation.ts]"]
  node_assets[("Assets<br/>media bundle")]
end

subgraph group_backend["Backend"]
  node_functions["Functions<br/>cloud backend<br/>[index.ts]"]
end

subgraph group_infra["Deployment"]
  node_hosting["Firebase Hosting<br/>deploy config<br/>[firebase.json]"]
end

node_main -->|"boots"| node_app
node_app -->|"routes to"| node_invite
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_events
node_app -->|"routes to"| node_accom
node_app -->|"routes to"| node_checkin
node_app -->|"routes to"| node_adminlogin
node_app -->|"routes to"| node_admindash
node_invite -->|"uses"| node_rsvp
node_rsvp -->|"opens"| node_rsvpmodal
node_rsvp -->|"uses"| node_actionmodal
node_invite -->|"includes"| node_player
node_invite -->|"loads"| node_assets
node_app -->|"guards"| node_protect
node_protect -->|"checks"| node_authctx
node_admindash -->|"wrapped by"| node_adminlayout
node_authctx -->|"initializes from"| node_firebasecfg
node_rsvp -.->|"may call"| node_functions
node_checkin -.->|"may call"| node_functions
node_app -->|"shares"| node_types
node_main -.->|"deployed via"| node_hosting
node_functions -.->|"paired with"| node_hosting

click node_main "https://github.com/feluiz/agavepass/blob/main/src/main.tsx"
click node_app "https://github.com/feluiz/agavepass/blob/main/src/App.tsx"
click node_invite "https://github.com/feluiz/agavepass/blob/main/src/pages/InvitationPage.tsx"
click node_landing "https://github.com/feluiz/agavepass/blob/main/src/pages/AgavePassLanding.tsx"
click node_events "https://github.com/feluiz/agavepass/blob/main/src/pages/EventsSelector.tsx"
click node_accom "https://github.com/feluiz/agavepass/blob/main/src/pages/Accomodations.tsx"
click node_checkin "https://github.com/feluiz/agavepass/blob/main/src/pages/VenueCheckIn.tsx"
click node_rsvp "https://github.com/feluiz/agavepass/blob/main/src/components/RSVP.tsx"
click node_rsvpmodal "https://github.com/feluiz/agavepass/blob/main/src/components/RSVPModal.tsx"
click node_actionmodal "https://github.com/feluiz/agavepass/blob/main/src/components/ActionModal.tsx"
click node_player "https://github.com/feluiz/agavepass/blob/main/src/components/FloatingPlayer.tsx"
click node_adminlogin "https://github.com/feluiz/agavepass/blob/main/src/pages/AdminLogin.tsx"
click node_admindash "https://github.com/feluiz/agavepass/blob/main/src/pages/AdminDashboard.tsx"
click node_adminlayout "https://github.com/feluiz/agavepass/blob/main/src/layouts/AdminLayout.tsx"
click node_protect "https://github.com/feluiz/agavepass/blob/main/src/components/ProtectedRoute.tsx"
click node_authctx "https://github.com/feluiz/agavepass/blob/main/src/context/AdminAuthContext.tsx"
click node_firebasecfg "https://github.com/feluiz/agavepass/blob/main/src/context/firebaseConfig.ts"
click node_types "https://github.com/feluiz/agavepass/blob/main/src/types/invitation.ts"
click node_assets "https://github.com/feluiz/agavepass/tree/main/src/assets"
click node_functions "https://github.com/feluiz/agavepass/blob/main/functions/src/index.ts"
click node_hosting "https://github.com/feluiz/agavepass/blob/main/firebase.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_app,node_invite,node_landing,node_events,node_accom,node_checkin,node_rsvp,node_rsvpmodal,node_actionmodal,node_player,node_adminlogin,node_admindash,node_adminlayout,node_protect,node_authctx,node_firebasecfg,node_types,node_assets toneBlue
class node_functions toneAmber
class node_hosting toneMint
```

## Components

### Frontend app

React/Vite client for the public invitation experience and admin UI.

- [main.tsx](https://github.com/feluiz/agavepass/blob/main/src/main.tsx): bootstrap · React app entrypoint · `src/main.tsx`
- [App](https://github.com/feluiz/agavepass/blob/main/src/App.tsx): router · Route orchestration and top-level composition · `src/App.tsx`
- [Invitation](https://github.com/feluiz/agavepass/blob/main/src/pages/InvitationPage.tsx): guest page · Primary public invitation experience · `src/pages/InvitationPage.tsx`
- [Landing](https://github.com/feluiz/agavepass/blob/main/src/pages/AgavePassLanding.tsx): public page · Alternate public landing screen · `src/pages/AgavePassLanding.tsx`
- [Events](https://github.com/feluiz/agavepass/blob/main/src/pages/EventsSelector.tsx): event selector · Event details and selection flow · `src/pages/EventsSelector.tsx`
- [Lodging](https://github.com/feluiz/agavepass/blob/main/src/pages/Accomodations.tsx): guest info · Accommodation recommendations for guests · `src/pages/Accomodations.tsx`
- [Check-in](https://github.com/feluiz/agavepass/blob/main/src/pages/VenueCheckIn.tsx): venue flow · Venue or staff check-in workflow · `src/pages/VenueCheckIn.tsx`
- [RSVP](https://github.com/feluiz/agavepass/blob/main/src/components/RSVP.tsx): guest action · Attendance confirmation flow · `src/components/RSVP.tsx`
- [RSVP modal](https://github.com/feluiz/agavepass/blob/main/src/components/RSVPModal.tsx): guest modal · RSVP interaction dialog · `src/components/RSVPModal.tsx`
- [Action modal](https://github.com/feluiz/agavepass/blob/main/src/components/ActionModal.tsx): guest modal · Generic action/confirmation dialog · `src/components/ActionModal.tsx`
- [Music player](https://github.com/feluiz/agavepass/blob/main/src/components/FloatingPlayer.tsx): media player · Persistent background audio playback · `src/components/FloatingPlayer.tsx`
- [Admin login](https://github.com/feluiz/agavepass/blob/main/src/pages/AdminLogin.tsx): auth page · Administrator sign-in screen · `src/pages/AdminLogin.tsx`
- [Dashboard](https://github.com/feluiz/agavepass/blob/main/src/pages/AdminDashboard.tsx): admin page · Operational admin console · `src/pages/AdminDashboard.tsx`
- [Admin layout](https://github.com/feluiz/agavepass/blob/main/src/layouts/AdminLayout.tsx): admin shell · Shared frame for protected admin screens · `src/layouts/AdminLayout.tsx`
- [Protected route](https://github.com/feluiz/agavepass/blob/main/src/components/ProtectedRoute.tsx): route guard · Access gate for restricted routes · `src/components/ProtectedRoute.tsx`
- [Admin auth](https://github.com/feluiz/agavepass/blob/main/src/context/AdminAuthContext.tsx): context · Admin authentication state · `src/context/AdminAuthContext.tsx`
- [Firebase config](https://github.com/feluiz/agavepass/blob/main/src/context/firebaseConfig.ts): client config · Client Firebase initialization · `src/context/firebaseConfig.ts`
- [Invitation types](https://github.com/feluiz/agavepass/blob/main/src/types/invitation.ts): domain model · Shared invitation data definitions · `src/types/invitation.ts`
- [Assets](https://github.com/feluiz/agavepass/tree/main/src/assets): media bundle · Images and music used by the invitation · `src/assets`

### Backend

Firebase Functions entry point for server-side workflows.

- [Functions](https://github.com/feluiz/agavepass/blob/main/functions/src/index.ts): cloud backend · Firebase serverless backend · `functions/src/index.ts`

### Deployment

Firebase hosting and project configuration.

- [Firebase Hosting](https://github.com/feluiz/agavepass/blob/main/firebase.json): deploy config · Hosting deployment and project setup · `firebase.json`

## Connections

- main.tsx → App: boots · Client entry mounts the app shell
- App → Invitation: routes to · Primary guest experience
- App → Landing: routes to · Public landing entry
- App → Events: routes to · Event information flow
- App → Lodging: routes to · Guest lodging info
- App → Check-in: routes to · Operational venue flow
- App → Admin login: routes to · Admin sign-in
- App → Dashboard: routes to · Protected admin console
- Invitation → RSVP: uses · Invitation includes RSVP interaction
- RSVP → RSVP modal: opens · RSVP interaction is dialog-driven
- RSVP → Action modal: uses · Shared action confirmation UI
- Invitation → Music player: includes · Ambient audio player
- Invitation → Assets: loads · Photos and music assets
- App → Protected route: guards · Restricts admin-only routes
- Protected route → Admin auth: checks · Authorization state comes from context
- Dashboard → Admin layout: wrapped by · Admin screens share a common shell
- Admin auth → Firebase config: initializes from · Client auth depends on Firebase setup
- RSVP → Functions: may call · Server-side handling for RSVP or privileged actions
- Check-in → Functions: may call · Backend support for operational workflows
- App → Invitation types: shares · Common invitation domain model
- main.tsx → Firebase Hosting: deployed via · Frontend build is hosted on Firebase
- Functions → Firebase Hosting: paired with · Backend complements hosted client
