π§ Manage gym check-ins and subscriptions with Supabase, Google Sheets, and QR codes
β‘ 58 views Β· π§ Miscellaneous
Description
Quick overview
Youtube Video: https://youtu.be/QyIalCCy6s8?si=Zlmde_oZz3qbDGwJ Github Repo: https://github.com/blankarrayy/automated-gym-checkin-system
This workflow handles gym entry via QR codes by validating check-in requests against Supabase subscription data, logging entry attempts in Supabase, it also generates QR codes for check-in and registration and syncs new user IDs to Google Sheets.
How it works
- Receives a POST request on the
/gymcheckinwebhook with header authentication and anentry_idquery parameter. - Looks up the
entry_idin the Supabaseentry_logstable to detect whether the QR code was already used. - If the
entry_idis unused, extracts the user ID from the request body and fetches subscription records from the Supabasegym_subtable. - Validates that the user exists and has an active subscription, then writes an entry attempt record to the Supabase
entry_logstable. - Returns a webhook response granting entry (200), rejecting unknown users (401), rejecting inactive subscriptions (401), or rejecting reused QR codes (409).
- On the
/qr-for-gym-checkinwebhook, generates a new check-in QR code (pointing to the/gymcheckinURL with a randomentry_id) and returns it as a binary image. - On the
/qr-for-new-account-registrationwebhook, generates a registration QR code and returns it as a binary image, and on the/account-creationwebhook it updates Supabase user subscription data and appends/updates the user ID and name in Google Sheets.
Setup
- Create Supabase API credentials in n8n and confirm the
gym_subandentry_logstables (and fields likeentry_id,user_id,is_subscribed, andname) match the workflowβs queries and inserts. - Add Google Sheets service account credentials, share the target spreadsheet with the service account email, and update the spreadsheet and sheet selection if you donβt use the included IDs.
- Configure the HTTP Header Auth credential and include the required auth header when calling any of the webhooks.
- Deploy the workflow and use the production webhook URLs in your QR code scanners and any signup/account-creation source that calls
/account-creation.
π Nodes Used
Webhook, Supabase
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File