A modern JavaFX desktop application to build habits, manage daily tasks, journal your thoughts, and analyze productivity through visual insights.
Features • Installation • Usage • Project Structure • Future Scope
Habit Tracker is a feature-rich desktop productivity application designed to help users:
- Build and maintain positive habits
- Manage daily tasks efficiently
- Reflect through journaling
- Track progress using analytics, charts, and heatmaps
The application follows a clean MVC architecture, supports light/dark themes, and ensures data persistence using JSON files.
- ✨ Modern, minimal UI with JavaFX
- 📊 Analytics dashboard with charts & heatmap
- 🔄 Automatic streak calculation
- 📝 Built-in journaling
- 💾 Persistent data storage (JSON)
- 🌙 Light / Dark theme toggle
- Create custom habits (Daily / Weekly / Monthly)
- Weekly and monthly progress tracking
- Automatic current & longest streak calculation
- Activity heatmap visualization
- Delete habits anytime
- Add daily tasks
- Mark tasks as completed
- Optional task notes
- Daily auto-reset logic
- Completion statistics
- Write daily journal entries
- Edit & delete entries
- View history with timestamps
- Keyword search support
- Completion trend line charts
- Year-wide activity heatmap
- Most & least consistent habits
- Performance statistics
- Light & Dark themes
- Clean, responsive layout
- Intuitive navigation
- Smooth transitions
| Technology | Version | Purpose |
|---|---|---|
| Java | 11 | Core programming language |
| JavaFX | 17.0.6 | Desktop UI framework |
| Maven | 3.8+ | Build & dependency management |
| Gson | 2.10.1 | JSON serialization |
| FXML | – | UI layout |
| CSS | – | Styling & theming |
HabitTracker/
├── src/
│ └── main/
│ ├── java/
│ │ └── com/
│ │ └── habittracker/
│ │ ├── app/
│ │ │ ├── AppLauncher.java
│ │ │ ├── Main.java
│ │ │ └── SceneManager.java
│ │ │
│ │ ├── ui/
│ │ │ ├── LoginUIController.java
│ │ │ ├── DashboardUIController.java
│ │ │ ├── HabitUIController.java
│ │ │ ├── TaskUIController.java
│ │ │ ├── JournalUIController.java
│ │ │ └── AnalyticsUIController.java
│ │ │
│ │ ├── controllers/
│ │ │ ├── LoginController.java
│ │ │ ├── DashboardController.java
│ │ │ ├── HabitController.java
│ │ │ ├── TaskController.java
│ │ │ ├── JournalController.java
│ │ │ └── AnalyticsController.java
│ │ │
│ │ ├── models/
│ │ │ ├── habits/
│ │ │ │ ├── Habit.java
│ │ │ │ ├── HabitRecord.java
│ │ │ │ └── Frequency.java
│ │ │ ├── tasks/
│ │ │ │ └── Task.java
│ │ │ ├── journal/
│ │ │ │ └── JournalEntry.java
│ │ │ ├── analytics/
│ │ │ │ └── HabitStats.java
│ │ │ └── user/
│ │ │ └── User.java
│ │ │
│ │ ├── services/
│ │ │ ├── UserService.java
│ │ │ ├── HabitService.java
│ │ │ ├── TaskService.java
│ │ │ ├── JournalService.java
│ │ │ ├── AnalyticsService.java
│ │ │ ├── ThemeService.java
│ │ │ └── DataStore.java
│ │ │
│ │ └── utils/
│ │ ├── DateUtils.java
│ │ ├── FileUtils.java
│ │ └── LocalDateAdapter.java
│ │
│ └── resources/
│ ├── fxml/
│ │ ├── login.fxml
│ │ ├── dashboard.fxml
│ │ ├── habits.fxml
│ │ ├── tasks.fxml
│ │ ├── journal.fxml
│ │ └── analytics.fxml
│ │
│ ├── css/
│ │ ├── light.css
│ │ └── dark.css
│ │
│ └── data/
│ ├── habits.json
│ ├── tasks.json
│ ├── journal.json
│ └── settings.json
│
├── data/
├── logs/
├── target/
├── pom.xml
└── README.md
The application follows MVC (Model–View–Controller):
- Models → Plain data objects
- Views → JavaFX FXML layouts
- Controllers → Handle user interactions
- Services → Business logic & persistence
- Utils → Helper classes
This ensures clean separation of concerns and scalability.
- Java JDK 11+
java -version
Apache Maven 3.8+
bash Copy code mvn -version Internet connection (for first Maven build)
🚀 Installation 1️⃣ Clone the Repository bash Copy code git clone https://github.com//HabitTracker.git cd HabitTracker 2️⃣ Build the Project bash Copy code mvn clean compile
mvn clean package
--add-modules javafx.controls,javafx.fxml
-cp target/classes com.habittracker.app.AppLauncher
Option 3 – Run Packaged JAR
bash
Copy code
mvn clean package
java -jar target/habit-tracker-1.0-SNAPSHOT.jar
📖 Usage Guide
1️⃣ Login
Launch the app
Sign up with a username & password
Log in to access the dashboard
2️⃣ Dashboard Overview of habits, tasks, and journals
Quick navigation to all modules
3️⃣ Habits Add habits with frequency
Mark daily/weekly completion
Track streaks & heatmap activity
Delete habits
4️⃣ Tasks Add daily tasks
Mark completed
Auto-reset next day
5️⃣ Journal Write & save entries
Edit or delete past entries
View history
6️⃣ Analytics View charts & heatmaps
Track consistency & trends
7️⃣ Theme Toggle Switch between Light & Dark mode anytime
💼 Applications & Use Cases Personal Fitness, reading, meditation, coding habits
Daily planning & reflection
Professional Skill development tracking
Work routine consistency
Educational Study habit tracking
Learning journals
🔮 Future Scope Analytics Export reports (PDF / CSV)
Custom date-range analytics
Habits & Tasks Custom recurrence patterns
Categories & tags
Reminders & notifications
Task priorities & subtasks
Journal Rich text editor
Mood tracking
Export journal
Data & Integrations Database (SQLite / PostgreSQL)
Cloud sync & backup
REST API
Mobile / Web version
🤝 Contributing Contributions are welcome!
bash Copy code git checkout -b feature/amazing-feature git commit -m "Add amazing feature" git push origin feature/amazing-feature Open a Pull Request 🚀
👨💻 Author Habit Tracker – JavaFX Desktop Application
GitHub: https://github.com//HabitTracker
⭐ If you like this project, consider starring the repository! ⭐