Skip to content

A habit tracking application built with Swift and Firebase. This app helps users create, manage, and track the completion of their daily habits while providing a seamless user experience.

Notifications You must be signed in to change notification settings

sala7khaled/habit-tracker

Repository files navigation

Habit Tracker

A habit tracking application built with Swift and Firebase. This app helps users create, manage, and track the completion of their daily habits while providing a seamless user experience.


Features

  • Create Habits: Add new habits with a unique title.
  • Track Progress: Mark habits as completed for specific dates.
  • View Habits: Display a list of all habits sorted alphabetically.
  • Habit Status: Indicate completed and incomplete habits visually.
  • Swipe to Delete: Remove habits with a swipe gesture.
  • Firebase Integration: All data is stored and managed using Firebase Realtime Database.

Screen recording

Screen.Recording.2025-01-12.at.8.28.05.PM.mov

Screenshots

Splash Username Habits Date Add Habit

Code Highlights

FirebaseManager

Centralized class to handle all Firebase operations, including:

  • Adding habits
  • Fetching all habits
  • Completing habits
  • Deleting habits

Example

FirebaseManager.shared.addHabit(habitTitle: "Exercise") { error in
    if let error = error {
        print("Failed to add habit: \(error)")
    } else {
        print("Habit added successfully")
    }
}

Data Structure

users
  └── userId
       ├── habits
       │     ├── habitId
       │     │     ├── name: "Running"
       │     │     └── ...
       └── progress
             ├── DD-MM-YYYY
             │     ├── habitId1: true
             │     ├── habitId2: false
             └     └── ...

Contact

Created by Salah Khaled. Feel free to reach out for collaboration.

About

A habit tracking application built with Swift and Firebase. This app helps users create, manage, and track the completion of their daily habits while providing a seamless user experience.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published