Skip to content

vardwyn/fullstack_postgres_todoapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postgres-Only TODO (HTMX + PostgREST)

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 This Exists

  • Why not?
  • To establish PL/pgSQL supremacy

How This Exists

  • Single Postgres container preloaded with schemas auth, todo, and api.
  • PostgREST exposes the api schema; every screen is a SQL function returning HTML.
  • JWT auth with roles (web_anon, web_user) plus row‑level security on todo.tasks.
  • JWT stored in localStorage, sent via HTMX headers on requests

Screenshots

  • Landing page:
  • App view:

Running That

  1. Prereqs: Docker & Docker Compose.
  2. Add .env with JWT_SECRETand AUTHENTICATOR_PASSWORD, POSTGRES_USER and POSTGRES_PASSWORD.
  3. Run:
docker compose up --build
  1. Open http://localhost:3000/rpc/index in your browser.
  2. Log in with the demo (demo@example.com with password demo123!) user above or create a new account.

Usage Notes

  • 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.

Config Reference (.env)

  • JWT_SECRET – 32+ random chars; used by auth.sign_jwt.
  • AUTHENTICATOR_PASSWORD – password for the PostgREST database role authenticator.
  • POSTGRES_USER, POSTGRES_PASSWORD – standard Postgres bootstrap creds; POSTGRES_DB defaults to todo in compose.

Inspirations & Similar Projects

Used tech

About

Everything is a database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published