Make backend and frontend work together well, and add datasets/ page to frontend

This commit is contained in:
Zeph Levy 2026-01-14 11:23:43 +01:00
parent a5cda1d51c
commit b0f8d2c6c8
8 changed files with 107 additions and 5 deletions

20
db/initdb/init.sql Normal file
View file

@ -0,0 +1,20 @@
CREATE TABLE datasets (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
description TEXT
);
CREATE TABLE locations (
id SERIAL PRIMARY KEY,
name TEXT,
lat DOUBLE PRECISION NOT NULL,
lon DOUBLE PRECISION NOT NULL
);
CREATE TABLE records (
id SERIAL PRIMARY KEY,
dataset_id INTEGER NOT NULL REFERENCES datasets(id),
location_id INTEGER REFERENCES locations(id),
timestamp TIMESTAMPTZ NOT NULL DEFAULT now(),
data JSONB
);