This is a project for an IoT module management application designed to measure water parameters in aquaponics farming. The application is built using ReactJS, TypeScript, and Tailwind CSS and aims to allow users to browse available modules and edit their parameters. Below, you will find information about the functionality, how to run the project, and testing.
- The main page of the application displays all available modules in a list format.
- It shows the module's name, availability, and target temperature.
- Module data is fetched from the server using the GET
/modules
endpoint.
- Clicking on a module on the list page redirects the user to the module's details page.
- It displays the module's name, description, availability, and target temperature.
- It allows module editing through a modal dialog triggered by clicking the "Edit" button.
- If a module is unavailable, it blocks the editing capability and displays a notice about its unavailability.
- On the module details page, users can edit module parameters such as name, description, and target temperature.
- Before sending changes to the server, fields are validated:
name
- a non-empty stringdescription
- a non-empty stringtargetTemperature
- a number between 0 and 40
- The current water temperature, measured by the specific module, is displayed on both the modules list and module details pages.
- Temperature data is obtained from a WebSocket server at
localhost:3001
using thesocket.io-client
npm package. - Temperature updates in real-time upon receiving messages from the WebSocket server.
- If the temperature is within ±0.5°C of the
targetTemperature
value, it is displayed in green; otherwise, it is displayed in red.
git clone https://github.com/olimpialewinska/recruitment-luna.git
cd recruitment-luna
npm install
npm start
The application will be accessible in your browser at http://localhost:3000.
The project includes unit and component tests to verify the correctness of the application. To run the tests, use the following command:
npm test
Author: Olimpia Lewińska
Contact: [email protected]
This project is a recruitment task.