BISO Sites
Web AppFeatures

Events Feature

Event management system including listings, registrations, and attendance tracking.

Events Feature

The events system manages event creation, registration, and attendance for BISO Sites activities and programs.

Overview

Key capabilities:

  • Event listings with filtering
  • Event detail pages with registration
  • Attendance tracking
  • Calendar integration
  • Email notifications

Routes

  • /events - Event listings
  • /events/[id] - Event detail with registration

Implementation

Events Listing

// app/(public)/events/page.tsx
import { getEvents } from 'app/actions/events';
import { EventsListClient } from '@/components/events/events-list-client';

export default async function EventsPage() {
  const events = await getEvents();
  return <EventsListClient initialEvents={events} />;
}

Event Registration

// app/actions/events.ts
'use server';

import { createSessionClient } from '@repo/api/server';

export async function registerForEvent(eventId: string) {
  const { db, account } = await createSessionClient();
  const user = await account.get();
  
  await db.createDocument(
    process.env.NEXT_PUBLIC_APPWRITE_DATABASE_ID!,
    'event_registrations',
    'unique()',
    {
      eventId,
      userId: user.$id,
      registeredAt: new Date().toISOString(),
    }
  );
  
  return { success: true };
}

Database Schema

events

{
  "title": "string",
  "description": "string",
  "date": "datetime",
  "location": "string",
  "capacity": "integer",
  "imageUrl": "string",
  "category": "string",
  "departmentId": "string"
}

event_registrations

{
  "eventId": "string",
  "userId": "string",
  "registeredAt": "datetime",
  "attended": "boolean"
}