- This project enables users connect to their mqtt broker instance by providing their username, password, and hostname
- It provides such user with the ability to subscribe and or publish messages to topics while selecting their preferred Quality of Service (QoS)
- This application is accessible on all types of devices (mobile and desktop)
- This project uses the Atomic Design Methodology for it's component structure
- It is built with
- React
- Typescript
- Docker
- Mqtt
- Styled with CSS Modules
- Bootstrapped with Create React App
- The application is tested (Unit tests) using:
As mentioned earlier, this application alllows users to subscribe, and or publish messages to topics on their Mqtt broker instance. In order to connect to a broker instance, users must provide the following information:
- Username: The username of the broker instance you are trying to connect
- Password: The password of the broker instance you are trying to connect
- Hostname: The hostname of the broker instance
Users can easily see information about whether they were able to connect successfully to their broker instance or not, through a text displayed just below the Connect/Disconnect
button
NB:
- You would only able to publish, subscribe or receive messages only after connecting to a broker instacne, and subscribing to a topic.
- This application allows you to specify the Quality of Service (QoS) when subcribing to a topic.
- You can signup on HiveMQ to create a free broker instance, which would then provide you with the
username
,password
andhostname
required to use this service.
- Open your workspace terminal
- Clone this repository
- Cd into the cloned repository
- There are two ways you can start or test this application locally:
- To run the tests with docker-compose, simply run: (on MacOS)
docker-compose up test
- To run the tests with docker-compose, simply run: (on Ubuntu)
sudo docker compose up test
- To start the application with docker-compose, simply run (on MacOS):
docker-compose up web
- To start the application with docker-compose, simply run (on Ubuntu):
sudo docker compose up web
- Press
Cmd + C
on a MacOS orCtrl+ C
on Ubuntu to stop the application - Run (on MacOS):
docker-compose down
- Run (on Ubuntu):
sudo docker compose down
- Install the dependencies with:
npm install
- Run the tests with:
npm test
- Install the dependencies with:
npm install
- Start the application with:
npm start
Visit localhost:3000
on your favourite browser to view the application
- Press
Cmd + C
on MacOs orCtrl + C
on Ubuntu to stop the application
- Be sure to confirm that you do not have another project running on port 3000
- Confirm that the credentials you are trying to login to the broker are actually valid
- Seeing an Error like this error when trying to install depdencies on Ubuntu?
Error: EACCES: Permission denied, mkdir '/<file_path>
Solution:
- Run
rm -rf node_modules
in the repository and thennpm install
again Why did that happen?: Well, it's possible that you had randocker-compose web
earlier