A simple habit tracker built with Laravel and Livewire.
-
Clone the repository:
git clone https://github.com/omimouni/habit-tracker.git cd habit-tracker
-
Install PHP dependencies:
composer install
-
Install Node dependencies:
npm install
-
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
-
Generate application key:
php artisan key:generate
-
Run database migrations:
php artisan migrate
-
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
- 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
To enable Google Analytics tracking:
-
Create a Google Analytics 4 property in your Google Analytics account
-
Get your Measurement ID (starts with G-)
-
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.