Skip to content

Sparths/AnyHabit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

128 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

AnyHabit

FastAPI React Tailwind CSS SQLite Docker Discord Live Demo

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.


πŸ“Ί Preview & Updates

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!

AnyHabit Demo

πŸš€ Click to see Recent Updates (Changelog)

[v1.2.0] - Latest Release

[v1.0.0] - Multi User

[v0.10.0] - Stand Alone API

[v0.9.0] - Widgets

[v0.8.0] - Habit Scheduling

[v0.7.0] - Refactor App Structure


✨ Key Features

  • 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.

πŸš€ One-Command Quick Start

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 --build

Open 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.


βš™οΈ Configuration

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:

  1. Create an environment file: cp .env.example .env
  2. Edit .env and change APP_PORT=8080
  3. Restart: docker compose up -d

πŸ“š Backend API Documentation

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

Quick Links

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

Example: Use the API

# 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/docs

Interactive API Documentation

FastAPI provides built-in interactive documentation:


πŸ› οΈ Tech Stack


🀝 Community & Contributing

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:

⭐ Star History

Star History Chart

About

A universal habit and tracking dashboard tailored for Raspberry Pi and Docker.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

Contributors