Skip to content

Mickeyo0o/TournamentsWebsite

Repository files navigation

Tournaments Website

This project aims to create an online tournament system where users can register, log in, and conduct tournaments. Organizers can set the time and place of the tournament, limits on the number of participants, sponsor logos, and edit tournament information. Competitors can apply to participate and enter the results of their encounters.

Files

  • public: Contains stylesheets for each sub-site.
  • views: Contains HTML code for each sub-site.
  • app.js: Main website behavior code.
  • datasetCreator.js: A program to create an initial database containing some entries.
  • adidas.jpg, coca-cola.jpg, nike.jpg, nvidia.jpg, pepsi.jpg: Image files to be presented as exemplary sponsors.

Features

  • User Registration and Login: Allows user registration and login.
  • Account Confirmation via Email: Performs account confirmation via email.
  • Secure Password Storage: Stores securely hashed user passwords.
  • Main Page Display: Displays a list of tournaments (up to 10 per page).
  • User Dashboard: After login, users can check their upcoming tournaments, participate in available tournaments, and create their own tournaments.
  • Tournament Details: Allows users to view details of each tournament after clicking on a button.
  • Create Tournaments: Users can create new tournaments after inserting all the required information.
  • Tournament Sign Up: Users can sign up for a tournament by providing ranking and license number, which cannot be repeated among other participants.
  • Tournament Ladder Generation: Generates a tournament ladder after the deadline of the start of the tournament, viewable on the detailed tournament page by anyone.
  • Result Submission: Allows participants to insert their results and checks if they match the opponents' input. If they match, the system updates the tournament ladder.
  • Concurrency Handling: Ensures that concurrency will not result in errors.

Usage

To run this project, ensure you have Node.js installed along with all the libraries mentioned at the beginning of the app.js file, with an addition of the EJS module. Additionally, use the datasetCreator.js prior to running app.js as the application needs access to a database. DatasetCreator creates a local database using PostgreSQL, thus requiring an installation of PostgreSQL on the machine. The database in the code uses 'postgres' user with 'admin' password and localhost port = 5432, and database name = 'postgres'.

To run app.js, use the command:

    node app.js

To run datasetCreator.js, use the command:

    node datasetCreator.js

Note that the entire website operates solely on your local machine, so any emails sent by the system (e.g., for account confirmation) will be available in the terminal as a link to the local email website.

If you do not wish to install all these requirements, you can watch a demo presented below:

demovideo.1.mp4

Note

This project was completed as part of the Internet Application course.

Creator

Mikołaj Marmurowicz (Mickeyo0o)