Attendance app with React Native and BLE
An attendance app built with React Native, Pusher, and BLE. You can view the tutorial at the Pusher tutorial hub: Creating a realtime attendance app with React Native, BLE and Pusher
Note: the React Native code in this repo may be a little bit outdated and won't run immediately after you've followed the setup instructions. Be sure to refactor the code to use the more recent React Native syntax if it doesn't run for you.
- BLE peripheral device - I used a Raspberry Pi 3 in this tutorial, but you can also use any micro-controller with BLE support.
- BLE central device - any smartphone with bluetooth capabilities can act as a central device.
- Knowledge of React Native
- Knowledge of Git and GitHub
- Pusher Account and a Pusher app
- Create a new React Native app:
react-native init BLEPusherAttendance
- Clone the repo:
git clone https://github.com/anchetaWern/BLE-Pusher-Attendance.git
Navigate inside the
appdirectory and copy the
package.jsonfile to the new React Native project you just created.
Still inside the
appdirectory, copy the contents of
index.android.jsand paste it on the
index.jsfile of your React Native project.
Navigate inside your project folder and install the dependencies:
cd BLEPusherAttendance npm install
- Navigate inside the repo you cloned earlier and go inside the
cd BLE-Pusher-Attendance cd server
- Create a new
.envfile and replace the placeholder values with your Pusher app credentials:
APP_ID="YOUR PUSHER APP ID" APP_KEY="YOUR PUSHER APP KEY" APP_SECRET="YOUR PUSHER APP SECRET" APP_CLUSTER="YOUR PUSHER APP CLUSTER"
Still inside the
serverdirectory, open a new terminal window and execute
node attendance.jsto launch the server.
Navigate inside your new React Native project and open the
index.jsfile on your text editor:
cd BLEPusherAttendance nano index.js
Replace the placeholder values on lines 110 and 111 with your Pusher app credentials: https://github.com/anchetaWern/BLE-Pusher-Attendance/blob/master/app/index.android.js#L110-L111
Run the app on your device (emulator wouldn't work because there's no bluetooth in there):