Skip to content

Venue and Theme Management Implementation

This document summarizes the implementation of venue and theme management functionality for Events in the Bartendie application.

Added comprehensive venue and theme management capabilities to allow users to:

  • Create, edit, and manage venues for hosting events
  • Create, edit, and manage themes for event styling
  • Assign venues and themes to events during event creation/editing

VenueList (frontend/src/components/venues/VenueList.jsx)

Section titled “VenueList (frontend/src/components/venues/VenueList.jsx)”
  • Displays all venues in a responsive card grid
  • Search functionality by name and description
  • Filter by venue type (Home, Restaurant, Bar, Hotel, Outdoor, Other)
  • Shows venue details: name, type, address, capacity, amenities
  • Empty state with call-to-action for first venue creation
  • Statistics showing total venues and capacity

VenueForm (frontend/src/components/venues/VenueForm.jsx)

Section titled “VenueForm (frontend/src/components/venues/VenueForm.jsx)”
  • Create new venues or edit existing ones
  • Comprehensive form with validation:
    • Basic Info: Name, description, type, capacity
    • Address: Street, city, state, ZIP code, country
    • Amenities: Add/remove amenity tags
    • Contact Info: Phone, email, website
  • Real-time validation with error messages
  • Supports both creation and editing modes

VenueDetail (frontend/src/components/venues/VenueDetail.jsx)

Section titled “VenueDetail (frontend/src/components/venues/VenueDetail.jsx)”
  • Complete venue information display
  • Address formatting and contact information
  • Amenities display with tags
  • Associated bars and events (when available)
  • Edit and delete actions with confirmation
  • Metadata showing creation and update dates

GraphQL Schema (lib/bartendie_web/schema/venue_types.ex)

Section titled “GraphQL Schema (lib/bartendie_web/schema/venue_types.ex)”
  • Complete venue object type with address and contact info
  • Input types for creation and updates
  • Address and contact info input objects
  • Venue type enumeration

GraphQL Resolvers (lib/bartendie_web/resolvers/venue.ex)

Section titled “GraphQL Resolvers (lib/bartendie_web/resolvers/venue.ex)”
  • list_venues/3 - Returns all venues with sample data
  • get_venue/3 - Returns specific venue by ID
  • create_venue/3 - Creates new venue
  • update_venue/3 - Updates existing venue
  • delete_venue/3 - Deletes venue

GraphQL Queries/Mutations (frontend/src/graphql/venueQueries.js, venueMutations.js)

Section titled “GraphQL Queries/Mutations (frontend/src/graphql/venueQueries.js, venueMutations.js)”
  • Complete CRUD operations
  • Proper field selection for address objects
  • Error handling and loading states

ThemeList (frontend/src/components/themes/ThemeList.jsx)

Section titled “ThemeList (frontend/src/components/themes/ThemeList.jsx)”
  • Displays themes in a responsive card grid
  • Search functionality by name and description
  • Color scheme preview with gradient display
  • Theme preview cards showing visual representation
  • Empty state with call-to-action

ThemeForm (frontend/src/components/themes/ThemeForm.jsx)

Section titled “ThemeForm (frontend/src/components/themes/ThemeForm.jsx)”
  • Create new themes or edit existing ones
  • Form sections:
    • Basic Info: Name and description
    • Color Scheme: Color picker with hex input, add/remove colors
    • Style Notes: Additional styling information
  • Live preview of color combinations and gradients
  • Color validation and management

ThemeDetail (frontend/src/components/themes/ThemeDetail.jsx)

Section titled “ThemeDetail (frontend/src/components/themes/ThemeDetail.jsx)”
  • Complete theme information display
  • Color scheme with individual color swatches
  • Gradient preview for multiple colors
  • Sample UI elements showing theme application
  • Usage guidelines and best practices
  • Edit and delete actions with confirmation

GraphQL Schema (lib/bartendie_web/schema/event_types.ex)

Section titled “GraphQL Schema (lib/bartendie_web/schema/event_types.ex)”
  • Theme object type with color scheme array
  • Input types for creation and updates
  • Created/updated timestamp fields

GraphQL Resolvers (lib/bartendie_web/resolvers/theme.ex)

Section titled “GraphQL Resolvers (lib/bartendie_web/resolvers/theme.ex)”
  • list_themes/3 - Returns sample themes with color schemes
  • get_theme/3 - Returns specific theme by ID
  • create_theme/3 - Creates new theme
  • update_theme/3 - Updates existing theme
  • delete_theme/3 - Deletes theme

GraphQL Queries/Mutations (frontend/src/graphql/themeQueries.js, themeMutations.js)

Section titled “GraphQL Queries/Mutations (frontend/src/graphql/themeQueries.js, themeMutations.js)”
  • Complete CRUD operations
  • Color scheme handling
  • Error handling and loading states
  • Added venue selection dropdown with capacity display
  • Added theme selection dropdown
  • Integrated with existing event creation/editing workflow
  • Proper GraphQL query imports from separate files
  • Fixed address display to handle address object structure
  • Proper formatting of venue address information
  • Integration with venue and theme data
  • Added “Venues” and “Themes” links to main navigation
  • Mobile-responsive navigation menu
  • Consistent styling with existing navigation
  • /venues - Venue list page
  • /venues/new - Create new venue
  • /venues/:id - Venue detail page
  • /venues/:id/edit - Edit venue
  • /themes - Theme list page
  • /themes/new - Create new theme
  • /themes/:id - Theme detail page
  • /themes/:id/edit - Edit theme
  • Uses shadcn/ui components for consistent styling
  • Responsive design for mobile and desktop
  • Loading states and error handling
  • Confirmation dialogs for destructive actions
  • Search and filter functionality
  • Empty states with helpful guidance
  • Real-time form validation
  • Visual previews for themes
  • Comprehensive error messages
  • Proper form labels and ARIA attributes
  • Keyboard navigation support
  • Color contrast considerations
  • Screen reader friendly

All components include comprehensive data-testid attributes for:

  • Form inputs and validation errors
  • Action buttons and navigation
  • Display elements and cards
  • Confirmation dialogs
  • Loading and error states
  • Backend provides realistic sample venues and themes
  • Proper address and contact information structure
  • Color schemes with hex values
  • Amenities and features lists
  • Proper field selection for nested objects (address, contact info)
  • Error handling with Apollo Client
  • Loading states and optimistic updates
  • Query refetching after mutations
  • Form state management with validation
  • Error state handling
  • Loading state coordination
  • Real-time updates
  • Separate query and mutation files
  • Reusable components and utilities
  • Consistent file structure
  • Proper imports and dependencies
  1. Navigate to /venues
  2. Click “Add New Venue”
  3. Fill in venue details, address, and amenities
  4. Save to create the venue
  1. Navigate to /themes
  2. Click “Add New Theme”
  3. Add colors to the color scheme
  4. Preview the theme appearance
  5. Save to create the theme
  1. When creating/editing an event
  2. Select a venue from the dropdown (optional)
  3. Select a theme from the dropdown (optional)
  4. Venue and theme information will be displayed in event details
  • Integration with actual event sourcing commands
  • Image upload for venues and themes
  • Advanced filtering and sorting options
  • Venue availability calendar
  • Theme templates and presets
  • Bulk operations for venues/themes
  • Integration with external venue APIs
  • Advanced color palette tools
  • Replace sample data with actual database operations
  • Implement proper event sourcing commands
  • Add data validation and constraints
  • Implement search and filtering at database level

This implementation provides a solid foundation for venue and theme management that integrates seamlessly with the existing event management system.