Table tennis tracking application using React and Firebase.
Hosted at: https://jamesgiu.github.io/quick-hit/
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Will deploy the application to github-pages
to be hosted.
Runs eslint
over the project.
Runs stylelint
over the project.
Runs prettier
over the project.
Feel free to contribute to any Issues or make your own!
The guidelines are as follows:
- There are no guidelines in the wild west.
The .env file(s) should contain details for the application to reach your Firebase DB.
.env.development
will be used for npm start
.
.env.production
will be used for npm build
.
The following is an example file:
REACT_APP_FB_URL=https://<YOUR-DB>.<YOUR-REGION>.firebasedatabase.app/
REACT_APP_FB_ANALYTICS_UA="UA-123"
The catalogue will store references to all instances of QuickHit available.
- Visit https://console.firebase.google.com/u/1/ and select "Add Project"
- Then select 'Realtime Database'
- Create your new database, keep all settings default
- Once complete, the URL provided here will be the value to use as the
REACT_APP_FB_URL
in.env
- Import some dummy data to get the schema going, use the menu and select "Import JSON"
- Upload the committed file
db-example-catalogue.json
to get the schema initialised
The below is an example of a catalogue entry for a QuickHit instance.
{
"instances" : {
"dbb0a47d-9a2a-40ef-900f-4e11b8dc5fd3 " : {
"fb_api_key" : "AIzaSyC-lBTbcM2aYfD5p7AgAoXJA30UwvpLnL4",
"fb_srv_acc_name" : "[email protected]",
"fb_url" : "https://table-tennis-testing-default-rtdb.asia-southeast1.firebasedatabase.app/",
"name" : "Demo Instance",
"restricted_happy_hour" : true,
"tournaments" : true,
"google_auth": true
}
}
}
Retrieved via Firebase using the following steps:
- On the console view (https://console.firebase.google.com/u/1/), click on the Settings cog next to "Project Overview"
- Click on "general"
- Take note of the "Web API Key", this will be used for
fb_api_key
in the catalogue database.
Retrieved via Firebase using the following steps:
- On the console view (https://console.firebase.google.com/u/1/), select "Authentication" and then "Get started"
- Enable the Email/Password Sign-in method
- Go to "Users" then click "Add user"
- Add a service account and a password for it, this password will be prompted for when a user first uses the application.
- The service account user name will be used for
fb_srv_acc_name
in the catalogue database.
Retrieved via Firebase using the following steps:
- On the console view (https://console.firebase.google.com/u/1/), select "Realtime Database"
- The URL will be displayed on the page (under "Data")
If true, Happy Hour can only occur at 12:00PM or 4:00PM (better for a workplace!)
If true, tournaments will be enabled.
If true, Authentication via a Google Account provider will be enabled. Expects the Instance on Firebase to have Google as a Sign-In provider.
An instance database will store all the matches, players, and other data relevant to a particular instance of QuickHit.
- Visit https://console.firebase.google.com/u/1/ and select "Add Project"
- Then select 'Realtime Database'
- Create your new database, keep all settings default
- Once complete, the URL provided here will be the value to use as the
fb_url
in the catalogue database. - Import some dummy data to get the schema going, use the menu and select "Import JSON"
- Upload the committed file
db-example.json
to get the schema initialised
- On the console view (https://console.firebase.google.com/u/1/), select "Authentication" and then "Users"
- Copy the UUID of your newly added firebase service account (e.g. gSid15y7XJMC8E273OIjLjgaYig2)
- Go to "Realtime Database"
- Select "Rules"
- Change the Rules to only allow reads and writes from the authenticated service account user's UID:
{ "rules": { ".read": "auth.uid == 'gSid15y7XJMC8E273OIjLjgaYig2'", ".write": "auth.uid == 'gSid15y7XJMC8E273OIjLjgaYig2'" } }