RNQuiz
A multi-player real-time quiz app created with Node.js and React Native
Install / Use
/learn @anchetaWern/RNQuizREADME
RNQuiz
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.
Prerequisites
- React Native development environment
- Node.js
- Yarn
- Pusher Channels app instance
- ngrok account
Getting Started
- Clone the repo:
git clone https://github.com/anchetaWern/RNQuiz.git
cd RNQuiz
- Install the app dependencies:
yarn
- Eject the project (re-creates the
iosandandroidfolders):
react-native eject
- Link the packages:
react-native link react-native-gesture-handler
-
Update
.envfile with your Pusher app credentials. -
Set up the server:
cd server
yarn
-
Update the
server/.envfile with your Pusher app credentials. -
Run the server:
yarn start
-
If you're starting out with an empty
db.sqlitefile, accesshttp://localhost:5000/create-dbthenhttp://localhost:5000/create-quizon your browser. Otherwise, skip this step. -
Run ngrok:
./ngrok http 5000
-
Update the
src/screens/Login.jsandsrc/screens/Quiz.jsfile 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/questionson your browser to start publishing questions.
Built With
Donation
If this project helped you reduce time to develop, please consider buying me a cup of coffee :)
<a href="https://www.buymeacoffee.com/wernancheta" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
