A webhook service that takes tuition posts (pasted text), uses an LLM to extract structured fields, applies my filtering rules in plain code, and stores everything in Postgres.
Target filter: grade 5+, salary 8000+ BDT, English medium, in Notun Bazar / Baridhara / Badda.
POST /webhook -> verify secret -> validate input -> duplicate check (hash) -> LLM extracts fields (retry once) -> validate LLM output -> apply rules (rules.js) -> save as match / no_match / needs_review, or failed with the error
- LLM extracts, code decides. Filtering rules are deterministic and testable (
node test-rules.js). - LLM output is validated before use, since it can be malformed or wrong.
- Incomplete posts go to
needs_reviewinstead of being dropped. - Failures are stored with the error message, so nothing is silently lost.
- Duplicates are skipped via a hash of the normalized text, before spending an LLM call.
- Row Level Security is on, so the table is not exposed through Supabase's public API.
- Intake is manual (paste or forward a post) to stay within platform rules for private groups.
npm install- Run
schema.sqlin the Supabase SQL editor - Copy
.env.exampleto.envand fill it in node test-rules.js(rules test, no keys needed)node extract.js(tests extraction onsamples.json)node server.js
POST /webhookwith{ "text": "..." }GET /posts?status=match(alsono_match,needs_review,failed)
- Background queue so the webhook responds immediately
- Exponential backoff and alerting on repeated failures
- Telegram bot for intake and match notifications
- Replace
rejectUnauthorized: falsewith Supabase's CA certificate for production
Sample data in this repo is fake.