LibreFit: Your OpenSource Calorie Tracker
LibreFit is my hobby project that allows you to calculate your TDEE (Total Daily Energy Expenditure) based on your body metrics, create goals for weight loss or weight gain from that and encourages you to track your daily calorie intake. Based in your input, you will see easy to understand charts to keep on track with your goal - all that with privacy first in mind.
LibreFit was created after tracking my caloric intake with some Excel and Google Sheets over a year. Out of boredom I decided to try a new stack I've never done anything productive with, I quite enjoyed the journey and thus this project was born.
The project is structured as a gradle monorepo.
librefit
|- librefit-api
|- librefit-service
|- librefit-web
The build order is: librefit-service
-> librefit-api
-> librefit-web
.
A subpackage that ingests the OpenAPI spec genereated by Quarkus and produces JSDoc descriptions with a homebrew generator that follows absolutely no standards which I'm both ashamed and proud of.
To generate fresh code from the spec, use
./gradlew librefit-api:ApiCodegen
The service part of the application. For dev purpose, it expects a running Postgres instance on http://localhost:5432
.
If you have a working docker installation, run
docker-compose up -d
or provide an own instance.
To generate the latest OpenAPI spec, run
./gradlew librefit-service:buildDependents
This will only work with passing integration tests ;)
To start the service, run
./gradlew librefit-service:quarkusDev
For more details, see librefit-service/README.md.
By default, librefit-service handles vite to serve directly from quarkus. If you prefer to run the modules separately,
set %dev.quarkus.quinoa=false
in application.properties
.
You can either provide a node installation yourself or let gradle handle it for you. Gradle will download a node 21.7.0 environment for this project to use.
Start dev server with gradle:
./gradlew librefit-web:npm_run_dev
Start dev server with local npm installation:
cd librefit-web && npm run dev
For more commands, please see librefit-web/package.json and also librefit-web/README.md.
The avatars were created with hotpot: https://hotpot.ai/art-generator
If you have any suggestions, impediments or things that absolutely annoy you, please refer to the issue tracker linked at the top of this document. When you are interested in participating in development, feel free to contact me.