Prepare for an eventual frontend

Move the backend code into a backend/ directory, and create a frontend/
directory containing an empty sveltekit project.
This commit is contained in:
Zeph Levy 2025-12-16 17:20:31 +01:00
parent d65efebb44
commit df7d4f3507
25 changed files with 461 additions and 2 deletions

20
backend/db/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
);