Skip to content

πŸš€ Backend Task: β™ŸοΈ Chess Tournament Management System

Notifications You must be signed in to change notification settings

mensenvau/internship_global_move

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Backend Task: β™ŸοΈ Chess Tournament Management System

Welcome to β™ŸοΈ Chess Tournament Management system! This guide will help you set up, run, and test the application. This is a task made for the assessments: More about the task here.

I use my own uzdev npm library to build the API. You can learn more about it here: uzdev on npm.


🌐 API URL

Credential for admin:

  • username: admin
  • password: hi!12345

🌍 Global URL for Testing

Test the application globally at: https://api.menda.page

πŸ› οΈ Installation Guide

1. Clone Repository

Clone the repository to your local machine:

git clone https://github.com/mensenvau/assignment_global_move
cd assignment_global_move

You need to update the .env file. You can use the .env.example template as a reference.

2. Run MySQL DB Script

Run the following script to set up your MySQL database (scripts/db-init.sql):

mysql -u root -p < scripts/db-init.sql

3. Start Server

Navigate to the server directory and start it:

cd server
npm install
npm run start

npm test # for unit tests.

πŸ“ Function Path for Basic Logic

Find the function to test the basic logic at:

cd server # on server path
node function/test.system-swiss-tournament.js

Build match:

To start the next match, the system automatically creates pairings based on the following logic:

Players are initially sorted by rating. In subsequent rounds, they are sorted by their current score. Players who have not yet played against each other and have similar scores are paired together. The remaining players are paired in a similar manner. If there is an odd number of players, the lowest-ranked player who has not yet received a bye will get one, earning 1 point to advance to the next stage.

The next round cannot be generated until the results of the previous round are finalized. Additionally, a round number cannot be generated if Log2(Player Count) exceeds a manageable size.

The process is recursive to ensure proper sorting and pairing, though this approach may become inefficient if the number of players is very large.

⚠️ Shortcomings

  • I didn't have time to write the front-end.
  • Since the Swiss function is recursive, it needs to be optimized for multi-player rounds.
  • Registration and login was not protected by captcha or email/phone message was not sent.
  • Not optimized for caching.

❓ Questions

For any questions, feel free to reach out: balkibumen@gmail.com


πŸŽ₯ Installation Video

Watch the detailed installation guide: Installation Video


πŸ“’ Join My Telegram Channel

Stay updated and join the conversation: Telegram Channel


About

πŸš€ Backend Task: β™ŸοΈ Chess Tournament Management System

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published