Personal Project based on the Science of Habits
An application designed to help reinforce good habits, based on the principles of habit science.
- Daily Habit Tracking: Log daily activities to monitor progress and build consistent habits.
- Streak Visualization: Track habit streaks to stay motivated.
- Analytics: Utilize pandas and numpy to provide insights into habit patterns over time.
- Cloud Storage: Stores data securely using Supabase for easy access and retrieval.
- Python 3.10: Core programming language for the app.
- Streamlit: Provides an easy-to-use interface for tracking and visualizing habits.
- Supabase: A backend-as-a-service to store and manage user data.
- pandas: Data manipulation and analysis to generate habit tracking statistics.
- numpy: Supports numerical computations for detailed habit analysis.
- pyyaml: Handles configuration settings efficiently.
- logger: Manages logging to track app activities and debugging.
- pytest: Used for testing to ensure code reliability and correctness.
- Docker: Containerizes the application for easy deployment.
git clone https://github.com/naayem/habits-tracker.git
cd habits-tracker- Install dependencies:
poetry install
- Run the application:
poetry run streamlit run app.py
-
Build the Docker image:
docker build -t habits-tracker . -
Run the Docker container:
docker run -p 8501:8501 habits-tracker
-
Access the app: Open your browser and navigate to
http://localhost:8501.
Here's an example Dockerfile that you can include in the project for reference:
# Use the official Python image as the base image
FROM python:3.10-slim
# Set the working directory in the container
WORKDIR /app
# Copy pyproject.toml and poetry.lock to the working directory
COPY pyproject.toml poetry.lock ./
# Install Poetry
RUN pip install poetry
# Install the dependencies
RUN poetry config virtualenvs.create false && poetry install --no-dev
# Copy the rest of the application code to the container
COPY . .
# Expose the port that Streamlit runs on
EXPOSE 8501
# Command to run the app
CMD ["streamlit", "run", "app.py"]Building and maintaining habits is crucial for self-improvement. This app, inspired by habit science, provides tools to track and analyze your habits, encouraging consistency and positive change.
This project is open-source and available under the MIT License.