Dead simple self-hosted calorie tracker.
Calorific is aimed at people who more or less know what they're doing and don't need to micromanage their macro-nutrients. Just add your calorie count.
- Log meals
- Save commonly used meals
- Save commonly used ingredients
- Build log entries from saved meals and ingredients lists
- Build saved meals from ingredients list
- Set a daily calorie goal to see your progress throughout the day
- Built-in update mechanism
- Nord
Plus a number of minor features, such as:
- Option to display boxes to filter your growing meal/ingredients lists
- Option for hour offsets to work around server time issues
- Previewing how a log entry will impact your daily calorie count when creating it
- Functionality for cleaning up your log database
- A button to hide the control panel
You can run Calorific on your own AMP stack, or via Docker.
- A web server
- A SQL server
- PHP
Calorific is developed and tested using Apache2 and MySQL, but other web servers and SQL servers will probably work. Maybe.
- Docker and Docker Compose
- Clone this repository, or grab the latest release
- Put the
calorific
directory in your web server document root (typically/var/www/html
). - Create
credentials.php
within the same directory asindex.php
, and populate it with the following:
<?php
$mysqlHost = "your-sql-hostname";
$mysqlUser = "your-sql-username";
$mysqlPassword = "your-sql-password";
$mysqlDB = "your-sql-database";
// uncomment if using mysql < 8 or mariadb < 11.4.5
// $mysqlCollation = "utf8mb4_general_ci";
The $mysqlDB
variable is optional and can be omitted in order to create and use the default database (calorific
).
- Replace the values of the variables to fit your database configuration. Calorific will set up the database structure by itself.
- To update Calorific, use the included updater, or run
git pull
in the repository directory (requiresgit
to be installed).
- Clone this repository, or grab the latest release
cd
to the directory with the repository.- Build and run the image with
docker-compose up -d
- Wait 10-20 seconds after the first run to let the database start up.
- Visit
http://localhost:1338/
in your browser to use the application. - To stop, run
docker-compose stop
in the repository directory. - To update Calorific, run
git pull
in the repository directory (requiresgit
to be installed).
- Delete the
calorific
directory from the web server document root. - Delete the
calorific
database from the MySQL server -DROP DATABASE calorific
Run docker-compose down
from inside the repository directory, then delete it. Note that running this command destroys your stored Calorific data; don't do it unless you wish for that to happen.
There are currently zero security measures implemented in regards to open access. This application is meant to be ran on your local network, then accessed through VPN, reverse proxy, etc. For external access, you can use .htaccess
based authentication, a VPN server like WireGuard, a reverse proxy with authentication, or whichever other method you prefer. Alternatively, you can make sure the application isn't exposed outside your local network, and just use it from within that network.
If you are running Calorific in Docker and also exposing it outside your own network, you need to change the MySQL username and password in docker-compose.yml
and index.php
to something unique! If you don't, your database will be vulnerable, as the default credentials are included in plain text in this repository.
You can update Calorific through the UI by clicking "Update" on the bottom right of the page. This is disabled by default, as it requires you to be running Calorific outside of Docker and inside a trusted environment. It requires git
to be installed on a UNIX-like server. Calorific passes your password to the OS in plain text, and although it isn't logged, the mechanism in which it operates can be abused by someone with access to the updater. In order to enable the updater, you must add this to your credentials.php
:
$updaterEnabled = true;
This can be toggled on and off at will, and will apply on the next page load. You can enable it, update, then disable it again if you'd like, but I definitely don't recommend keeping it on if you're running in an untrusted environment where other people may have access to Calorific.
Nothing contained within this software is to be construed as professional advice; medical, nutritional or otherwise. It is merely a tool to assist the user in managing their own nutrition. Always consult with a doctor or nutritionist before significantly altering your diet.
Calorific is free and open source software, licensed under the GNU General Public License v3.0.
Calorific - Dead simple self-hosted calorie tracker
Copyright ©️ 2023-2024 xdpirate
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.