Skip to content

In this project, i have to create the backend for a football leaderboard. The front end has already been completed, and i had to develop the API according to its requirements and business rules.

Notifications You must be signed in to change notification settings

caiobacode/footbal-leaderboard

Repository files navigation

🏟️ Football Leaderboard 🏟️

tfc-img

Description

In this project, i have to create the backend for a football leaderboard. The front end has already been completed, and i had to develop the API according to its requirements and business rules.

💻 Tecnologies used

Typescript Node.js EXPRESS DOCKER MYSQL Mocha Chai OOP

🛠️ Instructions

Notes

I just do the backend of the aplication.
The frontend run in port 3000.
The backend run in port 3001.

📚 Requirements to run this project:

  • Git.
  • NPM - v >= 7.0
  • Docker

🐳 Run with Docker 🐳

# Clone the repo
git clone https://github.com/caiobacode/footbal-leaderboard.git

# Enter in repo
cd footbal-leaderboard

#install dependencies
npm run install:apps

# Run DockerCompose
npm run compose:up

# Go to the backend folder and populate the database.
cd app/backend
npm run db:reset

🧪 Test the Back End

# enter in backend folder
cd app/backend

# run tests
npm run test

🔎 Additional details

🌐 API routes

Leaderboard Route

  • GET "/leaderboard/home" - Return the leaderboard of the teams that played at home.
  • GET "/leaderboard/away" - Return the leaderboard of the teams that not played at home.
  • GET "/leaderboard" - Returns the both leaderboard.

Login Route

  • POST "/login" - Login the user if the fields are correct.
  • GET "/login/role" - Return the user role(admin or user).

Matches Route

  • GET "/matches" - Returns all motorcycles
  • PATCH "/matches/:id/finish" - Finish the match.
  • PATCH "/matches/:id" - Update the match score.
  • POST "/matches" - Start a match with the teams passed by request.

Teams Route

  • GET "/teams" - Returns all teams.
  • GET "/teams/:id" - Returns the team that has the id passed by the request.
✏️ What i learned
  • OOP (Object-Oriented-Programing) in typescript.

  • How to develop backend for a finished front end.

  • How to run a full stack aplication with docker.

About

In this project, i have to create the backend for a football leaderboard. The front end has already been completed, and i had to develop the API according to its requirements and business rules.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published