Skip to content

CAIMAN Design Notes

Tasks are managed by Taskwarrior, a command-line tool for task management; under the hood, Taskwarrior uses SQLite to store all tasks and relevant information. Each CLAS12 Run Group gets its own SQLite database and therefore its own dashboard. A template database is also used as a starting point for a new database.

The databases are stored in the caiman-data repository, for safe-keeping.

The dashboard website is read-only, that is, it cannot modify any database. It is generated with custom code in /web that reads the Taskwarrior databases and writes a website dashboard for each.

Various tools exist to edit Taskwarrior databases; here we use VIT since it is lightweight and works entirely in the terminal.

Running bin/caiman will run vit; when the user is done with vit, it will regenerate and deploy the webpage.

To prevent collisions between two users, the flock utility (see man flock) is used to allow only one user at a time to run bin/caiman. Logging output is written to the log/ directory.

Here is a diagram:

flowchart TB
    subgraph caiman
        bin[<code>bin/caiman</code>]
        subgraph "&nbsp;&nbsp;flock"
            vit[<code>vit</code>]
            gen[<code>web/generate.rb</code>]
        end
    end
    subgraph caiman-data
        db0[template DB]
        dba[RG-L DB]
        dbn[...]
    end
    web[dashboard<br>website]
    bin --> vit --> gen --> web
    vit <-- read/write --> caiman-data -- read --> gen