A comprehensive cross-platform sleep tracking mobile application designed to help users monitor their sleep patterns, set alarms, track weather conditions, and analyze factors affecting sleep quality. Built with Flutter, this application provides an intuitive interface for managing your sleep health with detailed statistics, personalized recommendations, and seamless alarm functionality.
-
User Authentication: Secure account system for personalized sleep tracking and data management
-
Sleep Monitoring: Record and track your sleep and wake times with comprehensive history
-
Sleep Statistics: Detailed analytics including:
- Total sleep time
- Average sleep duration
- Longest and shortest sleep sessions
- Sleep session count
- Visual data representation
-
Alarm System:
- Set custom alarms with reliable notifications
- Background alarm support using Android Alarm Manager
- Audio playback with custom alarm sounds
- Exact alarm scheduling for precise wake times
-
Weather Integration:
- Real-time weather data based on your location
- Temperature and weather condition display
- Weather-based sleep recommendations
- Location-based weather services using Geolocator
-
Sleep Factors Tracking:
- Identify and record factors that affect your sleep quality
- Personalized recommendations based on tracked factors
- Sleep quality analysis
-
Local Data Storage:
- SQLite database for offline data persistence
- Secure user data management
- Fast and reliable local storage
-
Modern UI/UX:
- Clean and intuitive Material Design interface
- Lottie animations for enhanced user experience
- Bottom navigation for easy access to all features
- Responsive design for various screen sizes
- Flutter - Cross-platform UI framework
- Dart 3.4.1+ - Programming language
- SQLite - Local database for data persistence
- Android Alarm Manager Plus - Reliable alarm scheduling
- Flutter Local Notifications - Local notification system
- Geolocator - Location services for weather
- Weather API - Real-time weather data integration
- Lottie - Beautiful animations
- Shared Preferences - Lightweight key-value storage
- Audioplayers - Audio playback for alarms
- Permission Handler - Runtime permission management
Before running this application, ensure you have:
- Flutter SDK (latest stable version) installed
- Dart SDK (comes with Flutter)
- Android Studio or VS Code with Flutter extensions
- Android SDK (for Android development)
- Xcode (for iOS development, macOS only)
- OpenWeather API Key (for weather functionality)
- Git for cloning the repository
The app requires the following permissions:
- Location (for weather services)
- Notifications (for alarms and reminders)
- Schedule Exact Alarm (for precise alarm scheduling)
- Internet (for weather API calls)
- Vibrate (for alarm notifications)
-
Clone the repository
git clone <repository-url> cd SleepWell
-
Install Flutter dependencies
flutter pub get
-
Configure API Keys
- Obtain an OpenWeather API key from OpenWeatherMap
- Add your API key to
lib/consts.dartor create an environment configuration file:const String OPENWEATHER_API_KEY = 'your_api_key_here';
-
Run the application
For Android:
flutter run
For iOS (macOS only):
flutter run -d ios
For Web:
flutter run -d chrome
-
Build release APK (Android)
flutter build apk --release
- Launch the app - You'll be greeted with an introduction screen
- Create an account - Sign up with your credentials or log in to an existing account
- Welcome screen - Complete the initial setup
- Select Sleep Factors - Choose factors that affect your sleep quality
The app features a bottom navigation bar with four main sections:
-
Statistics Tab π
- View comprehensive sleep statistics
- Track sleep patterns over time
- Monitor average sleep duration
- View longest and shortest sleep sessions
-
Clock Tab β°
- Set wake-up alarms
- Record sleep and wake times
- View sleep history
- Manage alarm settings
-
Weather Tab βοΈ
- Check current weather conditions
- View temperature and weather descriptions
- Get location-based weather data
- Understand how weather affects sleep
-
Information Tab βΉοΈ
- Learn about the app
- Access help and support
- View app version and details
-
Drawer Menu: Access from the top-left hamburger icon
- About App
- Factors Checklist
- Logout
-
Sleep Recording:
- Tap on the clock to record your sleep time
- Record wake time when you wake up
- All data is automatically saved to your local database
-
Alarm Management:
- Set alarms with custom times
- Alarms work in the background
- Receive notifications even when the app is closed
SleepWell/
βββ android/ # Android-specific files
β βββ app/
β β βββ src/
β β βββ main/
β β βββ AndroidManifest.xml
β βββ build.gradle
βββ ios/ # iOS-specific files
βββ lib/
β βββ assets/ # Lottie animations and images
β β βββ flutter_icon.png
β β βββ hour_glass.json
β β βββ jumping_location.json
β β βββ light_bulb.json
β β βββ sleeping_emoji.json
β β βββ sqlite_icon.png
β βββ JsonModels/ # Data models
β β βββ sleeping_factor.dart
β β βββ users_sleeping_factor.dart
β β βββ users.dart
β βββ screens/ # UI screens
β β βββ about_app_page.dart
β β βββ factors_page.dart
β β βββ intro_page.dart
β β βββ login.dart
β β βββ main_interface.dart
β β βββ signup.dart
β β βββ welcome_page.dart
β β βββ navigation_screens/
β β βββ clock_page.dart
β β βββ clock_view.dart
β β βββ info_page.dart
β β βββ statistics_page.dart
β β βββ weather_page.dart
β βββ SQLite/ # Database management
β β βββ sqlite_monitor.dart
β β βββ sqlite_sleep_facors.dart
β β βββ sqlite_user.dart
β βββ consts.dart # Constants and configuration
β βββ main.dart # Application entry point
βββ assets/ # Static assets
β βββ alarm.mp3 # Alarm sound
β βββ images/
β β βββ icon.png # App icon
β βββ [1-14].png # Weather icons
βββ pubspec.yaml # Flutter dependencies
βββ analysis_options.yaml # Dart analyzer options
βββ README.md
The application uses SQLite for local data storage with the following main components:
- Users Table: Stores user account information and credentials
- Sleep Monitor Table: Tracks sleep and wake times, sleep sessions
- Sleep Factors Table: Stores factors affecting sleep quality
- User Sleep Factors Table: Links users to their sleep factors
All data is stored locally on the device, ensuring privacy and offline functionality.
To use the weather feature, you need to configure your OpenWeather API key in lib/consts.dart:
const String OPENWEATHER_API_KEY = 'your_openweather_api_key';The app automatically requests necessary permissions on first launch:
- Location permission (for weather)
- Notification permission (for alarms)
- Exact alarm scheduling permission (for precise alarms)
- This application was developed as a comprehensive sleep tracking solution
- All user data is stored locally using SQLite - no data is sent to external servers (except weather API calls)
- The app requires location permissions for weather features but respects user privacy
- Alarm functionality works reliably in the background using Android Alarm Manager Plus
- The application has been validated for performance and functionality
-
Weather not loading:
- Ensure you have a valid OpenWeather API key
- Check that location permissions are granted
- Verify internet connectivity
-
Alarm not working:
- Grant notification permissions when prompted
- Grant "Schedule Exact Alarm" permission
- Ensure the app is not force-stopped
-
Database errors:
- Clear app data and reinstall if database becomes corrupted
- Ensure sufficient storage space on device
Potential features for future versions:
- Cloud synchronization for sleep data
- Advanced sleep analysis with AI insights
- Integration with fitness trackers
- Sleep quality scoring algorithm
- Customizable alarm sounds
- Sleep goal setting and tracking
Reno-03 and Rafael Antonio Uy
This project is developed for educational and personal use. All rights reserved.
- Flutter team for the amazing framework
- OpenWeatherMap for weather API services
- All contributors to the open-source packages used in this project
Sleep Well, Live Well π΄β¨
