How samuelfriher/ull-auditorium-seating works
1. Overall shape
- This is a static Astro app with a vanilla TypeScript + DOM/SVG client architecture.
- There is no React/Vue component runtime; the UI is assembled directly through TypeScript classes that manipulate the DOM and SVG.
2. Application entry and pages
- src/pages/index.astro is the main application shell.
- src/pages/legal.astro provides the disclaimer/legal page referenced by the footer.
- src/main.ts is the client-side bootstrap for the interactive seating app.
3. Primary architectural pattern
- The app is organized as a decoupled MVC-like system:
- Controllers manage user actions and state changes.
- Views render UI and emit user events.
- Models hold domain state.
- Communication is mediated by a typed EventBus (src/events/EventBus.ts), which keeps views and controllers separated.
4. State and domain model
- src/models/AppState.ts appears to be the central application state container.
- The seating domain is modeled with:
- Venue, Section, Seat, SeatGroup
- GraduationGuestGroup
- VenueSerializer supports turning the full seating arrangement into/from a portable representation, enabling save/load workflows.
5. Venue definition and layout generation
- The auditorium layout is not hardcoded in a single view; it is generated from data modules in src/data/:
- UllAuditorium.ts
- AmphitheaterGenerator.ts
- BoxesGenerator.ts
- StallsGenerator.ts
- These generators define the physical structure of the venue, which is then consumed by the UI and allocation logic.
- VenueDefinitionLoader in src/utils/ likely bridges these definitions into runtime-ready models.
6. View layer responsibilities
- Views are split by responsibility and by screen area:
- src/views/venue/* renders the SVG seating map and seat/section interactions.
- src/views/groups/* manages group CRUD panels and list items.
- src/views/graduation/* contains the graduation/orla configuration UI.
- src/views/layout/* provides shared chrome such as toolbar and footer.
- The view layer is responsible for presentation and user interaction capture, not business logic.
7. Controller layer responsibilities
- Controllers orchestrate user workflows:
- AppController is the top-level coordinator.
- SelectionController handles seat selection behavior, including individual and drag selection.
- GroupController manages group create/edit/delete actions.
- GraduationController coordinates graduation mode configuration and allocation.
- ExportController handles import/export of seating state.
- Controllers are the main consumers of view events and the main mutators of application state.
8. Graduation mode as a distinct subsystem
- Graduation/orla functionality is a specialized workflow rather than a minor toggle.
- The subsystem combines:
- allocation logic in src/utils/GraduationAllocator.ts
- seat ordering in GraduationSeatSorter.ts
- location labeling in GraduationLocationLabeler.ts
- dedicated graduation views and panels
- This mode has its own data model (GraduationGuestGroup) and its own interaction flow, suggesting a bounded feature area inside the app.
9. Seat coloring, layout rules, and validation
- Several utility modules encode domain rules:
- ColorUtils and SeatColorResolver determine visual coloring for groups/selections.
- LayoutUtils and LayoutValidator ensure venue layouts are consistent and usable.
- These utilities sit between the raw venue definition and the rendered UI, preventing presentation logic from owning domain rules.
10. Data flow through the app
- A typical interaction flow is:
- user interacts with a view
- view emits an event on the EventBus
- controller updates AppState / domain objects
- utility logic validates or transforms data
- views re-render based on updated state
- Import/export and serialization provide another flow: current state → serializer/export controller → JSON file, and reverse on import.
11. Styling and assets
- Styling is split into focused CSS files under src/styles/ for main app, panels, venue rendering, and legal page.
- public/images/ holds static assets used by the site.
- Because the seating map is SVG-driven, styling is an important part of the functional UI, not just cosmetic layering.
12. Build, deployment, and quality tooling
- Astro handles static generation/building and the local dev server.
- CI/CD is automated via GitHub Actions in .github/workflows/deploy.yml, deploying to GitHub Pages on main.
- The repo includes strong test coverage with Vitest and mutation testing with Stryker, indicating the architecture is designed for logic-heavy, testable boundaries.
13. How to diagram the repository
- A good architecture diagram would show:
- Astro pages and bootstrap at the top
- EventBus in the middle as the communication backbone
- Controllers on one side, Views on the other, Models/Utilities beneath
- Venue generators feeding the domain model
- Export/import and graduation allocation as separate functional subsystems
- CSS/static assets as supporting presentation infrastructure
- GitHub Actions/GitHub Pages as the deployment boundary
Main entry points: AppController.ts AppController · AppView.ts AppView · VenueDefinitionLoader.ts Venue Loader · AppState.ts AppState
Components 29
App Shell
Astro entry pages and client bootstrap.
- App Shell · Main static entry page that hosts the interactive app.
src/pages/index.astro - Legal Page · Standalone disclaimer/legal page.
src/pages/legal.astro - Bootstrap · Client-side startup that wires the app together.
src/main.ts
Core MVC
Event bus, controllers, state, and serialization.
- EventBus · Shared event backbone between views and controllers.
src/events/EventBus.ts - AppState · Central mutable application state container.
src/models/AppState.ts - Serializer · Import/export and portable persistence for seating state.
src/models/VenueSerializer.ts - AppController · Top-level coordinator for app workflows.
src/controllers/AppController.ts - Selection · Seat selection and drag-selection interactions.
src/controllers/SelectionController.ts - Groups · Create, edit, and delete group workflows.
src/controllers/GroupController.ts - Export · Import/export workflow for seating state.
src/controllers/ExportController.ts
Venue Domain
Venue model, layout data, and loaders.
- Venue Loader · Bridges static venue definitions into runtime models.
src/utils/VenueDefinitionLoader.ts - Ull Auditorium · Base auditorium definition used by the app.
src/data/UllAuditorium.ts - Amphitheater · Generates amphitheater seating structure.
src/data/AmphitheaterGenerator.ts - Boxes · Generates box seating structure.
src/data/BoxesGenerator.ts - Stalls · Generates stalls seating structure.
src/data/StallsGenerator.ts - Venue · Core seating layout and structural domain model.
src/models/Venue.ts
Graduation
Specialized graduation/orla allocation workflow.
- Graduation · Orla/graduation configuration and allocation flow.
src/controllers/GraduationController.ts - Allocator · Assigns graduation guests to seats.
src/utils/GraduationAllocator.ts - Graduation Panel · Graduation/orla configuration UI panel.
src/views/graduation/GraduationPanelView.ts
Views
DOM/SVG view layer split by screen area.
- AppView · Top-level UI composition and app rendering.
src/views/AppView.ts - Venue Map · Renders the seating map and seat interactions.
src/views/venue/VenueView.ts - Group Panel · Group management UI panel.
src/views/groups/GroupPanelView.ts - Toolbar · Shared toolbar and top-level controls.
src/views/layout/ToolbarView.ts - Footer · Shared footer and legal link area.
src/views/layout/FooterView.ts
Support
Styling, assets, and deployment.
Connections 38
- App Shell → Bootstrap: loads · The Astro shell mounts the client app.
- Bootstrap → AppController: starts · Bootstrap creates the application coordinator.
- Bootstrap → AppView: mounts · Bootstrap initializes the root view.
- Bootstrap → Venue Loader: loads venue · Runtime venue data is prepared during startup.
- AppView → Venue Map: composes · Root view includes the seating map.
- AppView → Group Panel: composes · Root view includes group management.
- AppView → Graduation Panel: composes · Root view includes graduation controls.
- AppView → Toolbar: composes · Root view includes shared toolbar chrome.
- AppView → Footer: composes · Root view includes shared footer chrome.
- AppController → EventBus: subscribes · Coordinator listens to app-level events.
- AppController → AppState: mutates · Coordinator owns app state changes.
- AppController → Selection: delegates · Selection behavior is handled by a dedicated controller.
- AppController → Groups: delegates · Group workflows are delegated.
- AppController → Graduation: delegates · Graduation workflows are delegated.
- AppController → Export: delegates · Import/export workflows are delegated.
- Venue Map → EventBus: emits · Seat and section interactions become events.
- Group Panel → EventBus: emits · Group UI actions are published to the bus.
- Graduation Panel → EventBus: emits · Graduation panel actions are published to the bus.
- Toolbar → EventBus: emits · Toolbar actions are published to the bus.
- Selection → AppState: updates · Selection changes are stored in app state.
- Groups → AppState: updates · Group edits update the central state.
- Graduation → AppState: updates · Graduation configuration updates state.
- Export → Serializer: uses · Serialization powers import/export.
- Serializer → AppState: reads/writes · Serializer converts the application state.
- Venue Loader → Ull Auditorium: loads · Loader consumes the base auditorium spec.
- Venue Loader → Amphitheater: uses · Loader consumes amphitheater generation rules.
- Venue Loader → Boxes: uses · Loader consumes box generation rules.
- Venue Loader → Stalls: uses · Loader consumes stalls generation rules.
- Venue Loader → Venue: builds · Definitions are materialized into venue models.
- Allocator → AppState: reads · Allocation uses current app state and seat data.
- Graduation → Allocator: invokes · Controller triggers graduation seat allocation.
- Venue Map → Venue CSS: styled by · SVG seating view depends on venue styling.
- AppView → Main CSS: styled by · Root shell uses primary styling.
- Legal Page → Legal CSS: uses · Legal page uses dedicated styles.
- Footer → Legal Page: links · Footer exposes the legal page.
- Deploy → App Shell: builds · CI builds the static site.
- Deploy → Legal Page: builds · CI builds the legal page.
- Deploy → Images: publishes · Deployment includes static assets.