@@ -288,6 +288,8 @@ Copy `.env.example` to `.env.local` and set:
288288- ` SUPABASE_SERVICE_ROLE_KEY `
289289- ` MASTER_KEY ` (base64-encoded 32-byte key)
290290- ` REDIS_URL `
291+ - ` SYNC_QUEUE_BACKEND ` (` bull ` or ` supabase ` )
292+ - ` CRON_SECRET ` (required when ` SYNC_QUEUE_BACKEND=supabase ` )
291293- ` APP_URL `
292294- ` NEXT_PUBLIC_APP_NAME ` (optional, default ` ContributionPulse ` )
293295- ` NEXT_PUBLIC_APP_SLUG ` (optional, default derived from app name)
@@ -313,6 +315,50 @@ npm run worker:nightly
313315
314316` worker:nightly ` registers the repeatable nightly sync schedule. Run it once per environment.
315317
318+ ### Supabase queue mode (no Redis worker required)
319+ If you want to run without BullMQ/Redis for low-cost environments:
320+
321+ 1 . Set:
322+ ``` bash
323+ SYNC_QUEUE_BACKEND=supabase
324+ CRON_SECRET=< strong-random-secret>
325+ ```
326+
327+ 2 . Do not run ` npm run worker ` for queue processing.
328+
329+ 3 . Trigger queue processing by calling:
330+ ``` bash
331+ POST /api/internal/sync/process
332+ Authorization: Bearer < CRON_SECRET>
333+ ```
334+
335+ You can process manually:
336+ ``` bash
337+ npm run queue:process
338+ ```
339+
340+ 4 . Schedule this endpoint with Supabase Cron (example every minute):
341+ ``` sql
342+ select
343+ cron .schedule (
344+ ' process-contribution-sync-queue' ,
345+ ' * * * * *' ,
346+ $$
347+ select
348+ net .http_post (
349+ url := ' https://YOUR_APP_DOMAIN/api/internal/sync/process?limit=10' ,
350+ headers := jsonb_build_object(
351+ ' Content-Type' , ' application/json' ,
352+ ' Authorization' , ' Bearer YOUR_CRON_SECRET'
353+ ),
354+ body := ' {}' ::jsonb
355+ );
356+ $$
357+ );
358+ ```
359+
360+ This keeps BullMQ code in the project for future scale, while allowing Redis-free operation today.
361+
316362---
317363
318364## Testing
0 commit comments