New hackathon website, developed during hackathon 2026
The project uses migration that can be found at db/migrations but to give a quick overview over the database structure a schema can be found here
CREATE TABLE users (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
is_admin BOOLEAN NOT NULL DEFAULT FALSE,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE TABLE sessions (
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
token uuid NOT NULL DEFAULT gen_random_uuid(),
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE TABLE projects (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
name text NOT NULL,
description text NOT NULL,
github_url text,
owner_user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE TABLE themes (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
name text UNIQUE NOT NULL,
creator_id uuid NOT NULL UNIQUE REFERENCES users(id) ON DELETE CASCADE,
is_selected BOOLEAN NOT NULL DEFAULT FALSE,
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE UNIQUE INDEX unique_selected_theme ON themes (is_selected) WHERE is_selected = TRUE;
CREATE TABLE theme_votes (
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
theme_id uuid NOT NULL REFERENCES themes(id) ON DELETE CASCADE,
created_at timestamptz NOT NULL DEFAULT now(),
UNIQUE (user_id, theme_id)
);