Host Online Quizzes and Similar. This is not an open source clone of Kahoot.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Nils 046427a45a rename 'website' to 'client' 3 hours ago
client rename 'website' to 'client' 3 hours ago
python_avatars Initial code prototype 2 weeks ago
.gitignore rename 'website' to 'client' 3 hours ago
LICENSE Initial commit 2 weeks ago
README.md rename 'website' to 'client' 3 hours ago
avatars.py cleaner logging. More command line arguments 15 hours ago
config.example.json neutral example configs 16 hours ago
game.py Better displays and status 19 hours ago
lobby.py better status bar 14 hours ago
names.py cleaner logging. More command line arguments 15 hours ago
ratelimiter.py better rate limits 14 hours ago
server.py implement rate limiter 14 hours ago
test-ratelimiter.py implement rate limiter 14 hours ago
user.py support disconnect and reconnect 2 days ago
welcome.py better status bar 14 hours ago

README.md

Quizeto

Quizeto is a WebSocket-based quiz hosting server and website client that allows users to create, host, and participate in quiz games. The server is built in Python and uses WebSockets to facilitate real-time interaction between the host and participants. The website uses standard HTML5, CSS and JavaScript without frameworks.

This is not an open source clone of Kahoot.

Version

1.0.0

Setup and Running the Server

Requirements

  • Python 3.7 or higher
  • WebSockets library

Installation

  1. Clone the repository or download the source code.
  2. Install required Python libraries through your distribution, e.g. sudo pacman -Sy python-websockets or locally if you must: pip install --user websockets.

Configuration

config.json (Server)

Create the config.json(or copy the example file config.example.json) file with SSL certificate paths if using SSL. In the access_tokens section, specify each token and its expiry date (use null for permanent tokens).

{
    "ssl_certificate": "/path/to/ssl_certificate.crt",
    "ssl_key": "/path/to/ssl_key.key",
    "access_tokens": {
        "secretPermanentToken1": null,
        "secretPermanentToken2": null,
        "secretTemporaryExpiringToken1": "2156-12-31",
        "secretTemporaryExpiringToken2": "2023-06-30"
    }
}

When hosting a quiz in production, the host will be prompted to enter an access token. This token is validated against the entries in config.json. If valid (and not expired for temporary tokens), the host can create and manage the quiz session.

In local development mode, running without SSL, the access token requirement is bypassed. You can always force it through server.py --access.

Security Note

Ensure the config.json file's location and permissions are secure on the server, as it contains sensitive data like SSL paths and access tokens. The file is added to .gitignore to prevent accidental version control commits.

config.js (Client)

Create the file client/config.js (or copy the example file client/config.example.js) with your domain and port. You can change the port by using a commandline argument for python server.py (see below)

    const socketDomain = "yourdomain.com";  // Replace with your server's domain
    const socketPort = "49005";             // Replace with your desired port, same as server.py --port 49005

Running the Server

  • To start the server with SSL (default): python server.py
  • To run the server without SSL (useful for development): python server.py --no-ssl
  • To start the server with a custom configuration file: python server.py --config-file /path/to/custom_config.json
  • To use a custom socket port: python server.py --port 49005

Deployment of the Website Client

To deploy Quizeto on a web server:

  1. Copy Web Files: Copy the client-side files, everything in the clientdirectory, to your web server's hosting directory. This includes the file config.js, that you created yourself (see above) but and NOT config.json.
  2. Configure Your Web Server: Set up a web server like Apache or Nginx to serve these files. Ensure the server is configured to serve over HTTPS if you're using WebSockets over SSL (WSS).
  3. WebSocket Server: Run the Quizeto WebSocket server (server.py) on the same server or a different server. Ensure that the WebSocket server is accessible to the clients.

Additional Information

For detailed information on commands and configuration, run python server.py --help.

Local Usage for development

When running locally and without SSL the token file will not be used and you can just click the host button.

Internal Notes to host on Uberspace

uberspace port add Port 49005 will be open for TCP and UDP traffic in a few minutes. Your application needs to listen on interface :: or 0.0.0.0 (using 127.0.0.1, localhost, ::1, the external IP, or the hostname will not work).

Other Code