A mobile-first, self-hosted web application for tracking nutritional supplement intake. Supple Tracker provides a simple, fast interface for logging your daily supplements with just a few taps.
- One-click logging: First time opens modal, subsequent clicks quick-log with last dosage
- Smart timestamps: See when you last took each supplement ("2h ago", "Yesterday")
- Visual organization: Color-coded left borders for easy identification
- Last dosage display: Know exactly what you took last time
- Edit menu: Three-dot (⋯) icon for customizing dosage or adding notes
- Full CRUD operations: Create, edit, and delete supplements
- Drag-and-drop reordering: Organize supplements in your preferred order
- Color customization: Choose from 9 vibrant colors (Gray, Red, Orange, Yellow, Green, Blue, Purple, Pink, Cyan)
- Default dosages: Pre-fill common dosages for faster logging
- Safety confirmations: Warns before deleting supplements
- Chronological listing: All logs sorted newest first
- Powerful filtering:
- Filter by supplement
- Filter by date range (from/to)
- Real-time search across all fields
- Edit/Delete: Modify or remove past entries
- Data export: Download your complete history as CSV or JSON
- Smart dates: "Today at 2:30 PM", "Yesterday", or full dates
- Full dark mode support
- Persists your preference
- Easy toggle in header (☀️/🌙)
- Node.js 18.0.0 or higher
- npm or yarn
-
Clone the repository
git clone https://github.com/js-reid/supple-tracker.git cd supple-tracker -
Install dependencies
npm install
-
Seed the database (optional - adds example supplements)
npm run seed
-
Start the server
npm start
-
Open in your browser
http://localhost:3000
The application will create a SQLite database in ./data/supplements.db on first run.
For development with auto-reload:
npm run dev- Navigate to Settings (top navigation)
- Click + Add Supplement
- Enter:
- Name (e.g., "Vitamin D3")
- Default dosage (e.g., "5000 IU") - optional
- Choose a color
- Click Save
First time:
- Click the supplement button on the home page
- Enter the dosage (pre-filled if you set a default)
- Optionally adjust time or add notes
- Click Log It
After first log:
- Simply click the button to quick-log with the same dosage
- Click the ⋯ icon to customize dosage/notes
- Navigate to History
- Use filters to find specific logs:
- Select a supplement from the dropdown
- Set date range with From/To pickers
- Type in the search box to find notes
- Click ✏️ to edit or 🗑️ to delete
- Export data with Export CSV or Export JSON buttons
supple-tracker/
├── server.js # Express server and API routes
├── package.json # Dependencies and scripts
├── db/
│ ├── init.js # Database initialization
│ ├── queries.js # SQL query definitions
│ └── seed.js # Sample data seeder
├── public/
│ ├── index.html # Main page
│ ├── history.html # History page
│ ├── settings.html # Settings page
│ ├── css/
│ │ └── styles.css # All styles (light/dark mode)
│ └── js/
│ ├── main.js # Main page logic
│ ├── history.js # History page logic
│ └── settings.js # Settings page logic
└── data/
└── supplements.db # SQLite database (created on first run)
- Backend: Node.js + Express
- Database: SQLite3
- Frontend: Vanilla JavaScript (no frameworks!)
- Styling: CSS3 with CSS variables for theming
- Design: Mobile-first responsive design
CREATE TABLE supplements (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
default_dosage TEXT,
button_color TEXT DEFAULT '#6c757d',
sort_order INTEGER DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);CREATE TABLE logs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
supplement_id INTEGER NOT NULL,
taken_at TIMESTAMP NOT NULL,
dosage TEXT NOT NULL,
notes TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (supplement_id) REFERENCES supplements(id) ON DELETE CASCADE
);GET /api/supplements- Get all supplementsPOST /api/supplements- Create new supplementPUT /api/supplements/:id- Update supplementDELETE /api/supplements/:id- Delete supplementGET /api/supplements/last-taken- Get last taken info for all supplements
GET /api/logs- Get all logsPOST /api/log- Create new log entryPUT /api/logs/:id- Update log entryDELETE /api/logs/:id- Delete log entry
GET /api/export/csv- Export logs as CSVGET /api/export/json- Export logs as JSON
The API is fully accessible for external tools like Apple Shortcuts, IFTTT, or home automation systems.
Create a shortcut that makes an HTTP POST request to log supplements:
Example: Log Vitamin D3 (Full)
POST http://your-server:3000/api/log
Content-Type: application/json
{
"supplement_id": 1,
"dosage": "5000 IU",
"taken_at": "2026-01-05T10:30:00.000Z",
"notes": "with breakfast"
}
Example: Minimal (Auto-timestamp)
POST http://your-server:3000/api/log
Content-Type: application/json
{
"supplement_id": 1,
"dosage": "5000 IU"
}
This will automatically use the current timestamp.
Getting Supplement IDs:
GET http://your-server:3000/api/supplements
This returns all supplements with their IDs, which you can use in your shortcuts.
Use Case: RFID Tags
- Stick NFC/RFID tags on supplement bottles
- Create an Apple Shortcut that POSTs to
/api/logwhen scanned - Map each tag to a specific supplement_id
- Scan the bottle to instantly log your supplement!
Required Fields:
supplement_id(integer) - ID of the supplementdosage(string) - Amount taken (e.g., "500mg", "2 pills")taken_at(ISO 8601 timestamp) - When it was taken
Optional Fields:
notes(string) - Any additional notes
Set the PORT environment variable:
PORT=3001 npm startEdit the color palette in public/settings.html (line 63):
<button type="button" class="color-option" data-color="#yourcolor"
style="background-color: #yourcolor;" title="Your Color"></button>All colors are defined as CSS variables in public/css/styles.css (lines 1-41). Adjust the :root and body.dark-mode sections to customize the color scheme.
Recommended for most users - No build required:
-
Create a directory for your data
mkdir -p ~/supple-tracker/data cd ~/supple-tracker
-
Download the production docker-compose file
curl -O https://raw.githubusercontent.com/js-reid/supple-tracker/main/docker-compose.prod.yml
-
Pull and start the container
docker-compose -f docker-compose.prod.yml up -d
-
Access the application
http://localhost:3000
The SQLite database will be persisted in ./data/supplements.db via volume mount.
If you want to build the image yourself:
-
Clone the repository
git clone https://github.com/js-reid/supple-tracker.git cd supple-tracker -
Start with Docker Compose
docker-compose up -d
# Pull from GitHub Container Registry
docker pull ghcr.io/js-reid/supple-tracker:latest
# Or build locally
docker build -t supple-tracker .
docker run -d \
--name supple-tracker \
-p 3000:3000 \
-v $(pwd)/data:/app/data \
-e PORT=3000 \
--restart unless-stopped \
ghcr.io/js-reid/supple-tracker:latestSupple Tracker works great on Unraid! Here's how to set it up:
-
In Unraid Docker settings, add a new container with these settings:
- Repository:
ghcr.io/js-reid/supple-tracker:latest - Network Type: Bridge
- Port Mapping:
- Container Port:
3000 - Host Port:
3000(or your preferred port)
- Container Port:
- Volume Mapping:
- Container Path:
/app/data - Host Path:
/mnt/user/appdata/supple-tracker
- Container Path:
- Environment Variables (optional):
PORT=3000NODE_ENV=production
- Repository:
-
Apply and start the container
-
Access via your reverse proxy or directly at
http://your-unraid-ip:3000
The app will automatically create the SQLite database on first run.
The included GitHub Actions workflow automatically builds and pushes to ghcr.io when you:
- Push to the
mainbranch (createslatesttag) - Create a version tag like
v1.0.0(creates versioned tags)
One-time setup:
- Push your code to GitHub
- Go to your repo Settings → Actions → General
- Under "Workflow permissions", select "Read and write permissions"
- The workflow will run automatically on your next push
Making the image public:
- Go to https://github.com/js-reid?tab=packages
- Click on your
supple-trackerpackage - Click "Package settings"
- Scroll down and click "Change visibility" → Make public
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with vanilla JavaScript - no frameworks needed!
- Designed mobile-first for optimal use on phones
Future enhancements being considered:
- Multi-user support: User authentication and individual profiles
- Reminders: Notifications for scheduled supplements
- Analytics: Charts and insights on supplement consistency
- PWA: Progressive Web App for offline support
- Recurring schedules: Auto-suggest supplements based on time of day
- Mobile apps: Native iOS/Android wrappers
For questions, issues, or feature requests, please open an issue on GitHub.
Made with ❤️ for better health tracking