]> rtime.felk.cvut.cz Git - coffee/main.git/blob - README.md
nix: Use the same Jinja2 version as on rtime
[coffee/main.git] / README.md
1 # IID Coffee Terminal
2
3 This repo contains git submodules with all source code of this coffee
4 terminal. Fetch it with:
5
6         git submodule update --init
7
8 The `coffee-flask`  directory contains the server application, which
9 runs on [rtime](https://rtime.felk.cvut.cz/coffee) server.
10
11 `terminal` directory is the code running on the terminal. It is a
12 standard buildroot distribution. The most important piece of code here
13 is the `mtaio` application from `terminal/src/mt-apps`.
14
15 A more detailed documentation is available in [Jiří Matěják's Master
16 thesis](https://dspace.cvut.cz/handle/10467/76276).
17
18 ## Collected data
19
20 Data collected by the terminal are stored in an sqlite database on the
21 rtime server. Users with SSH access to that server have read-only
22 access to the database. For example, the whole database can be dumped
23 with this command:
24
25     sqlite3 /home/coffee/coffee-flask/coffee.db .dump
26
27 ## Hacking on the code
28
29 To improve the terminal, you can run all the relevant code on your
30 Linux computer.
31
32 First install all prerequisites:
33
34     apt install python3-flask libev-dev cmake
35         pip3 install flask_cors
36
37 Then compile and run all the software components:
38
39 1. Compile _mtaio_ simulator: `make -C terminal/src/mt-apps SIM=1`
40 2. Run mtaio: `cd terminal/src/mt-apps && ./build/mtaio`
41 3. Run the server application: `cd coffee-flask && FLASK_APP=app.py FLASK_DEBUG=1 flask run`
42 4. Point your web browser to http://localhost:8080/
43 5. Pressing keys in _mtaio_ window simulates various activities.
44    Numbers are cards of different users, letters A through F are
45    different coffee machine buttons.
46
47 ### Submitting patches
48
49 Send patches by email (preferably with [git send-email][]) to
50 `coffee@rtime.felk.cvut.cz` [mailing list][]. You can subscribe the
51 [mailing list][] to discuss the patches sent by others.
52
53 It is recommended to run the [`setup_git`][sg] script in your local
54 repository to configure git optimally for patch submission.
55
56 [git send-email]: https://rtime.felk.cvut.cz/wiki/index.php/Configuring_git_send-email
57 [mailing list]: https://rtime.felk.cvut.cz/mailman/listinfo/coffee
58 [sg]: main.git/blob/HEAD:/setup_git