Skip to main content
Events are the core entity in Brautcloud, representing wedding celebrations. Couples create events to organize their photo galleries and share them with guests.

Event properties

Each event contains essential information about the wedding celebration:
@Entity
@Table(name = "events")
public class Event {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ManyToOne
    @JoinColumn(name = "user_id")
    private User user;

    private String eventName;

    private String location;

    private LocalDateTime date;

    private String password;

    private String qrCode;

    @Column(insertable = false, updatable = false)
    private LocalDateTime createdAt;

    @OneToMany(mappedBy = "event")
    private List<Image> images;
}

Core properties

eventName
string
required
The name of the wedding event (e.g., “Sarah & John’s Wedding”)
location
string
required
The wedding venue or location
date
LocalDateTime
required
The date and time of the wedding celebration
password
string
required
A password guests use to access the event and upload photos
qrCode
string
A QR code that guests can scan for quick access to the event
user
User
required
The couple who owns the event
Each event belongs to a single user (the couple), but multiple guests can access and contribute photos to the event using the event password.

Creating events

Couples create events after registering and logging in. The event creation process collects all necessary information about the wedding.

Event creation endpoint

@PostMapping
public void addEvent(@RequestBody EventRequest request) {
    eventService.addEvent(request);
}

Event creation service

public void addEvent(EventRequest request) {
    User user = userRepository.findById(request.getUserId())
        .orElseThrow(() -> new RuntimeException("User not found"));
    
    Event event = new Event();
    event.setEventName(request.getEventName());
    event.setLocation(request.getLocation());
    event.setDate(request.getDate());
    event.setPassword(request.getPassword());
    event.setQrCode(request.getQrCode());
    event.setUser(user);
    
    eventRepository.save(event);
}
The creation flow:
  1. Couple fills out event details in the frontend
  2. Request includes event name, location, date, and password
  3. System validates the user exists
  4. Event is created and associated with the user
  5. QR code can be optionally generated for easy guest access
The event password is a simple way for couples to control who can upload photos. Share this password with wedding guests so they can contribute their photos.

Guest access to events

Guests access events using the event password or by scanning a QR code. This allows them to view the photo gallery and upload their own photos without creating an account.

Access methods

Guests enter the event password to gain access. The password acts as a simple authentication mechanism that doesn’t require account creation. This makes it easy for all wedding guests to participate, regardless of their technical expertise.
Couples can generate a QR code for their event and display it at the wedding venue. Guests simply scan the code with their phones to instantly access the event and start uploading photos.
Guest access is designed to be frictionless. No account registration is required - just the event password or QR code.

Listing events

Authenticated users can view all events in the system. This endpoint returns a list of all events with their details.

List events endpoint

@GetMapping
public List<EventResponse> getEvents() {
    return eventService.getEvents();
}

Event service

public List<EventResponse> getEvents() {
    return eventRepository.findAll()
        .stream()
        .map(EventResponse::fromEvent)
        .toList();
}
The response includes:
  • Event ID
  • Event name
  • Location
  • Date
  • Owner information
  • Creation timestamp
In the current implementation, all authenticated users can see all events. In a production system, you may want to filter events to show only those owned by the current user or those they have access to.

Deleting events

Event owners can delete events they’ve created. This removes the event and all associated data.

Delete event endpoint

@DeleteMapping("/events/{eventID}")
public void deleteEvent(@PathVariable String eventID) {
    eventService.deleteEvent(Long.parseLong(eventID));
}

Deletion service

public void deleteEvent(Long eventID) {
    eventRepository.deleteById(eventID);
}
Deleting an event will also delete all associated images due to database cascade rules. Make sure to download any photos you want to keep before deleting an event.

Event workflow

Here’s the typical workflow for using events in Brautcloud:

Event request structure

When creating an event, the request body should include:
public class EventRequest {
    private Long userId;
    private String eventName;
    private String location;
    private LocalDateTime date;
    private String password;
    private String qrCode;
}

Example request

{
  "userId": 1,
  "eventName": "Sarah & John's Wedding",
  "location": "Garden Valley Resort",
  "date": "2026-06-15T14:00:00",
  "password": "love2026",
  "qrCode": "https://example.com/qr/abc123"
}
Keep event passwords simple and memorable so guests can easily type them on their phones. Avoid complex passwords with special characters.

Use cases

Wedding celebrations

The primary use case - couples create events for their wedding day to collect photos from all guests.

Engagement parties

Create events for pre-wedding celebrations like engagement parties or rehearsal dinners.

Multiple events

Couples can create separate events for different wedding-related celebrations (ceremony, reception, after-party).

Guest collaboration

All guests contribute to a shared photo gallery, capturing moments from different perspectives.

Build docs developers (and LLMs) love