Public-cloud deployment of a single-user expense tracker: - 4-container stack: Caddy (HTTPS via Let's Encrypt), nginx (React/Vite SPA), Express API, Postgres 16 - Repeatable deployment via prepare-app.sh using only OCI CLI (no web console) - Persistent Postgres volume, auto-restart policies, healthchecks, backup + restore scripts - DuckDNS dynamic DNS for the public hostname; secrets isolated to gitignored .env Author: Gigi Saji Live URL: https://savesave.duckdns.org
14 lines
487 B
SQL
14 lines
487 B
SQL
-- Schema bootstrap. Runs only once, when the data volume is empty
|
|
-- (postgres official image executes /docker-entrypoint-initdb.d/ files on first init).
|
|
|
|
CREATE TABLE IF NOT EXISTS expenses (
|
|
id SERIAL PRIMARY KEY,
|
|
amount NUMERIC(12,2) NOT NULL,
|
|
category TEXT NOT NULL,
|
|
note TEXT,
|
|
spent_at DATE NOT NULL,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS expenses_spent_at_idx ON expenses (spent_at DESC);
|