pgulb / flush-log

https://pgulb.github.io/flush-log/
1 stars 0 forks source link

Flush Log

Flush Log is Progressive Web App that can be used to track your bowel movements
it is available at https://pgulb.github.io/flush-log/

Why

You can improve your toilet habits, for example reduce time mindlessly scrolling through Social Media if you see how much time it takes
FL allows you to track stats like time, number/% of times with phone, mean time, mean rating etc

What is Progressive Web App

In short it's a web app that allows itself to be 'installed' both on desktop and mobile devices as an app, option to install appears usually at the right side of searchbar, and on mobile in the three dot menu

PWAs aim to look more like native application than a regular website, they also cache themselves on user's device to load faster and notify user when an app can be updated

Initial diagram for how it should work (now slightly modified)

app diagram

development info

flush-log uses Taskfile (https://taskfile.dev/) to automate commands used to develop and test its components
Components are:

App server vs static website

Go-app can be compiled to executable to run as a server, or compiled to static content
In production I compile it to static and deploy to Github Pages
Tests and local development is done with server version (pipeline tests with Docker)


List all available tasks

task

Prepare venv

I use uv https://github.com/astral-sh/uv to create venv and install dependencies while developing
Tests are run using venv

task init-uv-venv

Spin up whole stack in Docker locally and watch logs

task dev

And go to http://localhost:8080 for hot-reloading app
API is located at http://localhost:6789
and Mongo at mongodb://localhost:27017


Remove containers

task cleanup

API tests

unit

task test-api-unit

mocked

task test-api-mock

with local mongo

task test-api-integration

PWA tests

unit

task test-pwa-unit

integration (with go-rod https://go-rod.github.io/#/)

task test-pwa-integration

integration with visible browser window

task test-pwa-integration-show-window

Github Workflows