A multi-player real-time quiz app created with Node.js and React Native.
You can read the tutorial at https://pusher.com/tutorials/live-multiplayer-quiz-react-native.
- React Native development environment
- Node.js
- Yarn
- Pusher Channels app instance
- ngrok account
- Clone the repo:
git clone https://github.com/anchetaWern/RNQuiz.git
cd RNQuiz
- Install the app dependencies:
yarn
- Eject the project (re-creates the
ios
andandroid
folders):
react-native eject
- Link the packages:
react-native link react-native-gesture-handler
-
Update
.env
file with your Pusher app credentials. -
Set up the server:
cd server
yarn
-
Update the
server/.env
file with your Pusher app credentials. -
Run the server:
yarn start
-
If you're starting out with an empty
db.sqlite
file, accesshttp://localhost:5000/create-db
thenhttp://localhost:5000/create-quiz
on your browser. Otherwise, skip this step. -
Run ngrok:
./ngrok http 5000
-
Update the
src/screens/Login.js
andsrc/screens/Quiz.js
file with your ngrok https URL. -
Run the app:
react-native run-android
react-native run-ios
-
Log in to the app on two separate devices (or emulator).
-
Access
http://localhost:5000/questions
on your browser to start publishing questions.
If this project helped you reduce time to develop, please consider buying me a cup of coffee :)