1- = Ceopardy
1+ # Ceopardy
22
33The Hacker Jeopardy Game Board we use at NorthSec.
44
5- == Screenshots
5+ ## Screenshots
66
77This is what the crowd sees:
88
9- image::docs/images/viewer-board.png [The Viewer Interface Displaying the Game Board]
9+ ! [ The Viewer Interface Displaying the Game Board] ( docs/images/viewer-board.png )
1010
1111When a clue is displayed:
1212
13- image::docs/images/viewer-clue.png [The Viewer Interface Displaying a Clue]
13+ ! [ The Viewer Interface Displaying a Clue] ( docs/images/viewer-clue.png )
1414
1515This is the host interface, how you control the game:
1616
17- image::docs/images/host.png [The Host Interface]
17+ ! [ The Host Interface] ( docs/images/host.png )
1818
1919Note that there are two drawers that can be opened by clicking on the brown
2020arrows at the top and at the bottom of the screen. The top drawer contains
2121the functions to change team names. The bottom drawer provides functions to
2222display a custom message on the board or to pause a game.
2323
2424
25- == Architecture
25+ ## Architecture
2626
2727Starting with v0.5, Ceopardy is split in two parts:
2828
29- * A Python/Flask back-end that exposes a small REST API (`/api/v1/...`) and
29+ - A Python/Flask back-end that exposes a small REST API (` /api/v1/... ` ) and
3030 broadcasts state changes over a single Socket.IO namespace (` /game ` ).
31- * A Vite + Vue 3 front-end (in `frontend/`) that powers the crowd-facing
31+ - A Vite + Vue 3 front-end (in ` frontend/ ` ) that powers the crowd-facing
3232 viewer, the host UI, and the start screen.
3333
3434
35- == First time deployment
35+ ## First time deployment
3636
3737You need Python, pip, virtualenv and Node.js (LTS). The tl;dr:
3838
3939 make venv
4040 source .venv/bin/activate # bash/zsh
4141 source .venv/bin/activate.fish # fish
42+ make init # seed data/ and game-media/ from templates
4243 npm install --prefix frontend
4344 npm run build --prefix frontend
4445 python run.py
4546
4647` make venv ` creates ` .venv/ ` and installs both runtime and dev requirements.
48+ ` make init ` is a one-time step that copies starter ` data/1st.round ` and
49+ ` data/Questions.cp ` into the repo and creates ` game-media/ ` . Edit those files
50+ to set up your game.
4751
48- === Optional: direnv
52+ ### Optional: direnv
4953
50- If you use https://direnv.net/[direnv] , the repo ships an `.envrc` that puts
54+ If you use [ direnv ] ( https://direnv.net/ ) , the repo ships an ` .envrc ` that puts
5155` .venv/bin ` on your ` PATH ` automatically when you ` cd ` into the directory —
5256works in bash, zsh, and fish. Install direnv (see
53- https://direnv.net/docs/installation.html[upstream docs] for shell hook setup),
57+ [ upstream docs ] ( https://direnv.net/docs/installation.html ) for shell hook setup),
5458then from the repo root:
5559
5660 make venv # create the venv first; direnv won't do this for you
@@ -59,8 +63,8 @@ then from the repo root:
5963After that, entering the directory activates the venv and leaving deactivates
6064it — no manual ` source ` needed.
6165
62- Then open http://127.0.0.1:5000/host[the host view] to set up the game.
63- http://127.0.0.1:5000/[The players' view] (also known as the viewer) can be
66+ Then open [ the host view ] ( http://127.0.0.1:5000/host ) to set up the game.
67+ [ The players' view ] ( http://127.0.0.1:5000/ ) (also known as the viewer) can be
6468opened at any time.
6569
6670` python run.py ` runs the built-in dev server (debug + reloader). For
@@ -74,7 +78,7 @@ Put nginx (or similar) in front for TLS and to expose it on the network — the
7478app itself binds to localhost because the host interface has no auth.
7579
7680
77- == Development
81+ ## Development
7882
7983Run Flask and Vite side by side. Vite hot-reloads the UI and proxies
8084` /api ` and ` /socket.io ` to Flask.
@@ -88,26 +92,32 @@ Run Flask and Vite side by side. Vite hot-reloads the UI and proxies
8892Then open http://localhost:5173/ .
8993
9094
91- == Setup
95+ ## Install as a CLI (pipx)
9296
93- === Display
97+ Once published, Ceopardy can be installed as a stand-alone command:
9498
95- You need at least 2 outputs: one for the game host for control and one for the
96- public.
99+ pipx install ceopardy
100+ mkdir my-game && cd my-game
101+ ceopardy init # scaffolds data/ and game-media/ in CWD
102+ # edit data/Questions.cp and data/1st.round
103+ ceopardy # or `ceopardy serve` — starts the server
97104
98- At NorthSec 2017, we used 3 outputs because we didn't have the proper gear to
99- duplicate the public output for a stage monitor. There is a script in
100- `helpers/` that will set 3 outputs using `xrandr`. It didn't work with a GUI
101- tool when we tried at that time.
105+ ` ceopardy init ` never overwrites existing files; it's safe to re-run. The
106+ server, the SQLite database, and the question files all resolve relative to
107+ the directory you run ` ceopardy ` from, so keep one directory per game.
102108
103- == Prepare a game
109+
110+ ## Prepare a game
104111
105112Game data goes in ` data/ ` . There you should add round files (create a ` .round `
106113file) and questions in ` Questions.cp ` . The format is pretty self explanatory.
107- Check `data/` for an example.
108-
109- NOTE: In order to avoid dataloss due to a crash, Ceopardy is backed by a
110- database where transactions are pushed when the hosts submit the points. This
111- has the flipside requiring games to be finalized before a new one can be
112- started. Make sure that you always push the "Game over" button before
113- reloading to start a new game.
114+ Run ` ceopardy init ` (or ` make init ` from the repo) to get a working starter
115+ set; ` data/1st.round ` and ` data/Questions.cp ` are the minimal example.
116+ User-supplied media referenced by questions (e.g. ` [img:photo.png] ` ) goes in
117+ ` game-media/ ` next to ` data/ ` .
118+
119+ > ** Note:** In order to avoid dataloss due to a crash, Ceopardy is backed by a
120+ > database where transactions are pushed when the hosts submit the points. This
121+ > has the flipside requiring games to be finalized before a new one can be
122+ > started. Make sure that you always push the "Game over" button before
123+ > reloading to start a new game.
0 commit comments