Skip to content

Sparths/AnyHabit

AnyHabit

FastAPI React Tailwind CSS SQLite

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

AnyHabit Demo

Watch how AnyHabit tracks your progress and savings in real-time.


🚀 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 (Optional)

By default, AnyHabit runs on port 80. If you need to change this (e.g., to run alongside other services on a Raspberry Pi), follow these steps:

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

🛠️ Architecture

AnyHabit uses a modern, high-performance stack:

  • Backend: FastAPI (Python 3.12-slim).
  • Frontend: React 19 served via Nginx.
  • Styling: Tailwind CSS 4 for a lightweight, modern UI.
  • Database: SQLite for zero-config persistence.
  • Reverse Proxy: Integrated Nginx configuration to route API requests seamlessly.

🤝 Community & Contributing

AnyHabit is an open-source, community-driven project! We would absolutely love your input to make it even better.

  • 💡 Have an idea? We actively encourage feature requests! Open a Feature Request to share your ideas and discuss them with the community.
  • 🐛 Found a bug? Help us squash it by Opening a Bug Report.
  • 💻 Want to write code? We welcome Pull Requests! Please check out our Contributing Guidelines to get your local environment set up.

Whether it's a typo fix, a new feature, or a documentation update, all contributions are highly appreciated! Please ensure you follow our Code of Conduct when interacting with the community.


👨‍💻 Local Development

If you wish to modify the code and run it without Docker:

Backend

pip install -r backend/requirements.txt
mkdir -p backend/data
uvicorn backend.main:app --reload --host 0.0.0.0 --port 8000

Note: Make sure to install dependencies from backend/requirements.txt.

Frontend

cd frontend
npm install
# Set API URL to point to your local backend
VITE_API_URL=http://localhost:8000 npm run dev

This addition explicitly tells visitors that they aren't just downloading a finished tool—they are invited to be part of the ongoing development process!