Skip to content

tmjoris/JudgingApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JudgingApp

The platform is meant to simulate a Leaderboard.

Navigating the Application

The application has a main page
But only judges can assign points to Particpants. The judge has a login page
Still only the admin can create judges on the admin page
The admin username is:

 adminOne

and password is:

 for-the-first-admin

Set up and Run the application

First clone the application to your local machine.

git clone https://github.com/tmjoris/JudgingApp

Change your current directory to that of the application

cd JudgingApp

Make sure you have docker and docker compose installed, before running

docker compose up

This is will launch the application by first installing all the LAMP dependecies before starting the Apache server.
The compose command would end up creating 2 containers:

judgingapp-web-1
judgingapp-db-1

To make changes to the database once the app is running, you'd ssh into the judgingapp-db-1 container and run any relevant mysql commands

docker exec -it judgingapp-db-1 mysql -u "root" -p

When asked for the password type

Enter Password:hard-to-crack

Database Schema

image 1. Admin Table Stores admin login credentials.

CREATE TABLE admin(
    username VARCHAR(50) PRIMARY KEY,
    hashedPassword VARCHAR(255) NOT NULL
);

2. Judges Table
Holds judge login credentials and display names.

  CREATE TABLE judges (
    username VARCHAR(50) PRIMARY KEY,
    display_name VARCHAR(100) NOT NULL,
    hashedPassword VARCHAR(255) NOT NULL
);

3. Users Table
Contains all participants being scored.

  CREATE TABLE users (
    username VARCHAR(100) PRIMARY KEY
);

3. Scores Table
Stores individual judge scores of each user.

  CREATE TABLE scores (
    id INT AUTO_INCREMENT PRIMARY KEY,
    user_name VARCHAR(100) NOT NULL,
    judge_name VARCHAR(100) NOT NULL,
    points INT NOT NULL,
    FOREIGN KEY (user_name) REFERENCES users(username) ON DELETE CASCADE,
    FOREIGN KEY (judge_name) REFERENCES judges(username) ON DELETE CASCADE
);

Assumptions made

  1. The platform scale and needs can be satisfied by one admin.
  2. The users are pre-registered.
  3. The judges are fine having the admin set their username and password
  4. The participants are only using the platform to view their points.
  5. The expected number of users is miniscule.

Design Choices

Database Structure:

  • The platform uses a relational database with four main tables (admin, judges, users, and scores)

    • admin and judges tables store user credentials separately to manage different roles and permissions.
    • users table lists all participants being scored.
    • scores table connects judges to users with the points they assign.
  • Used a foreign key constraints with ON DELETE CASCADE to keep data consistent by automatically removing dependent scores when a user or judge is deleted.

PHP Constructs:

  • By using Server-Sent Events (SSE) in the scoreboard, the server could send real-time score updates without needing page refreshes.
  • The system uses JSON encoding to structure data exchanged between server and client, making it easy for me to integrate with JavaScript.
  • I implemented the use of prepared statements to prevent SQL injection and increase security.

Platform Architecture:

  • The platform is designed as a monolithic application. This approach made it simple and faster to develop.

  • The system clearly separates concerns via modular PHP files (e.g., db.php for database connection, distinct pages for judge and admin login).

Authentication:

  • Separate login pages for admins and judges were added to:

    • To allow the enforcement of role-based access control, ensuring only authorized judges can submit scores and only admins can manage the system.
    • Secure sensitive actions behind authentication, protects the integrity of scoring and user data.

Features I would have added if I had more time.

  1. User Self Registration and Profile Management to allow users to register themselves, update profiles, and view their scoring history.

  2. Advanced Analytics and Reports to provide detailed analytics dashboards for admins and judges, including scoring trends, user performance over time, and judge activity.

  3. Multi-factor authentication (MFA), password reset, and account lockout after multiple failed login attempts.

  4. Mobile-Friendly UI and Responsive Design to optimize the interface for mobile and tablet users.

  5. Comments and Feedback System to allow judges to leave feedback along with scores.

  6. Bulk Upload and Import Features to support bulk uploading of users and judges via CSV or Excel.

  7. Email Notifications and Reminders to notify judges of pending scoring tasks and users of results via automated emails.

About

a leaderboard platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published