A simple weight tracking application with a web-based interface that allows users to log their weight over time and visualize it using a chart.
- Log weight entries with date validation.
- View a historical graph of weight changes over time.
- Weight over time is displayed in a chart.
- Data is persisted in a JSON file (
weights.json
). - Calculate and display BMI and BMI status.
- Display age based on date of birth.
- Display weight in kilograms and stones, pounds, and ounces.
- Display goal weight.
See below screenshot for example
- Backend: Go (net/http)
- Frontend: HTML, JavaScript, Chart.js
- Data Storage: JSON files
- Go installed (1.16+ recommended)
- A working web browser
DOB
: Date of birth inDD/MM/YYYY
format.HEIGHT
: Height in meters. e.g.1.75
GOAL
: Goal weight in kilograms. e.g.70.2
- Clone the repository:
git clone https://github.com/thomaschaplin/kilokeeper.git cd kilokeeper
- Create required files and directories:
mkdir data touch data/weights.json
- Initialize the
weights.json
file:[]
- Set environment variables:
export DOB="01/01/1990" export HEIGHT="1.75" export GOAL="70.2"
- Run the application:
go run main.go
- Access the web app:
Open
http://localhost:8080
in your browser.
GET /weights
POST /weights/add
{
"date": "DD/MM/YYYY",
"kilograms": 75.5
}
- Add BMI calculation.
- Add age to chart based on global date of birth
- Store data in a database instead of JSON files.
- Add multiple users.
- Add user authentication.
MIT License
Made with ❤️ by Thomas Chaplin