How swamphacks/nfc-checkin works
This repository pairs an Expo mobile app for event staff with an Express API that records NFC-tag check-ins, workshop/social registrations, and redeemable claims. The main workflow is to scan a tag, choose a user or event context, submit the registration, and receive status feedback. The app also exposes separate meal, T-shirt, workshop, and social screens. Backend controllers query PostgreSQL. Source excerpts confirm the tag-linking screen and selected API handlers; other app-to-endpoint wiring is not fully sampled, so uncertain links are omitted.
Main entry points: index.tsx Link tag screen · SelectPage.tsx Event registration · index.js Express API · db.js PostgreSQL pool
Components 23
Staff mobile app
- Link tag screen
shxii-nfc-checkin/src/app/(tabs)/index.tsx - Event registration
shxii-nfc-checkin/src/components/SelectPage.tsx - Meals screen
shxii-nfc-checkin/src/app/(tabs)/Meals.tsx - T-shirts screen
shxii-nfc-checkin/src/app/(tabs)/TShirts.tsx - Workshops screen
shxii-nfc-checkin/src/app/(tabs)/Workshops.tsx - Socials screen
shxii-nfc-checkin/src/app/(tabs)/Socials.tsx - NFC scan hook
shxii-nfc-checkin/src/hooks/UseNfcScan.ts - QR scan hook
shxii-nfc-checkin/src/hooks/useQrScanner.ts - Registration hook
shxii-nfc-checkin/src/hooks/UseRegisterUser.ts - Scan feedback
shxii-nfc-checkin/src/utils/GlowFeedback.tsx - API URL hook
shxii-nfc-checkin/src/hooks/useApi.ts
Backend API
- Express API
nfc-backend/index.js - Check-in routes
nfc-backend/Routes/CheckinRoutes.js - Workshop routes
nfc-backend/Routes/WorkshopRoutes.js - Redeemable routes
nfc-backend/Routes/RedeemableRoutes.js - Check-in logic
nfc-backend/Controllers/CheckinController.js - Workshop logic
nfc-backend/Controllers/WorkshopController.js - Redeemable logic
nfc-backend/Controllers/RedeemableController.js
Persistence
- PostgreSQL pool
nfc-backend/db.js
Other components
- Event staff
- NFC tag
- Camera QR
- PostgreSQL
Connections 24
- Event staff → Link tag screen: uses
- Event staff → Event registration: uses
- Link tag screen → NFC scan hook: scans tag
- Link tag screen → QR scan hook: scans user QR
- Link tag screen → Registration hook: submits link
- Link tag screen → API URL hook: gets API URL
- Link tag screen → Scan feedback: shows result
- Event registration → NFC scan hook: scans tag
- Event registration → Registration hook: submits registration
- Event registration → API URL hook: gets API URL
- Event registration → Scan feedback: shows result
- NFC tag → NFC scan hook: provides tag ID
- Camera QR → QR scan hook: provides QR data
- Registration hook → Express API: sends request
- Express API → Check-in routes: mounts /api/checkin
- Express API → Workshop routes: mounts /api/workshops
- Express API → Redeemable routes: mounts /api/redeemables
- Check-in routes → Check-in logic: dispatches
- Workshop routes → Workshop logic: dispatches
- Redeemable routes → Redeemable logic: dispatches
- Check-in logic → PostgreSQL pool: queries
- Workshop logic → PostgreSQL pool: queries
- Redeemable logic → PostgreSQL pool: queries
- PostgreSQL pool → PostgreSQL: reads/writes