This project is a Proof of Concept (POC) for a classroom attendance app that uses a Bluetooth barcode scanner to log student check-ins and check-outs.
Each student has a barcode ID.
When scanned, the app records:
- Check-in time if the barcode hasn't been seen yet.
- Check-out time if the same barcode is scanned again.
At the end of a class, the instructor can send all attendance records to a mock API endpoint.
- Random Mode - Scan ANY barcode and it maps to a random student (perfect for demos!)
- Works with Bluetooth scanners in HID (keyboard emulation) mode
- Auto-Scan Demo Mode for digital-only demonstrations (no physical scanner needed!)
- Tracks check-ins and check-outs automatically
- Uses Zustand for lightweight state management
- Can handle 1000+ scans per session
- Sends all data to a mock API in one batch
- Expo-compatible (no native BLE code needed)
- 20 preset student barcodes for testing
- React Native (via Expo custom dev client)
- TypeScript
- Zustand — global state management
- Fetch API — mock data submission
- Expo Haptics — tactile feedback on scans
npm installnpx expo startThen choose your platform:
- Press
ifor iOS simulator - Press
afor Android emulator - Press
wfor web browser - Scan QR code with Expo Go app for physical device
- Instructor pairs Bluetooth scanner to the mobile device (as a keyboard).
- Each barcode scan "types" into a hidden
TextInput. - The app listens for
Enterkey → interprets it as a completed scan. - Zustand updates the in-memory list:
- First scan →
checkIntime. - Second scan →
checkOuttime.
- First scan →
- Instructor presses "Send to Server" → all records are POSTed to the API.
- Records are marked as "SENT" and displayed with a green indicator.
interface ScanRecord {
barcode: string;
checkIn: string;
checkOut?: string;
sent?: boolean;
}- Hidden TextInput: Captures barcode input from Bluetooth scanner
- Stats Display: Shows total check-ins, check-outs, and sent records
- Live Records List: Scrollable list of all attendance records
- Action Buttons:
- "Send to Server" - Batch submit to API
- "Clear All" - Reset all records
- List of 20 preset student barcodes for testing
- Format: Name + Barcode ID (e.g., "Alice Johnson - STU001")
- Useful reference during POC demos
- Pair your Bluetooth scanner with your device
- Open the Scanner tab in the app
- Random Mode is ON by default - the green toggle shows "✓ Random Mode ON"
- Scan ANY barcode you have (product barcode, book barcode, anything!)
- Each scan automatically assigns a random student
- Scan the same barcode again to check that student out
- Watch the app track check-in/check-out automatically!
Perfect for: Physical scanner demos without needing special barcodes!
Pro Tip: Scan different items around your room - a book, a box, your phone case - each maps to a different student!
- Open the Scanner tab
- Click "▶ Demo Mode" to expand the demo controls
- Click "Demo Check-ins (10)" to simulate 10 students checking in
- Click "Demo Check-outs (5)" to simulate 5 students checking out
- Watch the app animate scans automatically with haptic feedback!
Perfect for: Video recordings, presentations, and POC demonstrations
- Open the Scanner tab
- Click into the screen (this will focus the hidden input)
- Type a barcode manually (e.g., "s001A2JKWX")
- Press Enter on your keyboard
- The app will process it as a scan!
s001A2JKWX (Alice) s006F7TUZX (Fiona)
s002B3LMYX (Bob) s007G8VWWX (George)
s003C4NOZX (Charlie) s008H9XYYX (Hannah)
s004D5PQWX (Diana) s009I1ABZX (Isaac)
s005E6RSYX (Ethan) s010J2CDWX (Julia)
... and 10 more (see Students tab in app)
- Uses Zustand for efficient, lightweight state management
- Store located at
/store/attendance-store.ts - Handles 1000+ records without performance issues
- On barcode entry → check if barcode exists in store
- If new → create record with
checkIn: new Date().toISOString() - If exists without
checkOut→ addcheckOut: new Date().toISOString() - If exists with
checkOut→ ignore (or show warning)
- Endpoint:
https://jsonplaceholder.typicode.com/posts - Method: POST
- Payload: All attendance records + timestamp
- On success: Records marked as "sent"
barcode-scanner/
├── app/
│ ├── (tabs)/
│ │ ├── index.tsx # Scanner screen
│ │ ├── explore.tsx # Students list
│ │ └── _layout.tsx # Tab navigation
│ └── _layout.tsx # Root layout
├── store/
│ └── attendance-store.ts # Zustand state management
├── components/ # Reusable UI components
└── package.json
This proof of concept demonstrates:
- ✅ Bluetooth scanner integration without custom native code
- ✅ Real-time attendance tracking
- ✅ Efficient state management for high-volume scanning
- ✅ Clean, modern UI with haptic feedback
- ✅ Batch API submission of attendance data
- ✅ Easy testing with preset student barcodes
- Persistent storage (AsyncStorage or SQLite)
- Export to CSV/Excel
- Student photos and additional metadata
- Offline mode with sync queue
- Multi-class support with class sessions
- Student search and filtering
- Analytics and reporting
This is a proof of concept application for educational purposes.