Euro 2016 WorldCup 2018 Euro 2020 WorldCup 2022 is a web service written in Node.js,
giving you and your friends π¦ π§ a platform of competition: Who is the
better forecaster of football β½ matches? Make bets for football matches,
collect scores and win the crown π.
Scoring
- β β β β (4 points) correct bet
- β β β β (3 points) correct goal difference
- β β ββ (2 points) correct winner
- ββββ (0 points) in any other case or if the user did not place a bet
Additionally, there's a match score factor that is multiplied with the points.
The FIFA WorldCup 2022 is taking place in Qatar from November 20 to December 18. Happy betting!
You need to have PostgreSQL π >= 9.6 installed and configured with a new database. Node.js is required of course, recommended versions are >=8.
git clone https://github.com/syxolk/euro2016.git
cd euro2016
npm install
Now create a shell script (e.g. run.sh
):
#!/usr/bin/env bash
# Set publicly available domain name (without trailing slash)
export ORIGIN=http://localhost:8080
# PostgreSQL connection
export DB_HOST=localhost
export DB_USER=my_postgres_user
export DB_PASSWORD=my_postgres_password
export DB_NAME=my_postgres_database_name
# Used by express-session to secure the session cookies
export SESSION_SECRET=s0me_r4ndom_str1ng
npm start
You should make your run script executable:
chmod +x run.sh
The database structure will be created and migrated automatically.
Use your own run script:
./run.sh
or just use npm start
if you set the environment variables with another method.
You can add additional environment variables for additional functionality.
All match dates and other time related stuff is saved in UTC in the database. If you want to show all dates in another timezone than the default one (Central European Summer Time) you can add this in your run script:
export UTC_OFFSET="+0200"
Related docs: https://momentjs.com/docs/#/manipulating/utc-offset/
If your server runs behind a proxy that sets X-Forwarded-*
headers, you should
set this:
export TRUST_PROXY=1
related docs: https://expressjs.com/de/guide/behind-proxies.html
If your server is available over HTTPS and you always want to redirect your users to be redirected to the HTTPS-version you can set this:
export REDIRECT_HTTPS=1
If you want to enable Facebook login you need to create a Facebook App, enable 'Facebook Login' for it and add valid OAuth Redirect URIs (use your own domain of course):
https://www.wetten2022.de/auth/facebook/callback
https://www.wetten2022.de/connect/facebook/callback
Then add this in your run script (with your own app id and secret):
export FACEBOOK_APP_ID=987654321
export FACEBOOK_APP_SECRET=1234567890
You have to set the app's status to 'Live' so that other people can use it.
If you want to enable Google login you need to create a Google Cloud Platform Project, create an OAuth-Client-ID and set the Redirection-URIs to (using your own domain):
https://www.wetten2022.de/auth/google/callback
https://www.wetten2022.de/connect/google/callback
Then add this in your run script:
export GOOGLE_APP_ID=987654321.apps.googleusercontent.com
export GOOGLE_APP_SECRET=abcdefgh
To send transactional emails (e.g. email confirmation), you need to configure either an SMTP connection or a Mailgun account.
export MAIL_SOLUTION=smtp
export MAIL_FROM=no-reply@wetten2022.de
export SMTP_HOST=localhost
export SMTP_PORT=465
export SMTP_USER=smtp_user
export SMTP_PASSWORD=smtp_password
Register an account on Mailgun, configure a new domain and set this in your run script:
export MAIL_SOLUTION=mailgun
export MAIL_FROM=no-reply@wetten2022.de
export MAILGUN_DOMAIN=wetten2022.de
export MAILGUN_API_KEY=your-mailgun-api-key
How to update euro2016 to the newest version:
git pull
npm install
Icons made by Papedesign from www.flaticon.com is licensed by CC 3.0 BY