AnyHabit is a streamlined, universal habit-tracking dashboard designed for Raspberry Pi, home servers, and Docker enthusiasts. It provides a minimalist interface to track positive growth or systematically reduce harmful routines.
Important
Try it now: Explore the Live Demo Site
Join the Community: AnyHabit Discord Server β Get support, showcase your work, and chat with fellow devs!
π Click to see Recent Updates (Changelog)
- Added: Data Export
- Full Changelog
- Added: Multi User Support
- Full Changelog
- Added: Stand Alone API
- Full Changelog
- Added: Homepage Widgets
- Full Changelog
- Added: Flexible Habit Scheduling
- Full Changelog
- Added: Refactor app structure, Fix Bugs
- Full Changelog
- Dual Tracking Modes: Monitor positive routines or reduce harmful ones.
- Categories: Organize your dashboard with custom categories.
- Accounts & Groups: Sign in with private accounts, then create family/friend groups for shared trackers.
- Shared Trackers: Assign multiple group members to one tracker and compare progress per participant.
- Dual Streaks: Track both individual streaks and a collective group streak for shared goals.
- Dark Mode: Seamlessly switch between Light and Dark themes.
- Impact Units: Automatically calculate money/Calories and more by avoiding negative habits.
- Daily Journal: Log your mood and thoughts alongside your habits.
- Self-Hosted & Private: Complete control over your data with SQLite and Docker.
- Full Data Ownership (Export & Import): Export your trackers and journals as CSV for analysis, or generate a complete JSON raw-backup of your entire profile to safely restore or migrate your data to another server.
AnyHabit is designed to be "up and running" in seconds. You do not need Node.js or Python installed locally.
Requirements: Docker with the Compose plugin.
# 1. Clone the repository
git clone https://github.com/Sparths/AnyHabit.git
cd AnyHabit
# 2. Build and start everything
docker compose up -d --buildOpen http://localhost (or your device's IP) in your browser.
Tip
Your data is safely stored in a Docker volume (db_data) and will persist even if you stop or rebuild the containers.
| Variable | Description | Default |
|---|---|---|
APP_PORT |
The port on which the app is accessible | 80 |
VITE_API_URL |
Backend URL for local frontend development | http://localhost/api |
ANYHABIT_SECRET_KEY |
JWT signing secret for authentication | change-me-in-production |
ANYHABIT_CORS_ORIGINS |
Comma-separated allowlist of frontend origins | http://localhost:5173,... |
ANYHABIT_COOKIE_SECURE |
Marks auth cookie as secure-only | true |
ANYHABIT_COOKIE_SAMESITE |
SameSite policy for auth cookie | lax |
ANYHABIT_COOKIE_DOMAIN |
Optional domain scope for auth cookie | unset |
ANYHABIT_BOOTSTRAP_USERNAME |
Initial local login username | owner |
ANYHABIT_BOOTSTRAP_EMAIL |
Initial local login email | owner@anyhabit.local |
ANYHABIT_BOOTSTRAP_PASSWORD |
Initial local login password | anyhabit |
Frontend auth now uses HttpOnly cookies; API calls must include credentials.
To change the port:
- Create an environment file:
cp .env.example .env - Edit
.envand changeAPP_PORT=8080 - Restart:
docker compose up -d
AnyHabit provides a complete REST API that enables you to:
- β Build custom frontends with any framework (React, Vue, Flutter, etc.)
- β Integrate with your own applications - β Access all data programmatically without the UI
| Resource | Description |
|---|---|
| π API Documentation | Complete API reference with 25+ endpoints and examples |
| β‘ Quick Reference | One-page API cheat sheet for quick lookup |
| π§ Frontend Integration Guide | Guide for building custom frontends with the API |
| ποΈ Documentation Index | Main navigation hub for all backend docs |
| π» Development Guide | Backend development and contribution guide |
# Get all trackers
curl http://localhost:8000/api/trackers/
# Get complete tracker data (with analytics, logs, journals)
curl http://localhost:8000/api/trackers/1/bundle
# View interactive API docs
# Open in browser: http://localhost:8000/docsFastAPI provides built-in interactive documentation:
- Swagger UI - Try endpoints live
- ReDoc - Alternative documentation format
- Backend: FastAPI (Python 3.12-slim)
- Frontend: React 19 + Vite
- Styling: Tailwind CSS 4
- Proxy: Nginx as a Reverse Proxy & Static File Server
AnyHabit is an open-source, community-driven project!
Join our Discord Server to:
- π οΈ Get help with your setup or projects.
- π Showcase what you've built.
- π¬ Chat with other programmers and contributors.
Other ways to help:
- π‘ Ideas: Open a Feature Request
- π Bugs: Open a Bug Report
- π» Code: Check our Contributing Guidelines
