Skip to content

azabcodes/steps_tracker

Repository files navigation

✅ Implemented Features

# Feature Description
1 Anonymous Authentication Implemented using Firebase Auth for easy sign-in without credentials.
2 User Profile Form User can enter and save their name and weight to Firestore.
3 Real-Time Step Tracking The app tracks footsteps live while in the foreground.
4 Firestore Integration Steps and weights are stored and updated in real time.
5 Weights List Displays all weight entries alphabetically, ordered by latest date.
6 Steps List Displays all step entries hourly, ordered by latest date.
7 Edit & Delete Entries Users can modify or remove previous weight records.
8 Sign-Out Allows users to sign out from Firebase.
9 Real-Time UI Updates Data updates automatically when Firestore changes.
10 Dark Mode Full support for dark and light themes.
11 Bilingual Support The app supports both English and Arabic, with RTL/LTR layout.
12 Background Tracking Steps tracking continues in the background (bonus).

❌ Not Implemented

# Feature Reason
1 Profile Image Upload Not implemented because Firebase Storage requires a billing-enabled account (credit card) to upload and store images.

🛠 Tech Stack

  • Framework: Flutter
  • Architecture: Clean Architecture (Data, Domain, Presentation layers)
  • State Management: Flutter BLoC
  • Dependency Injection: GetIt
  • Backend: Firebase (Auth, Firestore)
  • Local Storage: Flutter Secure Storage
  • Sensors: Pedometer, Permission Handler
  • Background Support: Flutter Background Service

📂 Project Structure

This project follows a Feature-First Clean Architecture approach:

lib/
├── src/
│   ├── core/           # Shared components (utils, network, themes, widgets)
│   ├── features/       # Feature-specific modules
│   │   ├── auth/       # Authentication (Data, Domain, Presentation)
│   │   ├── profile/    # User Profile logic
│   │   ├── steps/      # Step tracking logic
│   │   └── weights/    # Weight tracking logic
│   ├── steps_tracker/  # Application logic (Main Page, App Logic)
│   └── main.dart       # App entry point

Each feature is divided into:

  • Data: Models, Datasources, Repositories Implementation.
  • Domain: Entities, Repositories Interfaces, Usecases.
  • Presentation: BLoCs, Pages, Widgets.

⚙️ Project Configuration

Firebase Setup

This project relies on Firebase for authentication and data storage. Since sensitive configuration files are not version-controlled, you must provide your own:

  1. Create a Firebase Project at the Firebase Console.
  2. Android:
    • Register an Android app (package name: com.example.steps_tracker or check android/app/build.gradle).
    • Download google-services.json.
    • Place it in android/app/google-services.json.
  3. iOS:
    • Register an iOS app (Bundle ID: check ios/Runner.xcodeproj).
    • Download GoogleService-Info.plist.
    • Place it in ios/Runner/GoogleService-Info.plist.
  4. macOS:
    • Register a macOS app (if needed).
    • Place GoogleService-Info.plist in macos/Runner/GoogleService-Info.plist.

Note: Ensure you enable Authentication (Anonymous) and Cloud Firestore in your Firebase console.

🗄️ Firestore Database Structure

The application uses the following Firestore schema. Ensure your security rules allow read/write access to these collections for authenticated users.

users (Collection)

Stores user profile information.

  • Document ID: uid (from Firebase Authentication)
  • Fields:
    • name (String): User's display name.
    • weight (Double): User's current weight in kg.
    • photo (String): URL to profile photo (optional).
    • created_at (Timestamp): Date of account creation.

users/{uid}/weights (Subcollection)

Stores historical weight entries.

  • Document ID: Auto-generated
  • Fields:
    • weight (Double): Recorded weight value.
    • time (Timestamp): Date and time of the entry.

users/{uid}/daily_steps (Subcollection)

Stores hourly step counts.

  • Document ID: Format YYYY-MM-DD-HH (e.g., 2023-12-25-14)
  • Fields:
    • steps_count (Int): Number of steps taken in that hour.
    • time (Timestamp): Time associated with the step count.

🚀 How to Run

  1. Clone the repository:

    git clone <repository-url>
    cd steps_tracker
  2. Install dependencies:

    flutter pub get
  3. Check Permissions:

    • Android: Ensure you grant "Physical Activity" permission when prompted.
    • iOS: Ensure you check "Motion & Fitness" permissions in Info.plist (already configured, but requires simulator with motion support or real device).
  4. Run the app:

    flutter run
  5. Run Tests:

    flutter test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published