https://github.com/hmaier-dev/checklist-tool
web-app to work down yaml-based checklists
https://github.com/hmaier-dev/checklist-tool
golang htmx sqlite yaml
Last synced: 2 months ago
JSON representation
web-app to work down yaml-based checklists
- Host: GitHub
- URL: https://github.com/hmaier-dev/checklist-tool
- Owner: hmaier-dev
- License: gpl-3.0
- Created: 2025-02-23T09:59:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-12-02T19:38:41.000Z (7 months ago)
- Last Synced: 2025-12-03T04:39:05.558Z (7 months ago)
- Topics: golang, htmx, sqlite, yaml
- Language: Go
- Homepage:
- Size: 732 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
>[!NOTE]
> Go find the the tool on https://codeberg.org/schnelles_geraet/checklist-tool
## Development
To simplifly development on Windows and Linux [`earthly`](https://docs.earthly.dev/) is used to build the project.
```cmd
earthly +run --tag="test"
```
The outputs a image called `ghcr.io/hmaier-dev/checklist-tool:test`. Run this image by using the compose stack.
```cmd
earthly +run --tag="test" && docker compose up
```
A example compose stack is within the root of the project.
Use this command to run it raw without `earthly`
```bash
go build -x -v -p 4 -o ./bin/cltool main.go && tailwindcss -i ./static/base.css -o ./static/style.css && ./bin/cltool -db=sqlite.db
```
### SQL
All changes to the database schema/queries are done in the sql-files in root (`schema.sql` and `query.sql`). After making changes, you need to run
```bash
sqlc generate
```
from the project-root which contains the config file `sqlc.yml`.
>[!WARNING]
> Please beware that `sqlc` does not run any migrations. You can break existing databases by adjusting your schema.
## Deployment
A example `compose.yml` can be found under the root of this project.
### gotenberg
The gotenberg-Container is used for the creation of pdfs.
The checklist-tool can be run without gotenberg, but will throw an error when a checklist gets exported: https://github.com/hmaier-dev/checklist-tool/blob/66159b446c2180e9c846cbad91a53904368872d5/internal/pdf/pdf.go#L13
## Checklist
This app uses `yaml` store the checklist itself and a preceding frontmatter to store all meta-data.
A checklist can look like this:
```yaml
---
name: auf arbeit gehen
fields: [fullname,ticket,typ]
desc: ["Nachname, Vorname","Ticket Number","Modell"]
tab_desc_schema: [fullname,typ]
pdf_name_schema: [date,fullname,typ]
---
- task: "Auf Arbeit kommen."
checked: false
text: "Setze diesen Schlüssel, um ein Textfeld anzuzeigen."
children:
- task: "Kaffee trinken."
checked: false
- task: "Tickets bearbeiten."
checked: false
```
### Frontmatter
Is the place where all the meta-data is stored.
| Key | Data |
| --- | --- |
| fields | Takes a list of keys, which will store user input (need to be the same length as `desc`). E.g. `fields[2] == desc[2]` |
| desc | Takes a list of quoted strings, which function as labels for the input fields (need to be the same length as `fields`) E.g. `desc[1] == fields[1]`|
| tab_desc_schema | Defines the browser-tab-description-schema. Use the `fields` seperated by `,`. Values will be display separated by `\|` |
| pdf_name_schema | Defines how the pdf will be named. Use the `fields` seperated by `,`. Values will be display separated by `_`. **An extra field is `date` (only available in this key)** which displays the current date when exporting in `yyyyMMdd`-format. |
### Yaml
>[!NOTE]
> Note that, the `task`-string is used as an identifier and cannot be used twice!
## Motivation
At work I'm dealing with mobile devices, whose setup require multiple steps I need to keep track of. This is not just for me but also for quality assurance.
Working with/in PDFs is tireseome in serveral ways. So I decided to write this small project, which should ease my time setup up the devices.