Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

BettorLeague/bettor-league-deprecated

Repository files navigation

npm Build Status GitHub issues Codacy Badge License Apache-2.0

https://bettorleague.github.io/bettor-league/

Bettor-league

Comment enrichir la communauté du football au travers d’une application divertissante autour des pronostics ?

BettorLeague / Ligue des parieurs

Principales fonctionnalités

  • Suivre les résultats des matchs
  • Pronostics sur les futurs matchs de la ligue 1
  • Création de groupe de pronostic & discussion

Les résultats rapportent plus ou moins de points / trophés pour monter en rang .

Prerequisites

Ensure you have this installed before proceeding further

  • Java 8
  • Maven 3.3.9+
  • Node 6.0 or above,
  • npm 5 or above,
  • Angular-cli 1.6.3

Technology Stack

Component Technology
Frontend Angular 5 (JavaScript)
Backend (REST) SpringBoot (Java)
REST Documentation Swagger UI / Springfox
In Memory DB H2 / MySQL
Persistence JPA (Using Spring Data)
Client Build Tools angular-cli , npm
Server Build Tools Maven (Java)
Continuous integration Jenkins
API Restfull de Resultat Sportif FootballData

How do JSON Web Tokens work?

In authentication, when the user successfully logs in using their credentials, a JSON Web Token will be returned and must be saved locally (typically in local storage, but cookies can be also used), instead of the traditional approach of creating a session in the server and returning a cookie.

Whenever the user wants to access a protected route or resource, the user agent should send the JWT, typically in the Authorization header using the Bearer schema. The content of the header should look like the following:

Authorization:

This is a stateless authentication mechanism as the user state is never saved in server memory. The server's protected routes will check for a valid JWT in the Authorization header, and if it's present, the user will be allowed to access protected resources. As JWTs are self-contained, all the necessary information is there, reducing the need to query the database multiple times.

This allows you to fully rely on data APIs that are stateless and even make requests to downstream services. It doesn't matter which domains are serving your APIs, so Cross-Origin Resource Sharing (CORS) won't be an issue as it doesn't use cookies.

The following diagram shows this process:

Football Match Modeling

Local Environment

Build Only Frontend (Angular 5)

http:https://localhost:4200

cd  client/src/
npm install
npm start

Build Front & Backend (SpringBoot Java)

http:https://localhost:8080

mvn clean install
cd  server
mvn spring-boot:run

Database (H2 in memory)

http:https://localhost:8080/database

UserName: root
Password: root

Useful Links

Verifier l'espace disque d'un dossier :

du -h --max-depth=1

Jenkins script :

#!/bin/bash
JENKINS_NODE_COOKIE=dontKillMe
ps aux | grep server | awk '{print $2}' | xargs kill -9 || true
java -jar server/target/server-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod --server.port=8081 &