Skip to content

Instantly share code, notes, and snippets.

@ken-morel
Created April 26, 2026 19:57
Show Gist options
  • Select an option

  • Save ken-morel/227afb1e5a35f406e69f04144b6ae485 to your computer and use it in GitHub Desktop.

Select an option

Save ken-morel/227afb1e5a35f406e69f04144b6ae485 to your computer and use it in GitHub Desktop.

Eventra, my picture of it

Eventra is a relatively mid-complex, web-based platform which helps mainly Cameroonians organize events. A person having an account can create an event, sell tickets, create polls for votes, manage funds to hire people for the event.

A view of the schema.

Events

Events are the main thing the platform deals with

Users

So, a user can be one, or several of these:

  • Organizers: which organize events
  • Prestataire: which propose services at events
  • Participants: which participate in an event
create table users (
  id bigserial primary key not null, -- redundant

  username varchar(63) not  null,

  first_name varchar(63) not null,
  last_name varchar(63) not null,

  phone varchar(31), -- we will use 255 everywhere of course :D
  email varchar(63),

  birth_date date not null,
);

Events

Events are organized by one or more organizer, an event may have affiliated organizers, polls, prestataires and more.

The complexity comes on the events themselves, an event may have complex information with it, including:

Event schedule

Every event/subevent has it's own schedule associated to it directly

Sub events

This is just a way to mark different meetings, other things taking place in the big event.

create table events (
  id bigserial primary key not null,

  event_name varchar(255) not null,

  start_time datetime not null,
  end_time datetime not null,

);

create table subevents (
  id bigserial primary key not null,

  event_id bigint references evens(id) on delete cascade,

  subevent_name varchar(255) not null,
  subevent_description text,

  start_time datetime not null,
  end_time datetime not null,

);

Organizers

Every organizer is associated with a specific event and an event can have one or more organizers.

create table organizers (
  user_id bigint primary key references users(id) on delete cascade,

  event bigint references events(id) on delete cascade,
  role varchar(255) not null,
);

Polls / Votes

A poll or vote can be associated with an event, basically there is a poll/vote, there are candidate results associated with it, and there are the votes themselves.

create table polls (
  id bigserial primary key not null,
);
create table poll_candidates (
  poll_id bigint references polls(id) not null,
  candidate_id smallint not null,

  -- data for description/caption/...

  primary key (poll_id, candidate_id)
);
create table poll_vote (
  poll_id bigint references polls(id) not null,
  candidate_id smallint not null,
  voter_id bigint references users(id) not null,

  primary key (poll_id, candidate_id, voter_id);

);

Prestaterian

create table prestaterians (
  id bigint primary key references users(id) not null,
  tags text,

  -- bio/profile/...

);
create table prestaterian_reviews (
  prestaterian_id bigint references prestaterians(id) not null,
  reviewer_id bigint references prestaterians(id) not null,

  review_text varchar(511), -- or just text, depends
  review_score smallint,

  primary key (prestaterian_id, reviewer_id);
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment