Cross-platform mobile application for real-time water quality monitoring system, powered by Telkomsel
- Overview
- Features
- Tech Stack
- Prerequisites
- Installation
- Configuration
- Running the Application
- Project Structure
- API Documentation
- Building for Production
- Testing
- Contributing
- License
HydroConnect is a cross-platform mobile application built with React Native and Expo that provides real-time monitoring of water quality systems. The application interfaces with IoT sensors to display water quality metrics, system health status, and provides comprehensive reporting capabilities.
- Real-time Monitoring: Live data streaming via Socket.IO for water quality parameters
- Multi-platform Support: Runs on iOS, Android, and Web with a single codebase
- Offline Capability: Local caching and state management for offline operation
- Push Notifications: Firebase Cloud Messaging integration for alerts
- Data Export: Generate and download water quality reports
- Onboarding Flow: User-friendly introduction for first-time users
- 📊 Real-time Dashboard: Monitor pH, TDS, turbidity, and system status
- 📈 Historical Data: View trends and patterns in water quality over time
- 🔔 Push Notifications: Receive alerts for critical water quality changes
- 📥 Report Downloads: Export water quality data as reports
- 📚 User Guide: Comprehensive in-app documentation
- Type Safety: Full TypeScript implementation
- State Management: Context API for global state
- Real-time Communication: Socket.IO client integration
- Gesture Support: React Native Gesture Handler and Reanimated
- Haptic Feedback: Native haptic responses for enhanced UX
- Network Status: Automatic connection monitoring and offline handling
- Expo - v54.0.22
- React Native - v0.81.5
- React - v19.1.0
- TypeScript - v5.9.2
- NativeWind - Tailwind CSS for React Native
- Expo Linear Gradient
- Lucide React Native - Icon library
- React Native SVG
- Expo Router - File-based routing
- React Navigation - Navigation primitives
- React Context API - Global state management
- AsyncStorage - Local storage
- Socket.IO Client - Real-time communication
- Expo Notifications - Push notifications
- Firebase - Cloud Messaging & Analytics
- Expo Haptics - Haptic feedback
- NetInfo - Network status monitoring
- Bottom Sheet - Modal bottom sheets
- Toast Message - Toast notifications
- Shimmer Placeholder - Loading skeletons
- Popover View - Tooltips & popovers
Before you begin, ensure you have the following installed:
- Node.js >= 18.x
- npm >= 9.x or yarn >= 1.22.x
- Expo CLI (installed globally or use
npx) - Git
- macOS with Xcode 14+ (for iOS simulator)
- CocoaPods (installed via
brew install cocoapods)
- Android Studio with Android SDK
- Java Development Kit (JDK) 11 or higher
- Expo Go App (for quick testing on physical devices)
-
Clone the repository
git clone <repository-url> cd hydroconnect_2/frontend
-
Install dependencies
npm install
-
Install Expo CLI globally (optional but recommended)
npm install -g expo-cli
-
Set up environment variables (see Configuration)
Create or modify necessary configuration files:
lib/constants.ts - Update environment-specific constants:
export const ENVIRONMENT_STATUS = "DEVELOPMENT" | "PRODUCTION";
export const API_BASE_URL = "your-api-endpoint";
export const SOCKET_URL = "your-socket-endpoint";- Download
google-services.jsonfrom Firebase Console - Place it in the project root directory
- Ensure it's referenced in
app.json:{ "android": { "googleServicesFile": "./google-services.json" } }
Review and update app.json for your specific needs:
- App name and slug
- Bundle identifiers (iOS & Android)
- Splash screen and icons
- Permissions and plugins
For production builds, configure eas.json:
npx eas-cli login
npx eas build:configureStart the Expo development server:
npm start
# or
npx expo startThis will open the Expo DevTools in your browser with options to:
- Press
a- Open on Android emulator/device - Press
i- Open on iOS simulator - Press
w- Open in web browser - Scan QR code with Expo Go app
Android:
npm run android
# or
npx expo run:androidiOS: (macOS only)
npm run ios
# or
npx expo run:iosWeb:
npm run web
# or
npx expo start --webLinting:
npm run lintClear Cache:
npx expo start -cfrontend/
├── app/ # Expo Router pages (file-based routing)
│ ├── _layout.tsx # Root layout
│ ├── index.tsx # Entry point / Splash screen
│ ├── globals.css # Global styles
│ ├── ApiTest.tsx # Development API testing (exclude from prod)
│ ├── (tabs)/ # Main tab navigation
│ │ ├── home/ # Home dashboard
│ │ ├── informasi/ # Information section
│ │ └── panduan/ # User guide
│ ├── (details)/ # Detail pages
│ │ ├── about-us/ # About page
│ │ ├── water-quality/ # Water quality details
│ │ └── system-quality/ # System health details
│ └── onboarding/ # Onboarding flow
│ ├── onboarding1.tsx
│ ├── onboarding2.tsx
│ └── onboarding3.tsx
├── src/
│ ├── components/ # Reusable UI components
│ │ ├── Button.tsx
│ │ ├── QualityCard.tsx
│ │ ├── StatusPill.tsx
│ │ ├── ToastStack.tsx
│ │ ├── Tooltip.tsx
│ │ └── ...
│ └── modules/ # Feature-specific modules
│ ├── (tabs)/ # Tab-specific components
│ ├── (details)/ # Detail page components
│ └── onboarding/ # Onboarding components
├── lib/ # Core logic & utilities
│ ├── constants.ts # App-wide constants
│ ├── globals.ts # Global configurations
│ ├── utils.ts # Utility functions
│ ├── io.ts # Socket.IO client setup
│ ├── rest.ts # REST API client
│ ├── notifications.ts # Push notification logic
│ ├── downloadReports.ts # Report generation
│ ├── errorHandler.ts # Error handling utilities
│ ├── chemFormula.ts # Chemistry calculations
│ └── contexts/ # React Context providers
│ ├── connectionCTX.ts # Connection state
│ ├── readingCTX.ts # Sensor readings
│ ├── summariesCTX.ts # Data summaries
│ └── downloadProgressCTX.ts
├── schemas/ # TypeScript interfaces & schemas
│ ├── readings.ts
│ ├── summaries.ts
│ ├── downloadRequest.ts
│ ├── downloadProgress.ts
│ ├── usageNotification.ts
│ └── panduanData.ts
├── assets/ # Static assets
│ ├── fonts/ # Custom fonts
│ ├── images/ # Images & icons
│ └── sounds/ # Audio files
├── app.json # Expo configuration
├── package.json # Dependencies & scripts
├── tsconfig.json # TypeScript configuration
├── tailwind.config.js # Tailwind CSS configuration
├── metro.config.js # Metro bundler configuration
├── babel.config.js # Babel configuration
├── eas.json # EAS Build configuration
└── README.md # This file
For detailed API documentation including:
- Frontend schemas
- Context providers
- Socket.IO event handlers
- REST API utilities
- Download logic
See APIDocs.md in the project root.
Socket.IO Events:
connect- Connection establishedreadings- Real-time sensor datasummaries- Aggregated statisticsdownload-progress- Download status updates
REST Endpoints: See backend API documentation for complete endpoint reference.
-
Configure EAS:
npx eas build:configure
-
Build for Android:
npx eas build --platform android
-
Build for iOS:
npx eas build --platform ios
-
Build for both platforms:
npx eas build --platform all
Android APK:
npx expo build:android -t apkiOS IPA:
npx expo build:ios -t archive- Update version in
app.jsonandpackage.json - Set
ENVIRONMENT_STATUS = "PRODUCTION"in constants - Remove or comment out
ApiTest.tsxroute - Test on physical devices
- Verify Firebase configuration
- Update app icons and splash screens
- Review and test push notifications
- Check API endpoints configuration
The app includes a development-only API testing page:
// Access via direct navigation in development mode
router.push("/ApiTest");ApiTest.tsx from production builds.
- Real-time data streaming (Socket.IO)
- Offline mode and reconnection
- Push notifications
- Report downloads
- Navigation flows
- Network error handling
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name
- Make your changes and commit:
git commit -m "feat: add your feature description" - Push to your branch:
git push origin feature/your-feature-name
- Open a Pull Request
We follow Conventional Commits:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding testschore:- Maintenance tasks
- Follow TypeScript best practices
- Use ESLint configuration provided
- Format with Prettier
- Write meaningful commit messages
- Add JSDoc comments for complex functions
This project is proprietary and confidential. Unauthorized copying, distribution, or use is strictly prohibited.
For questions, issues, or support:
- Create an issue in the repository
- Contact the development team
- Review the API Documentation
Built with:
- Expo - Universal React framework
- React Native - Mobile app framework
- TypeScript - Type safety
- Socket.IO - Real-time communication
- Firebase - Push notifications
Made with ❤️ for HydroConnect
Version 1.0.0 | Last Updated: January 2026