Leaguey allows you to do the following
- Fetch Historical Match Results.
- Granulated Fetch based on Season and Division.
- Generation of PDF of Results using query parameter
format=pdf. - Store PDF for up to two days in the cloud.
- Documentation with OpenAPI (https://leaguey.herokuapp.com/swagger-html).
Note: I have a deployed version of the aplication found here on Heroku
This application can be deployed locally by the following ways.
- Using
docker-compose - Using
Docker - Using the local environment.
If you are considering the first two options of deployment, you would need to have a local installation of mySQL. docker-compose automates the setting up of these prerequisites and is the prefered form of deployment.
You need to run the project by running.
npm run make:upor
docker-compose -f "docker-compose.yml" up -d --build
To run the application with docker, you need a local istallation of MySQL and the MYSQL_DATABASE already created. After satisfying the reuirement, run the following to build the image. Note: MYSQL_DATABASE will not be created automatically and would need to be manually created.
docker build --pull --rm -f "Dockerfile" -t leaguey:latest "."and this to run the image.
docker run --rm -it \
--network="host" \
-e MYSQL_ROOT_PASSWORD='passworD' \
-e MYSQL_USERNAME='root' \
-e MYSQL_DATABASE='leaguey' \
-e MYSQL_HOST='localhost' \
-p 3000:3000/tcp \
leaguey:latest
You can also pull the image from DockerHub with:
docker run --rm -it \
--network="host" \
-e MYSQL_ROOT_PASSWORD='passworD' \
-e MYSQL_USERNAME='root' \
-e MYSQL_DATABASE='leaguey' \
-e MYSQL_HOST='localhost' \
-p 3000:3000/tcp \
teezzan/leaguey:latestForemost, you have to clone this repository and install all the dependencies with the following commands.
git clone https://github.com/teezzan/Leaguey.git
cd Leaguey
npm install
Rename the .env.example to .env and customize it to your local machines specifications.
Note: MYSQL_DATABASE will not be created automatically and would need to ba manually created.
Run npm run make:serve to start the local server.
npm run make:up: Uses Docker-compose to spring up servernpm run make:test: Run testsnpm run make:build: Builds the Typescript code and deploy locallynpm run make:serve: Run tests
A swagger documentation can be found at http://localhost:3000/swagger-html


