Skip to content

HomeControl is an IoT project that lets me control home devices from my phone using a React Native app. It uses an ESP32 with Arduino code, a Java + MySQL backend for activity tracking and helps automate daily tasks efficiently.

Notifications You must be signed in to change notification settings

gitxar7/HomeControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HomeControl - Smart Home Automation System

HomeControl Logo

A full-stack IoT home automation system with cross-platform mobile app, REST API backend, and ESP32 integration

React Native Expo Java Arduino Hibernate MySQL

Table of Contents

Overview

HomeControl is a comprehensive IoT-based home automation system that demonstrates proficiency in full-stack development, mobile app development, IoT programming, and system architecture. The project showcases integration between mobile applications, web services, databases, and hardware devices.

Key Highlights:

  • Cross-platform mobile app built with React Native & Expo
  • RESTful API backend with Java servlets and Hibernate ORM
  • ESP32-based IoT device control via WiFi
  • Real-time device status tracking and history logging
  • Modern UI/UX with gradient designs and smooth animations

Features

Mobile Application

  • Secure Authentication - Login system with password visibility toggle
  • Device Control Interface - Intuitive controls for smart home devices
  • Real-time Status Updates - Live device status monitoring
  • History Tracking - Complete log of device state changes
  • Responsive Design - Optimized for both iOS and Android platforms

Backend Services

  • RESTful API - Clean API endpoints for device management
  • Database Integration - Hibernate ORM with MySQL database
  • Session Management - Secure user session handling
  • Device Status Logging - Comprehensive activity tracking
  • JSON Response Format - Standardized API responses

IoT Hardware Control

  • WiFi Connectivity - ESP32-based device networking
  • Real-time Control - Instant device response via HTTP requests
  • Multi-device Support - Control multiple connected devices
  • Status Feedback - Device state confirmation and reporting

Architecture

┌─────────────────┐    HTTP/REST    ┌─────────────────┐    JDBC    ┌─────────────────┐
│                 │    Requests     │                 │ Hibernate  │                 │
│  React Native   │◄───────────────►│  Java Servlet   │◄──────────►│   MySQL DB      │
│   Mobile App    │                 │    Backend      │            │                 │
│                 │                 │                 │            │                 │
└─────────────────┘                 └─────────────────┘            └─────────────────┘
                                              │
                                              │ HTTP Requests
                                              ▼
                                    ┌─────────────────┐
                                    │                 │
                                    │   ESP32 IoT     │
                                    │    Devices      │
                                    │                 │
                                    └─────────────────┘

Tech Stack

Frontend (Mobile App)

  • React Native - Cross-platform mobile development
  • Expo - Development platform and build tools
  • Expo Router - File-based navigation system
  • Vector Icons - FontAwesome icon library
  • Linear Gradient - Modern UI styling
  • FlashList - High-performance lists

Backend (API Server)

  • Java - Core programming language
  • Servlet API - HTTP request handling
  • Hibernate ORM - Database abstraction layer
  • MySQL - Relational database management
  • Gson - JSON serialization/deserialization
  • Apache Ant - Build automation

IoT Hardware

  • ESP32 - WiFi-enabled microcontroller
  • Arduino IDE - Development environment
  • C/C++ - Embedded programming language

Development Tools

  • NetBeans IDE - Java development environment
  • VS Code - Code editing and debugging
  • Git - Version control system

Mobile App

The mobile application provides an intuitive interface for controlling smart home devices:

Key Components:

  • Authentication Screen (index.js) - Secure login with animated UI
  • Home Dashboard (home.js) - Device overview and quick controls
  • Device Controls (controls.js) - Detailed device management interface

Features:

  • Secure pin-based authentication with visibility toggle
  • Beautiful gradient UI with smooth animations
  • Real-time device status updates
  • Responsive design for all screen sizes
  • Fast navigation with Expo Router

Backend API

RESTful API built with Java servlets providing comprehensive device management:

Endpoints:

  • POST /LogIn - User authentication
  • GET /SaveStatus - Update device status
  • GET /LoadHistory - Retrieve device history
  • GET /Test - API health check

Database Schema:

-- Core entities with relationships
Device (id, name)
Status (id, name)
History (id, device_id, status_id, datetime)
User (id, username, pin)

Features:

  • Session-based authentication
  • Comprehensive activity logging
  • Real-time status updates
  • Structured JSON responses
  • Error handling and validation

IoT Integration

ESP32-based hardware control system:

Capabilities:

  • WiFi connectivity for remote control
  • Real-time HTTP request processing
  • GPIO pin control for connected devices
  • Support for lights, switches, and other appliances
  • Bi-directional communication with backend

Hardware Setup:

Pin 12: Light Control 1
Pin 13: Light Control 2
WiFi: Network connectivity
HTTP Server: Port 80

Getting Started

Prerequisites

  • Node.js and npm/yarn
  • Expo CLI
  • Java JDK 8+
  • MySQL Server
  • Arduino IDE
  • ESP32 development board

Quick Setup

1. Mobile App Setup

cd HomeControlApp
npm install
npm start

2. Backend Setup

cd HomeControlBackEnd
# Configure database connection in hibernate.cfg.xml
# Deploy to Java application server (Tomcat/GlassFish)
ant build

3. IoT Device Setup

// Update WiFi credentials in home_control.ino
WiFi.begin("YOUR_WIFI_SSID", "YOUR_PASSWORD");
// Upload to ESP32 via Arduino IDE

4. Database Configuration

CREATE DATABASE homecontrol;
-- Run SQL scripts for table creation
-- Update hibernate.cfg.xml with your credentials

Configuration

Update the following configuration files:

  • HomeControlApp/app/home.js - Backend API URL
  • HomeControlBackEnd/src/java/hibernate.cfg.xml - Database connection
  • HomeControlIOT/home_control.ino - WiFi credentials

Screenshots

Login Screen Home Dashboard Device Controls
Login Home Controls

Project Highlights

This project demonstrates:

System Architecture Skills

  • Full-stack application design
  • RESTful API architecture
  • Database design and optimization
  • IoT device integration

Technical Proficiency

  • Cross-platform mobile development
  • Java enterprise application development
  • Embedded systems programming
  • Database management and ORM

UI/UX Design

  • Modern mobile interface design
  • Responsive layouts and animations
  • User experience optimization
  • Accessibility considerations

Development Practices

  • Version control with Git
  • Modular code organization
  • Error handling and validation
  • Documentation and commenting

Future Enhancements

  • Push notifications for device status changes
  • Analytics dashboard with usage statistics
  • Room-based device grouping
  • Scheduled device automation
  • Advanced user roles and permissions
  • Widget support for quick controls
  • Web dashboard interface
  • Support for additional IoT protocols

Contributing

This project is part of my portfolio demonstrating full-stack development capabilities. While primarily for showcase purposes, suggestions and feedback are welcome!

Contact

For questions about this project or collaboration opportunities:

Developer: Abdur Rahman Hanas


If you found this project interesting, please give it a star!

Built with passion to showcase full-stack development skills

About

HomeControl is an IoT project that lets me control home devices from my phone using a React Native app. It uses an ESP32 with Arduino code, a Java + MySQL backend for activity tracking and helps automate daily tasks efficiently.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published