Entire stack in the database!
Todo app where the entire (almost) "full‑stack" lives inside PostgreSQL.
Actually needs PostgREST to serve the SQL-defined UI and HTMX for the rest.
- Why not?
- To establish PL/pgSQL supremacy
- Single Postgres container preloaded with schemas
auth,todo, andapi. - PostgREST exposes the
apischema; every screen is a SQL function returning HTML. - JWT auth with roles (
web_anon,web_user) plus row‑level security ontodo.tasks. - JWT stored in
localStorage, sent via HTMX headers on requests
- Prereqs: Docker & Docker Compose.
- Add
.envwithJWT_SECRETandAUTHENTICATOR_PASSWORD,POSTGRES_USERandPOSTGRES_PASSWORD. - Run:
docker compose up --build- Open
http://localhost:3000/rpc/indexin your browser. - Log in with the demo (
demo@example.comwith passworddemo123!) user above or create a new account.
- All UI actions are POST/GET to
/rpc/*endpoints (e.g.,/rpc/add_task,/rpc/html_task_list). - If you break the DB, drop the volume (
docker volume rm fullstack_postgres_todoapp_db_data) and restart. - No rate limiting, backups, filters, etc.
JWT_SECRET– 32+ random chars; used byauth.sign_jwt.AUTHENTICATOR_PASSWORD– password for the PostgREST database roleauthenticator.POSTGRES_USER,POSTGRES_PASSWORD– standard Postgres bootstrap creds;POSTGRES_DBdefaults totodoin compose.
- HTMX official site: https://htmx.org
- PostgREST: https://postgrest.org

