Skip to content

Commit

Permalink
Updated to api v49.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pozil committed Sep 1, 2020
1 parent 389a703 commit 3d91e64
Show file tree
Hide file tree
Showing 67 changed files with 10,845 additions and 6,827 deletions.
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Multiplayer quiz app built on Salesforce technology (host app)

[![GitHub Workflow](https://github.com/pozil/quiz-host-app/workflows/CI/badge.svg?branch=master)](https://github.com/pozil/quiz-host-app/actions) [![GitHub Workflow](https://github.com/pozil/quiz-host-app/workflows/Packaging/badge.svg)](https://github.com/pozil/quiz-host-app/actions) [![codecov](https://codecov.io/gh/pozil/quiz-host-app/branch/master/graph/badge.svg)](https://codecov.io/gh/pozil/quiz-host-app)
[![GitHub Workflow](https://github.com/fostive/quiz-host-app/workflows/CI/badge.svg?branch=master)](https://github.com/fostive/quiz-host-app/actions) [![GitHub Workflow](https://github.com/fostive/quiz-host-app/workflows/Packaging/badge.svg)](https://github.com/fostive/quiz-host-app/actions) [![codecov](https://codecov.io/gh/fostive/quiz-host-app/branch/master/graph/badge.svg)](https://codecov.io/gh/fostive/quiz-host-app)

1. [About](#about)
1. [Installation](#installation)
Expand All @@ -13,6 +13,7 @@
1. [Player App Installation](#step-2-player-app-installation)
1. [Host App Configuration](#step-3-host-app-configuration)
1. [Questions Setup](#step-4-questions-setup)
1. [Performance and Scalability](#performance-and-scalability)
1. [Playing](#playing)
1. [Troubleshooting](#troubleshooting)
1. [Building and contributing](#building-and-contributing)
Expand Down Expand Up @@ -67,7 +68,7 @@ We assume that you have a working Salesforce DX environment (Salesforce CLI inst
1. Open a Terminal and clone the git repository:

```
git clone https://github.com/pozil/quiz-host-app.git
git clone https://github.com/fostive/quiz-host-app.git
cd quiz-host-app
```
Expand All @@ -92,7 +93,7 @@ We assume that you have a working Salesforce DX environment (Salesforce CLI inst
1. Generate a [security token](https://help.salesforce.com/articleView?id=user_security_token.htm) for your Salesforce user.
1. Generate a secure password using [this service](https://passwordsgenerator.net/) or any other. This will be the secret **Quiz API Key** that you'll set later in both applications.
1. Deploy the **Quiz Player App** to Heroku by clicking this button:
<a target="_blank" href="https://heroku.com/deploy?template=https://github.com/pozil/quiz-player-app/edit/master" title="Deploy to Heroku">
<a target="_blank" href="https://heroku.com/deploy?template=https://github.com/fostive/quiz-player-app/edit/master" title="Deploy to Heroku">
<img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy to Heroku"/>
</a>
Expand Down Expand Up @@ -178,6 +179,19 @@ You can import questions with the Salesforce CLI.
sfdx force:data:tree:import -p data/CUSTOM_QUESTIONS/plan.json
```
## Performance and Scalability
Performance is critical to the game experience: it must be as close as possible to real-time.
In full transparency, we have no precise benchmark on how well the game scales and which kind of Dyno to use but here are some pointers:
- A free Heroku Dyno supports a 50 player game just fine.
- The app has worked flawlessly with 400 players on a Heroku Performance dyno but we never tested with more.
All the pressure lies on the Heroku infrastructure and in particular on the Node.js WebSocket server. We cannot guarantee how the network (sockets and load balancer) behave at large scale.
Note that Heroku datacenters are only available in North America and Europe. If you are running the quiz from another region (i.e.: India, Australia...), there's a chance that players will experience some lag.
## Playing
🎥 [Watch the playthrough video](https://www.youtube.com/watch?v=vLTZ_jdwhRo)
Expand All @@ -204,15 +218,15 @@ Players who also answered correctly but slower will earn a decreasing number of
Shortly before running the official game, make sure to access the player app a first time to load it.<br/>
The default Heroku setup uses a free Heroku dyno. This implies that apps that are inactive for more than 30 minutes are put to sleep. Any connection to the app will wake it up but it takes a bit less than a minute. You may experience some "Request time out" errors during that wake-up time.
If you are running the game with 40+ players, consider upgrading to a [Hobby dyno](https://www.heroku.com/dynos).
If you are running the game with 50+ players, consider upgrading to a [Hobby dyno](https://www.heroku.com/dynos).
**Resetting the game**
You can reset the game at any time by clicking on the Reset button on top right of the Quiz app. This resets the quiz session to the registration phase, clears players and previous answers.
## Troubleshooting
Review these common problems. If you can't find a solution to your problem, [open a new issue](https://github.com/pozil/quiz-host-app/issues).
Review these common problems. If you can't find a solution to your problem, [open a new issue](https://github.com/fostive/quiz-host-app/issues).
**Player app is not starting (Heroku error page is displayed)**
Expand All @@ -226,7 +240,7 @@ Review these common problems. If you can't find a solution to your problem, [ope
**Player app is slow/lags, questions do not show up on time**
The default player app installation uses Heroku. Heroku datacenters are only available in North America and Europe. If you are running the quiz from another region (i.e.: India, Australia...), there's a good chance that your player will experience some lag. Consider switching to another cloud provider that lets you run a Node.js environment.
See the [Performance and Scalability](#performance-and-scalability) section.
**Something is wrong with the quiz data or you'd like to reset it**
Expand All @@ -244,4 +258,4 @@ Refresh the page to fix the problem. Refer to the **Player app wake-up** section
If you want to build the project from sources and contribute, run `npm install` to install the project build tools.
Here is the [Quiz Player App repository](https://github.com/pozil/quiz-player-app).
Here is the [Quiz Player App repository](https://github.com/fostive/quiz-player-app).
2 changes: 1 addition & 1 deletion config/project-scratch-def.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"orgName": "pozil",
"orgName": "Quiz",
"edition": "Developer",
"language": "en_US",
"settings": {
Expand Down
10 changes: 5 additions & 5 deletions data/developer/Quiz_Question__cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@
"type": "Quiz_Question__c",
"referenceId": "Quiz_Question__cRef9"
},
"Label__c": "What is the Spring '20 API version number?",
"Answer_A__c": "45.0",
"Answer_B__c": "46.0",
"Answer_C__c": "47.0",
"Answer_D__c": "48.0",
"Label__c": "What is the Summer '20 API version number?",
"Answer_A__c": "46.0",
"Answer_B__c": "47.0",
"Answer_C__c": "48.0",
"Answer_D__c": "49.0",
"Correct_Answer__c": "D"
},
{
Expand Down
Loading

0 comments on commit 3d91e64

Please sign in to comment.