gahoot

command module
v0.0.0-...-223d396 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

README

# Gahoot! - A Distributed Version of Kahoot!

Gahoot! is a distributed and self-hostable rewrite of [Kahoot!](https://kahoot.com/) in Go. It is designed to be slightly more minimal and to implement the core features that everybody loves without the fluff and bloat. It is also designed to be easy to self-host on your machine, meaning that anybody can set up an instance for their school or class or just friends to play on. Instances are also designed to be very configurable for the host, so that features can be toggled on or off and the complexities of the game tweaked.

> **Important note:** Although this is inspired by [Kahoot!](https://kahoot.com/), it is **not affiliated** with them. This project uses *absolutely no* Kahoot! assets and is a *complete rewrite from scratch*. This is my own personal project - nothing official.

## Design goals

* To allow anybody to set up a lightweight instance and anybody to play on any instance they choose. You can spin up a server to play with friends on or for a presentation or for a class.
* To provide a minimal, high-performance version of the game which can function on almost any device. This includes both the client and server. You should be able to spin up an instance on your laptop with your work team or in school; or host one persistently on your Raspberry Pi.
* To encourage a distributed model of play, in which there are many different game servers on which many different hosts and players reside. There is no need for a central setup of Gahoot, although some servers may become more popular than others.

## Design document

There is a design document that I wrote in "DESIGN". It is formatted in GROFF MS format, as I wrote this as part of a school project, but its apparently quite interesting to many. To view it, use the following pipeline:

```bash
groff -ms -Tpdf DESIGN | zathura -
```

Some parts might sound a bit academic (and some never made it into the final project on hand-in date), so if you get confused just skip over the section.

If the above doesn't work for you or if you are really having trouble compiling the design document, just email me (see committer email) and I'll be happy to email you a PDF or PostScript copy.

## Building

Simply run ``make`` in the root. If you do not have ``tsc`` installed on your system, the Makefile will automatically run ``npm install`` for you to counteract your forgetfulness/laziness. You're welcome.

If you are actively developing the program, run ``make watch`` and the server will be reloaded when there is a change to any source code (that includes restarting the server). This requires the BSD utility ``entr``, as well as a POSIX shell interpreter.

> **Note:** You will need to be on a system which supports a POSIX shell in order to build, as the build process relies on running shell scripts. If on Windows, please consider using WSL (sorry!).

## Contributions

Always welcome. Please stick to the style guides outlined in the ``.editorconfig`` file. If possible, use a plugin for your editor to respect this configuration. Basically:

* **ALWAYS** use LF line endings - I cannot stand CRLF
* Tabs size eight for Go, HTML, CSS or anything not mentioned
* Spaces size four for TypeScript
* Space size 2 for most JSON and all YML files

---
vim: ft=markdown

Documentation

Overview

Gahoot is a lightweight, distributed, FOSS rewrite of Gahoot in Go. It has the following design goals:

  1. Be lightweight enough to be run by individual users
  2. To be cross platform, both the server and client
  3. To encourage a distributed network of game servers and players

This IS NOT a feature complete remake of Kahoot. Instead, it is an opinionated rewrite of what I think makes the game special. It IS NOT the same game and IS NOT intended as a hard replacement. It IS intended to be fun and useful, however.

Gahoot can be run by simply running the binary "./gahoot". If this causes an error to do with "missing frontend", make sure you pulled from SCM properly and/or have all included distribution files; you need everything included.

Configuration is stored in "config.gahoot" in the same directory as program startup. We do not crawl your filesystem. No files outside the application directory (the value of getcwd() at startup) should be accessed or need to be accessible to the program.

Quizzes stored on disk are, by default, stored in a directory called "quizzes" in the application directory. This is crawled once at startup and is never accessed again. Quizzes can be loaded into memory via the web interface by anybody at any time, although Gahoot manages this carefully to avoid OOM or DOS-based attacks on the server. Quizzes are stored as JSON-encoded dumps of all quiz metadata and all questions provided.

Directories

Path Synopsis
Package config represents an abstraction over the Gahoot config file and implements a parser, loader and validator for said configuration.
Package config represents an abstraction over the Gahoot config file and implements a parser, loader and validator for said configuration.
Package game implements the main game controller and contains representations for a current game state.
Package game implements the main game controller and contains representations for a current game state.
quiz
Package quiz implements Gahoot quiz archive serialisation and parsing, as well as hashing and integrity checking.
Package quiz implements Gahoot quiz archive serialisation and parsing, as well as hashing and integrity checking.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL