SafeChild is a smart-nursery solution that combines a Flutter mobile application, Firebase backend services, and ESP32-based connected hardware (smart plush, baby-cry gateway) to keep parents informed about their child's environment in real time.
The app monitors temperature, humidity, gas levels, ambient light, motion, and baby-cry detection (TinyML on the ESP32), then sends prioritised alerts and notifications to caregivers.
- Real-time sensor monitoring (BME280 environmental sensor, MQ-2 gas sensor, LDR ambient light, motion).
- Baby-cry detection running on-device (TFLite/ONNX model on ESP32).
- Cloud sync and push notifications via Firebase Auth, Firestore, and FCM.
- Bluetooth Low Energy (BLE) pairing flow to provision Wi-Fi credentials to the device without exposing them.
- MQTT-based local communication between the cry-detection node and the gateway.
- Internationalisation (FR / EN / AR) via
flutter_localizations. - Beautiful Material 3 UI with Google Fonts and adaptive launcher icons.
SafeChild/
├── lib/ # Flutter application source code
│ ├── core/services/ # Firebase, MQTT, BLE services
│ ├── features/ # Feature-based screens (login, pairing, settings, ...)
│ └── l10n/ # Localisations (fr, en, ar)
├── assets/ # Images and other Flutter assets
├── android/ ios/ web/ # Flutter platform projects
├── linux/ macos/ windows/ # Flutter desktop projects
├── functions/ # Firebase Cloud Functions (Node.js)
├── hardware/ # ESP32 firmware (Arduino IDE)
│ ├── 2emeCartebabycry/ # Smart-plush firmware (sensors + Firebase)
│ └── BabyCryGateway/ # MQTT gateway firmware
├── safechild_pairing/ # Standalone pairing sketch (BLE provisioning)
├── docs/ # Project documentation
└── test/ # Flutter unit / widget tests
| Layer | Tooling |
|---|---|
| Mobile | Flutter ^3.11, Dart, Material 3, google_fonts |
| Auth & data | firebase_core, firebase_auth, cloud_firestore, firebase_messaging |
| Local notifs | flutter_local_notifications |
| Connectivity | flutter_blue_plus, connectivity_plus, wifi_scan |
| Backend | Firebase Cloud Functions (Node.js) |
| Hardware | ESP32 + Arduino IDE, BME280, MQ-2, LDR, servos, MQTT (PubSubClient) |
| ML | TensorFlow Lite / ONNX cry-detection model |
- Flutter SDK
^3.11.0(flutter --version) - Dart SDK (bundled with Flutter)
- Android Studio / Xcode for mobile builds
- Node.js 18+ and Firebase CLI (
npm i -g firebase-tools) for Cloud Functions - Arduino IDE 2.x with the ESP32 board package, plus libraries:
Firebase ESP Client(mobizt)PubSubClientArduinoJsonAdafruit BME280ESP32Servo
git clone https://github.com/<your-user>/SafeChild.git
cd SafeChild
flutter pub getYou also need to provide your own Firebase configuration (these files are gitignored):
android/app/google-services.jsonios/Runner/GoogleService-Info.plistserviceAccount.json(server-side admin operations only — never commit it)
Then run:
flutter runcd functions
npm install
firebase deploy --only functions- Open
hardware/2emeCartebabycry/2emeCartebabycry.inoin Arduino IDE. - Select the ESP32 board and the correct serial port.
- Update
mqtt_server(line 36) to the IP of your MQTT broker on the local LAN. - Wi-Fi credentials are provisioned over BLE at first boot (via the app's pairing screen) — no need to hard-code them.
- Upload the sketch.
- Repeat with
hardware/BabyCryGateway/BabyCryGateway.inofor the gateway node.
serviceAccount.json,google-services.json,GoogleService-Info.plist, and.firebasercare gitignored. They contain identifiers / private keys specific to your Firebase project.- The Firebase Web API key embedded in
2emeCartebabycry.inois safe to ship (it identifies the project, not a secret), provided your Firestore Security Rules are properly configured. - Wi-Fi credentials are sent over BLE during pairing and stored in the ESP32's NVS — they are never written to source code.
This project is provided for educational and demonstration purposes as part of a graduation project. Choose a license (MIT, Apache-2.0, ...) that matches your use-case before publishing further.
Adem Aboueb — ESPRIT, 2026