Skip to content

JoaoCoelho2003/SA-FitSense

Repository files navigation

🏋️‍♂️ Exercise Recognition App

A React Native app that uses motion sensor data to recognize physical exercises using a trained machine learning model. It allows users to start and stop workout sessions, processes the collected data, predicts the exercise being performed, and stores all session information in Firebase.


📚 Table of Contents


🧠 About the Project

This mobile application aims to provide a smooth experience for users who want to track their workouts automatically. By collecting sensor data from mobile devices, the app predicts the type of exercise being performed using a hybrid 1D CNN-LSTM model trained on the PAMAP2 dataset (for now).


✨ Features

  • Start/Stop exercise sessions
  • Live prediction of performed exercise
  • Firebase Authentication for user management
  • Cloud-based ML inference with Firebase Functions
  • Logs exercise history and statistics
  • Data stored securely in Firestore

🏗 Architecture

The system is composed of a React Native frontend and a Firebase backend that handles authentication, model inference, and data storage.

Architecture Diagram

Click to view architecture description

📱 Frontend – React Native App

  • Allows the user to start and stop an exercise session.
  • Collects sensor data.
  • Sends sensor data to the backend for prediction.
  • Displays the predicted exercise to the user.
  • Manages login and authentication.

🔧 Backend – Firebase

🔐 Firebase Authentication

  • Manages user credentials and provides auth tokens.

⚙️ Firebase Cloud Run - Deployed API

  • Loads the ML model.
  • Predicts the exercise from sensor data.
  • Sends prediction to app and stores result.

🧠 Firebase Cloud Storage

  • Stores the trained machine learning model.

🗃 Firestore Database

  • Stores:
    • Exercise predictions
    • User metadata
    • Session logs
    • Badge information
    • User statistics
    • Feedback from users

🛠 Tech Stack

  • React Native (Expo)
  • Firebase (Authentication, Firestore, Cloud Storage)
  • Python for model training
  • PyTorch for the ML model
  • mHealth dataset for training

🚀 Getting Started

Prerequisites

  • Node.js and npm
  • Expo CLI (npm install -g expo-cli)
  • Firebase project with:
    • Authentication enabled
    • Firestore and Storage configured

Setup

  1. Clone the repository:

    git clone https://github.com/JoaoCoelho2003/SA-FitSense.git
    cd SA-FitSense
  2. Go to the frontend folder:

    cd frontend
  3. Install dependencies:

     npm install
  4. Set up your Firebase config in the app.

  5. Start the app:

    expo start

About

Repository for the SA course project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors