Skip to content

Betting game with Angular 2, Laravel and Material Design Lite that I originally wrote for Euro 2016 in France.

License

Notifications You must be signed in to change notification settings

Zemke/tippspiel

Repository files navigation

Tippspiel

This project is basing on two projects: Zemke/starter-laravel-angular and angular/quickstart. So you might want to read those two first to know how to set these apps up individually. The PHP part is everything, but the Angular part is in _angular.

dist.sh

This copies the Angular parts in _angular into the PHP structure, so that you can use both worlds in one context. This could then be deployed.

API Endpoint

cp _angular/app/api-endpoint.ts.default _angular/app/api-endpoint.ts

Adjust the variable in _angular/app/api-endpoint.ts as you need. Like when you host your backend somewhere else, you would change / to http://localhost:8080/ so Angular knows where to point the REST calls at.

Environment conf

There are two additional environment variables that you probably don’t know from the default .env file.

FINAL_ROUND_START: An ISO date string. This is basically the deadline for bets of the tournament champion. When this date is past, users won’t be able to submit bets for the champions of the tournament anymore. Most of the times you’d want that to be the start of the final round of the tournament or even the first game.

FINALE_MATCHDAY: The matchday number of the finale of the tournament as seen on football-data.org. You know the final matchday by going to http://api.football-data.org/v1/soccerseasons/{seasonId} and then there’s the attribute numberOfMatchdays which is probably the finale. The information is important to know when the points for the bet of the champion on of the tournament should be added.