Opinionated Reddit-style app with subforums, posts, comments, auth-only access, edit/delete, and comment history logging. Frontend is static (Vite/React) and deploys to GitHub Pages; backend is Supabase (auth + PostgREST).
- Auth: email/password (Supabase) with RLS enforcing authenticated read/write.
- Subforums: create/list; posts are scoped to a subforum; threads hidden until a subforum is selected.
- Threads: create/edit/delete posts; search by title/body within selected subforum.
- Comments: create/edit/delete; updated flag and history logging in
comment_history. - History: all post/comment inserts/updates/deletes logged server-side (
posts_history,comment_history). - Hosting: GitHub Pages; build uses secrets for Supabase envs.
npm install
cp .env.example .env # set VITE_SUPABASE_URL + VITE_SUPABASE_ANON_KEY
npm run dev- Create a Supabase project; grab anon key + project URL (paste into
.env). - In SQL editor, run
supabase.sqlto create/alter tables:sub_forums,posts(withsubforum_id,updated_at),comments(withupdated_at), history tablesposts_history,comment_history.- RLS: auth-only select; insert/update/delete limited to owner; history tables readable and insertable by authenticated users (for triggers).
- Triggers:
updated_aton posts/comments; log all post/comment inserts/updates/deletes into history tables.
- Test: sign up/sign in, create a subforum, post, and comment.
- Repo secrets (Settings → Secrets → Actions):
VITE_SUPABASE_URL: your Supabase URLVITE_SUPABASE_ANON_KEY: your Supabase anon key
- Ensure Pages uses GitHub Actions.
- Push to
main; workflow.github/workflows/deploy.ymlbuilds with secrets and deploys to Pages. - To trigger manually: GitHub → Actions → Deploy to GitHub Pages → Run workflow.
- Local deploy (optional):
npm run deploy(requires.env). - If the deploy is blocked by environment protection, approve the
github-pagesenvironment in Actions or loosen the environment rules, then re-run the workflow.
.envis ignored; never commit keys.- Prod build will throw if
VITE_SUPABASE_URL/VITE_SUPABASE_ANON_KEYare missing. - Vite
baseis set to/reddit-lite/for Pages compatibility.
- API surface is plain Supabase tables; adjust RLS for stricter/looser rules if embedding elsewhere.
- Subforum scoping: posts require
subforum_id; UI hides threads until a subforum is selected. - Comment history: available in
comment_historyfor auditing/edit logs.