The purpose of our project is to revolutionize the management of smart home ecosystems by creating an integrated mobile application and website. Our aim is to empower users to control and monitor their Internet of Things (IoT) devices effortlessly, thereby enhancing convenience, energy efficiency, and security within their homes.
- Purpose: Build the web API for handling client requests.
- Benefits: High performance, cross-platform, and supports dependency injection for better testability.
- Purpose: Structuring the codebase to be maintainable, scalable, and testable.
- Benefits: Separation of concerns, independent of frameworks, and facilitates test-driven development.
- Purpose: Primary programming language for backend development.
- Benefits: Strongly typed, object-oriented, and integrated seamlessly with the .NET framework.
- Purpose: Database management.
- Benefits: High performance, robust transaction processing, and integration with Azure services.
- Purpose: Hosting the web API.
- Benefits: Easy deployment, scaling, and management.
The project uses SQL Server hosted on Azure. Key tables include:
- AspNetUsers: Stores user information such as IDs, names, usernames, emails, and password hashes.
- Devices: Stores information about IoT devices, including smart sockets, security sensors, and smart lights. Key attributes include device IDs, names, types, room IDs, and statuses.
- Rooms: Stores information about different rooms in the smart home. Key attributes include room IDs, names, and home IDs.
- Homes: Stores information about homes, including home IDs, owner IDs, names, and addresses.
- Users: Stores additional user details such as user IDs, names, emails, passwords, and associated home IDs.
- HomeOwners: Join table for homes and users, facilitating a many-to-many relationship.
The database schema ensures robust relationships between entities:
- Home-Room Relationship: Each home can have multiple rooms, and deleting a home cascades deletions to its rooms.
- Room-Device Relationship: Each room can have multiple devices, and deleting a room cascades deletions to its devices.
- User-Home Relationship: Many-to-many relationship managed through the
HomeOwners
join table, linking users to homes. This allows a single user to own multiple homes and multiple users to access the same home as homeowners.
The backend includes several controllers to manage different aspects of the smart home system. Below are the primary endpoints, derived from the
- GET /api/devices: Retrieves a list of all devices.
- GET /api/devices/{id}: Retrieves a specific device by its ID.
- POST /api/devices: Adds a new device.
- PUT /api/devices/{id}: Updates an existing device by its ID.
- DELETE /api/devices/{id}: Deletes a device by its ID.
- GET /api/home: Retrieves information about the home setup.
- PUT /api/home: Updates home configuration.
- GET /api/products: Retrieves a list of all products.
- GET /api/products/{id}: Retrieves a specific product by its ID.
- POST /api/products: Adds a new product.
- PUT /api/products/{id}: Updates an existing product by its ID.
- DELETE /api/products/{id}: Deletes a product by its ID.
- GET /api/rooms: Retrieves a list of all rooms.
- GET /api/rooms/{id}: Retrieves a specific room by its ID.
- POST /api/rooms: Adds a new room.
- PUT /api/rooms/{id}: Updates an existing room by its ID.
- DELETE /api/rooms/{id}: Deletes a room by its ID.
- GET /api/users: Retrieves a list of all users.
- GET /api/users/{id}: Retrieves a specific user by their ID.
- POST /api/users: Adds a new user.
- PUT /api/users/{id}: Updates an existing user by their ID.
- DELETE /api/users/{id}: Deletes a user by their ID.
- Database Connection: Update the connection strings in
appsettings.json
to match your Azure SQL Database credentials. - IoT Device Setup: Configure your IoT devices to communicate with the backend APIs.
- Implement AI-based energy consumption optimization.
- Integrate more types of IoT devices.
- Enhance security features with advanced image and video processing.
- Ibrahim Duman Back-End Lead
- Buse Çoban
- Meryem Ahıskalı
- Özge Havva Şahin