This repository contains the Stanford 360 application. Stanford 360 is using the Spezi ecosystem and builds on top of the Stanford Spezi Template Application.
Tip
Do you want to test the Stanford 360 application on your device? You can downloard it on TestFlight.
This app is designed to support pediatric patients undergoing metabolic and bariatric surgery by promoting long-term lifestyle changes through the 60-60-60 rule (60 oz of water, 60 g of protein, and 60 minutes of physical activity daily). The app enables physical activity tracking, hydration and protein intake logging, and data visualization, with motivational feedback and reminders to encourage adherence. Unlike traditional weight-loss apps, this tool focuses on behavioral reinforcement rather than weight tracking, using FHIR-based cloud storage (Firebase) and integrating SpeziHealthKit for automated data collection. The goal is to improve compliance, enhance patient outcomes, and provide healthcare providers with insightful visualized data.
Provide a comprehensive description of your application, including figures showing the application. You can learn more on how to structure a README in the Stanford Spezi Documentation Guide
The App consists of four main screens.
The Activity module in Stanford 360 features a progress ring that tracks daily physical activity, aiming for 60 minutes. Users can log activities like Walking, Running, and Sports by selecting a date and entering active minutes. Logged activities sync with Firestore, HealthKit, and local storage. HealthKit integration converts steps into active minutes (100 steps/min), with a warning if disconnected.
The central focus is a progress ring that visually represents the user's current water intake. Below, users can quickly log their hydration using preset portion buttons, each featuring clear icons for different drink sizes. A "Log Water Intake" button ensures seamless entry, while a reset button allows users to easily correct accidental logs. Any additions or deletions will be saved to or removed from Firestore, ensuring that hydration data is securely stored and synchronized across devices. Changes will also automatically update the corresponding card in the History View, maintaining real-time accuracy in tracking.
The protein module designed to help users monitor their daily protein intake through interactive charts, milestone feedback, and AI-powered meal recognition. The app provides a visual representation of daily protein intake, displaying it through a chart and sending milestone notifications every time the intake reaches 20 grams, offering positive reinforcement to encourage healthy eating habits. Users can log their meals using two entry methods: manual entry, where they input food items and specify protein content, and picture-based entry, where they upload meal images. The backend processes these images by concurrently sending requests to two models to identify the meal name, while SpeziLLM analyzes the meal’s protein content and automatically fills in the intake data. Additionally, the app enables users to store and retrieve meal images and intake records, allowing them to track their nutrition history in detail. Future enhancements include integrating additional food databases for improved accuracy and providing personalized nutrition insights based on dietary patterns.
In addition to the specific features of each screen, we also provide essential functionalities that enhance the overall app experience and ensure seamless integration across all features.
The History feature allows users to track their complete past records for Protein, Activity, and Hydration, displayed in a card view organized by date. Users can access History separately from each view screen (Protein, Activity, and Hydration) via the top tab bar.
The Discover feature provides suggestions and educational insights for Protein, Activity, and Hydration, helping users make informed choices and build healthier habits.
The Milestone/Goal feature provides real-time progress updates and encouragement across the Protein, Activity, and Hydration views.
A goal check text is displayed in the center of each view. Before reaching 60, it will show the remaining amount needed to reach the 60-unit goal. Upon reaching 60, the text updates to display a congratulatory message.
Every 20-unit increment triggers a milestone message to encourage progress. Upon reaching 60 units, a special milestone message appears, celebrating the achievement along with the current streak day.
Note
Do you want to learn more about the Stanford Spezi Template Application and how to use, extend, and modify this application? Check out the Stanford Spezi Template Application documentation
Contributions to this project are welcome. Please make sure to read the contribution guidelines and the contributor covenant code of conduct first.
This project is licensed under the MIT License. See Licenses for more information.