:::success
# Part B CSN Lab 2: Team Work
#### Group: Daniil Sinelnik, Alexey Kosmachev, Bogdan Lyubchenko, Roman Klimov
:::
:::info
System description.
:::
We have decided to develop an architecture for SmartHouse system. IoT devices represents as sensors for Oxygen, CO2, temperature, noise level, luminosity level, etc.
:::info
3.1 Define the requirements: functional, non-functional.
:::
:::spoiler Functional requirements
1. User Authentication and Authorization.
* * The system shall have an authentication mechanism for the manager to log in and configure the system. End users shall only have access to the monitor displays and not to the system configuration.
2. Installation and Setup
* * The system shall have a straightforward installation process for the manager to set up the IoT devices and connect them to the central monitoring system.
3. Sensors monitor.
* * The system shall present the collected and processed data through a user-friendly interface, with separate monitors for each sensor type. Data is provided in 2 views: basic and detailed. Basic has low/medium/high and true/false states, meanwhile detailed shows the precise value on each sensor.
4. Data Collection and Aggregation
* * The system shall collect data from connected IoT devices at regular intervals and aggregate it for analysis.
5. Data Filtering and Validation:
* * The system shall apply filters to remove erroneous or anomalous data, ensuring that only valid and accurate information is processed.
6. Real-time Monitoring:
* * The system shall provide real-time updates for each sensor's data, allowing end users to monitor the environment continuously.
7. Threshold Alerts:
* * The system shall allow the manager to set threshold levels for each sensor, triggering alerts if any readings exceed or fall below these predefined levels.
8. Verify license on the server side.
:::
:::spoiler Non-Functional requirements
1. Performance:
* * The system shall have low latency in processing and displaying real-time data on the monitors.
2. Usability
* * The user interface shall be intuitive and easy to navigate for both the manager during setup and end users during monitoring, such that the end user can dive deeper into each sensor and check the detailed that sensors will show.
4. Portability
* * System would be easy to move from on place to another without external tools.
6. Compatability
* * The system shall support a wide range of IoT devices to ensure flexibility and adaptability to future technologies.
7. Security
* * The system shall implement strong security measures to protect against unauthorized access, ensuring that only the manager has configuration privileges.
8. Accessibility:
* * The user interface shall be designed to be accessible to people with disabilities, following relevant accessibility standards. These requirements should guide the development of the smart house system to ensure it meets the specified functionality and performance criteria.
:::
:::info
3.2 Map the components of the architecture.
:::
:::spoiler Components of the architecture
1. IoT Sensors.
2. Central device manager.
* * IoT parser.
* * Interface.
* * Database.
3. Authorizer.
4. License Server.
5. Database clusters(licenses and user access data).
:::
:::info
3.3 Choose the Technology stack.
:::
:::spoiler Stack
* Backend:
* * Node.JS.
* * MongoDB.
* * Nest.js.
* * Redis.
* Mobile Application:
* * Flutter.
:::
:::info
3.4 Design the Architecture.
:::
:::spoiler Architecture
<center>

Figure 1. Architecture
</center>
:::
:::info
3.5 Write a detailed architecture document.
:::
:::spoiler Use Case Diagram
<center>

Figure 2. Use Case Diagram.
</center>
This document offers an intricate overview of the architectural framework underpinning the SmartHouse system, a collaborative endeavor undertaken by the CSN Lab 2 team, comprising of members Daniil Sinelnik, Alexey Kosmachev, Bogdan Lyubchenko, and Roman Klimov.
In the preparatory phase, we meticulously defined the system's scope and objectives.
In section 3.1, we exhaustively delineated both the functional and non-functional requisites, providing a comprehensive description for each requirement.
Section 3.2 comprehensively outlines the fundamental components that must be integrated into our application and the corresponding services that necessitate implementation.
Moving forward, section 3.3 elaborates on our chosen Technology Stack. To handle services reliant on API responses, we opted for Node.JS coupled with the Nest.js framework. This selection was made due to the swift setup process offered by this tandem, ensuring expedited development. Additionally, to optimize time and resources, we have chosen to develop the mobile application utilizing Flutter. This framework, known for its cross-platform capabilities catering to both Android and iOS systems, seamlessly aligns with our project's requirements.
In section 3.4, we present a simplified sample of our architectural design, providing a visual representation of our system's structural layout. This serves as a foundational blueprint for our development process.
:::