Skip to content

omimouni/habit-tracker

Repository files navigation

Habit Tracker

A simple habit tracker built with Laravel and Livewire.

Screenshots

Habit Tracker Habit Tracker Habit Tracker

Installation

  1. Clone the repository:

    git clone https://github.com/omimouni/habit-tracker.git
    cd habit-tracker
  2. Install PHP dependencies:

    composer install
  3. Install Node dependencies:

    npm install
  4. Set up environment:

    cp .env.example .env
    # Configure your database settings in .env

4a. Set up Google OAuth credentials:

  • Go to the Google Cloud Console
  • Create a new project or select existing one
  • Enable the Google+ API
  • Go to Credentials and create OAuth 2.0 Client ID
  • Add authorized redirect URI: http://localhost:8000/auth/google/callback
  • Copy Client ID and Client Secret
  • Add to your .env file:
    GOOGLE_CLIENT_ID=your_client_id_here
    GOOGLE_CLIENT_SECRET=your_client_secret_here
    GOOGLE_REDIRECT_URI=http://localhost:8000/auth/google/callback
  1. Generate application key:

    php artisan key:generate
  2. Run database migrations:

    php artisan migrate
  3. Start development servers:

    # In first terminal:
    npm run dev
    
    # In second terminal:
    php artisan serve

Your application should now be running at http://localhost:8000

Features

  • Create and manage habits
  • Track daily habit completions
  • User authentication and profiles
  • Responsive mobile design
  • Dark/Light theme toggle
  • Organize habits into categories
  • View habit streaks and progress statistics

Google Analytics

To enable Google Analytics tracking:

  1. Create a Google Analytics 4 property in your Google Analytics account

  2. Get your Measurement ID (starts with G-)

  3. Add these variables to your .env file:

    GOOGLE_ANALYTICS_ID=your_measurement_id
    GOOGLE_ANALYTICS_ENABLED=true

The tracking code will be automatically included in the base layout when enabled. You can verify it's working by checking your Google Analytics real-time reports.

Note: Analytics are only included in production environments when GOOGLE_ANALYTICS_ENABLED is set to true.

About

A simple habit tracker built with Laravel and Livewire.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published