A comprehensive bike security and monitoring system that combines IoT sensors, Bluetooth connectivity, and mobile technology to keep your bike safe and monitored.
- Overview
- Features
- Architecture
- Prerequisites
- Installation
- Configuration
- Usage
- API Documentation
- Development
- Contributing
- License
BikeSafe is an intelligent bike security system that provides real-time monitoring, theft alerts, and environmental tracking for your bicycle. The system consists of:
- Flutter Mobile App: Cross-platform mobile application for iOS and Android
- Node.js Backend: RESTful API server with MongoDB database
- IoT Integration: ESP32-based sensors for real-time data collection
- Bluetooth Connectivity: Seamless communication between sensors and mobile device
- User Registration & Login: Secure account creation with email verification
- Google OAuth Integration: Quick sign-in with Google accounts
- Password Reset: Secure password recovery via email
- JWT Token Authentication: Secure API access
- Real-time Sensor Monitoring: Live data from temperature, humidity, GPS, and motion sensors
- Bluetooth Device Management: Connect and manage ESP32/Arduino devices
- Interactive Maps: Google Maps integration for location tracking
- Push Notifications: Real-time alerts for security events
- Battery Monitoring: Track bike battery status and history
- Dark/Light Theme: Customizable app appearance
- Admin Panel: Administrative features for user management
- RESTful API: Comprehensive API for all app functions
- Database Management: MongoDB integration for data persistence
- Email Services: SendGrid integration for notifications
- Firebase Integration: Push notification support
- Location Services: GPS tracking and geofencing
- Sensor Data Processing: Real-time IoT data handling
- ESP32 Integration: Support for ESP32-based sensor modules
- Bluetooth Serial Communication: Reliable data transmission
- Multiple Sensor Support: Temperature, humidity, GPS, motion detection
- Real-time Data Streaming: Live sensor data updates
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Flutter App βββββΊβ Node.js API βββββΊβ MongoDB β
β β β β β Database β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β ESP32 Sensors β β Firebase FCM β
β (via Bluetooth) β β (Push Notifications)β
βββββββββββββββββββ βββββββββββββββββββ
- Flutter SDK: ^3.6.0
- Dart: Latest stable version
- Android Studio: For Android development
- Xcode: For iOS development (macOS only)
- Node.js: v16.0 or higher
- MongoDB: v4.4 or higher
- npm: v8.0 or higher
- Google Cloud Console: For OAuth and Maps API
- Firebase: For push notifications
- SendGrid: For email services
git clone https://github.com/liavjulio/bikesafe.git
cd bikesafecd bikesafe-backend
npm install
# Copy and configure environment variables
cp .env.example .env
# Edit .env with your configuration
# Start the server
npm startcd bikesafe_app
# Install Flutter dependencies
flutter pub get
# Run the app
flutter run# Database
MONGODB_URI=mongodb://localhost:27017/bikesafe
JWT_SECRET=your-jwt-secret-key
# Google OAuth
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# SendGrid Email
SENDGRID_API_KEY=your-sendgrid-api-key
FROM_EMAIL=noreply@bikesafe.com
# Firebase
FIREBASE_ADMIN_SDK_PATH=./bike-safe-24118-e2932191e023.json
# Server
PORT=3000
NODE_ENV=development-
Google Services Setup:
- Place
google-services.jsoninandroid/app/ - Configure
GoogleService-Info.plistfor iOS
- Place
-
API Configuration:
- Update
lib/utils/constants.dartwith your backend URL
- Update
-
Maps API:
- Add your Google Maps API key to
android/app/src/main/AndroidManifest.xml
- Add your Google Maps API key to
-
Register an Account:
- Open the app and tap "Register"
- Enter your email and create a password
- Or use "Login with Google" for quick access
-
Connect Your Bike Sensor:
- Ensure your ESP32 device is paired via Bluetooth
- Go to the main screen and select your device
- Tap "Connect" to establish communication
-
Monitor Your Bike:
- View real-time sensor data on the dashboard
- Check battery levels and environmental conditions
- Receive alerts for unusual activity
- Temperature & Humidity: Environmental conditions
- GPS Tracking: Live location updates
- Battery Status: Power level monitoring
- Motion Detection: Security alerts
- Interactive Maps: Visual location tracking
- Geofencing: Custom alert zones
- Route History: Track your rides
- Security Alerts: Immediate theft notifications
- Battery Warnings: Low power alerts
- System Updates: App and sensor status
POST /auth/register
POST /auth/login
POST /auth/google-login
POST /auth/forgot-password
POST /auth/reset-passwordGET /sensor/data/:userId
POST /sensor/update
GET /sensor/history/:userIdPOST /location/update
GET /location/history/:userIdGET /user/profile
PUT /user/profile
DELETE /user/accountFor detailed API documentation, see API_DOCS.md.
bikesafe/
βββ bikesafe_app/ # Flutter mobile application
β βββ lib/
β β βββ screens/ # UI screens
β β βββ services/ # Business logic services
β β βββ utils/ # Utility functions
β βββ android/ # Android-specific files
β βββ ios/ # iOS-specific files
β βββ assets/ # Images and resources
βββ bikesafe-backend/ # Node.js API server
β βββ controllers/ # Route controllers
β βββ models/ # Database models
β βββ routes/ # API routes
β βββ middleware/ # Express middleware
β βββ utils/ # Utility functions
βββ README.md
# Start development server
npm start
# Run tests
npm test
# Build for production
npm run build# Run on Android
flutter run -d android
# Run on iOS
flutter run -d ios
# Build APK
flutter build apk
# Build iOS
flutter build iosThe system supports ESP32-based sensors with the following capabilities:
- Bluetooth Serial Communication: RFCOMM protocol
- Multi-sensor Support: Temperature, humidity, GPS, accelerometer
- Real-time Data Streaming: JSON-formatted sensor data
- Low Power Mode: Battery optimization features
{
"temperature": 25.5,
"humidity": 60.2,
"latitude": 40.7128,
"longitude": -74.0060,
"speed": 15.3,
"altitude": 10.2,
"satellites": 8,
"time": "12:34:56"
}# Backend tests
cd bikesafe-backend
npm test
# Flutter widget tests
cd bikesafe_app
flutter test
# Integration tests
flutter test integration_test/We welcome contributions to BikeSafe! Please follow these steps:
- Fork the Repository
- Create a Feature Branch:
git checkout -b feature/your-feature-name - Make Your Changes: Follow our coding standards
- Test Your Changes: Ensure all tests pass
- Submit a Pull Request: Describe your changes clearly
- Flutter: Follow Dart style guide
- Node.js: Use ESLint configuration provided
- Git Commits: Use conventional commit format
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check this README and inline code comments
- Issues: Report bugs via GitHub Issues
- Discussions: Join our community discussions
The app includes a built-in help system with guides for:
- Registration and login
- Device pairing and connection
- Monitoring features
- Alert management
- Troubleshooting
For technical support or questions:
- Email: support@bikesafe.com
- GitHub Issues: Report a bug
Made with β€οΈ for cyclists everywhere
