{"id":18524241,"url":"https://github.com/drblink7/table-football","last_synced_at":"2026-05-03T17:34:09.982Z","repository":{"id":230036627,"uuid":"759852399","full_name":"DrBlink7/table-football","owner":"DrBlink7","description":"Table football application for a code challenge","archived":false,"fork":false,"pushed_at":"2024-04-08T07:12:51.000Z","size":1890,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-14T19:15:18.618Z","etag":null,"topics":["cypress","node","node-pg-migrate","react","redux","redux-toolkit","sse","typescript"],"latest_commit_sha":null,"homepage":"https://it.linkedin.com/in/andrea-manna-67953517b","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DrBlink7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-19T13:11:17.000Z","updated_at":"2024-04-16T09:31:18.000Z","dependencies_parsed_at":"2024-04-08T08:39:46.559Z","dependency_job_id":null,"html_url":"https://github.com/DrBlink7/table-football","commit_stats":null,"previous_names":["drblink7/table-football"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DrBlink7/table-football","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrBlink7%2Ftable-football","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrBlink7%2Ftable-football/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrBlink7%2Ftable-football/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrBlink7%2Ftable-football/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DrBlink7","download_url":"https://codeload.github.com/DrBlink7/table-football/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrBlink7%2Ftable-football/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32578757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cypress","node","node-pg-migrate","react","redux","redux-toolkit","sse","typescript"],"created_at":"2024-11-06T17:40:09.721Z","updated_at":"2026-05-03T17:34:09.965Z","avatar_url":"https://github.com/DrBlink7.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Table-Football Code Challenge\nHello table football players, with this web-app you can now create, delete, edit and browse the list of every player, you can even check their player page and analyze their personal stats.\nYou can create teams, but don't be a solo player! Choose a team name and a colleague to create your own team, you can even edit or delete it later, but what about browsing team stats? You can do that too!\nNow the fun part, you can create a match and wait for the table to be free to start the match!  \n\n## Introduction\nThe web-app has the required functionalities:\n  - CRUD operations on players\n  - CRUD operations on teams\n  - CRUD operations on matches\n  - Real-time matches (with SSE notifications)\n  - Stats\n    - Teams leaderboards (Rankings of ended matches)\n    - Strikers Leaderboards (Rankings of ended matches)\n    - Defenders Leaderboards (Rankings of ended matches)\n\nThe application also provides:\n  - Players Stats Page (Rankings of ended matches)\n  - Teams Stats Page (Rankings of ended matches)\n  - i18-zation\n  - User page (*Enhanced in future releases*)\n\nApplication rules:\n  - A player cannot be deleted if he/she is in a team\n  - A team (its players) cannot be edited if it is in a match\n  - A team (its name) can be always edited\n  - A team cannot be deleted if it is in a match\n  - A team cannot be formed if striker/defender have the same player\n  - A match can be created only if blue/red have 4 different players (4 different players id)\n  - A match (its teams) can be edited only if its status is preparing\n  - A match cannot be deleted if its status is ongoing\n  - Only 1 Match can be ongoing (there is no real limitation on FE nor on BE nor on the technology choosed, i just added a fake rule on BE to fit the imaginary scenario where Molo has 1 table football available)\n  - Teams leaderboards\n    - points DESC\n    - goal difference DESC\n    - goals scored per match DESC\n    - goals conceded ASC\n  - Defender leaderboards\n    - goals conceded per match ASC\n    - goals conceded ASC\n    - games played ASC\n  - Striker leaderboards\n    - goals scored per match DESC\n    - goals scored DESC\n    - games played ASC\n\n## Structure\nTo develop this application created via [craco](https://craco.js.org/docs/) i used react typescript, react-router-dom and react-dom for navigation of the Single Page Application, react-hook-form as form handler used with the yup for its validation, axios to handle API calls, react-redux and @reduxjs/toolkit to handle the global state, crypto-js to handle crypting/decrypting of the redux state stored in the browser local storage, material-ui for the components styling with react-perfect-scrollbar. BE is a node App, db choosed is PostgreSQL.\n\nBefore launching the application, you need to create an .env file by copying the [env example](/backend/.env.example) file into a .env file for BE and [env example](/frontend/.env.example) file into a .env file for FE.\n\nThese files (and a tl;dr version of the documentation/how to) will be provided in a .zip via mail.\n\nTable-football can be launched by using Docker Compose (or with yarn if you're not into docker.)\n\nMore about [FE Structure](/frontend/README.md#structure), more about [BE Structure](/backend/README.md#structure)\n\n# Docker run Prerequisite\n\n- Docker desktop (for Windows/Mac users)\n- Docker (for Linux users)\n\n# Running the Application\n\nIf you don't want unnecessary node modules, installing the required Node version / NVM, yarn/npm and every other dependencies, you can just open a terminal in the repo root and run the command:\n```bash\ndocker compose up --build\n```\nThe `node:lts-alpine` container image will be downloaded, and the commands in the Frontend [Dockerfile](/frontend/Dockerfile) and Backend [Dockerfile](/backend/Dockerfile) will be executed.\n\nOnce the backend is up and running, you will see these messages into the terminal log (the terminal where you ran the docker compose command)\n```bash\nbackend-molo   | { event: 'Logger initialized' }\nbackend-molo   | {\nbackend-molo   |   client: {\nbackend-molo   |     cloudRole: 'backend',\nbackend-molo   |     applicationVersion: '0.0.1',\nbackend-molo   |     cloudRoleInstance: 'dev'\nbackend-molo   |   }\nbackend-molo   | }\nbackend-molo   | { event: 'Backend is listening on port 3001' }\n```\nNow that backend is ready (and this is the first launch of the app on your environment) you need to run the migrations against the db.\n\nTo do that you just need to run, from a shell running from backend folder, this command\n```bash\nDATABASE_URL=postgres://DB_USER:DB_PASS@DB_HOST:DB_PORT/DB_NAME yarn run migrate up\n```\n(N.B. you can launch it on every docker-run anyway, if no db update needed no migration will run)\n\nOnce the migrations are executed and the whole environment is up\u0026running, you just need to open a [browser](http://localhost:3000) to navigate into the app.\nYou can find more info on migrations on BE [README](/backend/README.md#db-migration).\n\nYou can browse the API documentation with the [Swagger UI](http://localhost:3001/swagger/) where you can test all the APIs directly from the BE without the need of the FE application. You can find more info on swagger on BE [README](/backend/README.md#swagger-ui).\n\n## Close application\nTo stop the container execution, you just need to click Ctrl+C (or Command+C on Mac) and then the write command:\n```bash\ndocker compose down\n```\n\n## Changing env / deploying the app\ndocker-compose.yml is targeting both FE and BE images to **development** to run a production build you will need to change it with a docker-compose override (or simply change it manually).\n\n*Deployment procedure is still in progress*\n\n## Tests\n\nThere are 3 different tests modules, 2 on frontend and 1 on backend application\n\n### Frontend test\nI added 2 different type of tests suite\n- data manipulation with Jest \n-  end-to-end test cases and automated Component testing wit Cypress\n\nTo run the jest tests suite you just need to open a terminal in the frontend folder and run the command:\n```bash\nyarn run test\n```\nTo run the cypress automated tests you need to open a terminal in the frontend folder and run the command:\n```bash\nyarn run cypress run\n```\nthis will run all E2E tests i added, but not the Component Test, so if you're interested into Cypress Tests you can find more information about Cypress tests and how to run it on FE [README](/frontend/README.md#tests).\n\n### Backend test\nTo run the test, open a terminal in the backend folder and run the command:\n```bash\nyarn run test\n```\nyou can find more info on BE tests in [README](/backend/README.md#tests).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrblink7%2Ftable-football","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrblink7%2Ftable-football","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrblink7%2Ftable-football/lists"}