Repository navigation
4. Development
Turito Yuenan edited this page Jan 6, 2026
·
3 revisions
This documentation describes and explains implementation details in the system, including database, API, and Google Wallet integration.
- Event organisers:
- Stores information about event organisers in Tradao.
- Each organiser's email address must match the address in the Supabase
auth.userstable (foreign key is not implemented).
- Community events:
- Stores event data.
- This table has a longer name to prevent confusion with the generic and incredibly technical term "events".
- Contains a column for event description. The application currently only interpret it as plain text, but future versions can support Markdown syntax.
- Contains a column for thumbnail image URL. This column stores the public URL of the image file uploaded to the
assetsbucket, otherwise defaults tohttps://placehold.co/160x90.
- Event tickets:
- Stores event tickets created by participants after registering to events.
- Academic status:
- Lookup table for managing academic status
- This table mainly serves event registration.
- Example: freshman, sophomore, graduate.
- Fields of study:
- Lookup table for managing fields of study
- This table mainly serves event registration.
- Example: CS, media, business, design.
- Ticket with event details:
- Created to easily query ticket with all necessary data on the Ticket lookup page and pass to Google Wallet API.
- Joins Event tickets table with all other tables (except Event organisers, for now).
- (DEPRECATED) Upcoming events:
- Based on Community events table.
- Filter only events that starts at least two days after current time.
- Used to be created for filtering events displayed on the front page.
- Replaced by client-side logic and client requirement to show all events on the front page.
Supabase provides easy REST API generated using PostgREST for CRUD on all SQL tables, views, and functions. These API endpoints are accessible via the client library.
More complex logic are implemented within the SvelteKit application itself.
-
Auth
-
POST /login: Login to an admin or organiser account
-
-
Events
-
POST /api/events: Create a new event. Accepts form data due to supporting thumbnail image upload. -
PUT /api/events/{event_id}: Update an existing event. Currently does not support changing the thumbnail image. -
DELETE /api/events/{event_id}. Delete an existing event. Currently does not support deleting the thumbnail image.
-
-
Tickets
-
POST /api/tickets: Create a new event ticket. Mainly used for event registration. -
GET /api/tickets/{ticket_id}: Lookup an event ticket. Mainly used for check-in operations.
-
- A Google Wallet issuer account
- Used to authenticate to Google Wallet and manage pass classes.
- A Google Cloud service account with a JSON credential key
- Used to authenticate the SvelteKit application with Google Wallet.
- The Google Wallet API must also be enabled in the GCP project containing this service account.
- JSON templates for Pass Class and Pass Object
- Used to define the ticket's structure and appearance on Google Wallet.
flowchart TB
getPassClass --ERR--> errorPassClass
getPassClass --404--> postPassClass
getPassClass --YES--> getPassObject
postPassClass --ERR--> errorPassClass
postPassClass --YES--> getPassObject
getPassObject --ERR--> errorPassObject
getPassObject --404--> postPassObject
getPassObject --YES--> createSaveURL
postPassObject --ERR--> errorPassObject
postPassObject --YES--> createSaveURL