1
0
Fork
You've already forked rstrain_server
0
This is the server application for rstrain, a time-series based tracker for personal stress levels
  • Rust 56.3%
  • HTML 22.4%
  • JavaScript 20%
  • jq 1.3%
Find a file
2025年10月06日 09:01:59 +02:00
.idea Initial commit 2025年08月16日 16:02:27 +02:00
grafana add README and grafana dashboard examples 2025年09月27日 10:38:00 +02:00
src fix some serialisation issue with the form timestamp 2025年10月06日 09:01:59 +02:00
static fix add strain button getting removed by remove_levels() function 2025年10月04日 10:43:57 +02:00
.gitignore Add an update method by supplying the object ID 2025年08月19日 20:53:05 +02:00
Cargo.lock Add functionality to add a custom time stamp 2025年09月27日 10:12:12 +02:00
Cargo.toml Add functionality to add a custom time stamp 2025年09月27日 10:12:12 +02:00
README.md add README and grafana dashboard examples 2025年09月27日 10:38:00 +02:00
Rocket.toml Add a cookie with the bearer token when logging in 2025年09月21日 20:28:07 +02:00

This project aims to provide a convenient way of tracking stress levels.

Installation / Quick Start

PKGBUILD for archlinux coming soon (tm).

For now, you need to

  1. clone the repository
  2. cargo build
  3. add jquery-3.7.1-min.js to the static directory
  4. add js.cookie.min.js to the static directory
  5. configure the application via Rocket.toml (example is provided here)
    • provide a mongodb URL
    • set a default username and password
  6. cargo run and visit https://localhost:8001

Interface

You'll be greeted by a login modal if you're not already logged in. Currently there's only the option to add a new level. Optionally with custom time stamp and a note.

Features TODO (webapp)

  • login screen
  • add level
  • add level with note
  • add level with note and custom timestamp
  • display levels and notes for a specific day
  • edit level:
    • add note
    • delete
  • monthly overview of stress levels

Grafana

An Json config is provided to quickly spin up a dashboard.

On Arch-Linux for example using the grafana cli:

sudo -u grafana grafana cli --homepath "/usr/share/grafana" plugins install yesoreyeram-infinity-datasource
  • Set up URL and Headers

Authentication is provided by setting the Authentication header to a bearer token. You can get this token for example by sending a CURL request to the login endpoint:

curl -X POST -H 'Content-Type: application/json' -d '{ "username": "puppy", "password": "wauwauwau" }' http://localhost:8001/login

Alternatively, you can aquire the content of the token Cookie after logging into the web application.

Background

For people suffering from borderline personality disorder (BPD), but also post traumatic stress disorder (PTSD) or anyone else struggling with high levels of stress caused by feelings, getting a feeling of your stress levels is essential to efficently and successfully use skills instead of engaging in self-harming behaviour. This project aims to enable a digital tracking of stress levels and causes.