The IoT Link Nexus project is a web application built using Next.js and Node.js, enabling users to monitor and control IoT devices through Firebase Realtime/Firestore. The project includes features such as user authentication, real-time data display, error logging, and the ability to capture and download snapshots of the dashboard.
- If you want to upgrade it or like to add some features or want to do any enhancement, please feel free to fork or create your own feature branch and raise a pull request. I'ld be glad to new features on top of it. Thank you.
- Features
- Project Structure
- How to set Rules for Firebase
- How to Run
- How to Deploy as a Containerized App
- Screenshot
- Conclusion
- License
- Acknowledgments
- Contribute
- User authentication with Firebase.
- Real-time data display for humidity and temperature from IoT devices.
- Toggle switch to control live status of IoT devices.
- Error logging with detailed error information.
- Snapshot capture and download functionality for the dashboard.
- Redis caching implemented.
- Internationalization to support local languages.
The project is divided into the following components and utilities:
(auth)
: For login & register.api
: Contains server related actions.components
: Contains UI components.constants
: Contains constant files.libs
: Libraries.pages
: Contains different pages of the web application.redux
: Redux store configuration and slices.utils
: Contains multiple utility files.firebase
: Firebase configuration file.public
: Contains images and shared data.
i18n
: Internationalization server.locales
: Contains JSON language files.middleware
: for error logging.webSocket
: webSocket server.
- micropython files to get temperature and humidity data.
In Firebase Real-time Database you can set rules to prevent un-authorised access. Below is some example how you can restrict. It can be made more complex according to project need.
{
"rules": {
".read": false,
".write": false,
"power": {
".read": true, // Allow read access to the "power" key
".write": true // Allow write access to the "power" key
},
"sensor": {
".read": true, // Allow read access to the "sensor" key
".write": true // Allow write access to the "sensor" key
}
}
}
-
Clone the repository:
git clone https://github.com/Virtuallified/IoT_Link_Nexus.git
-
Navigate to the project directory:
cd iot-link-nexus
-
Install dependencies:
npm install
-
Create a
.env.local
file in the root directory and add your Firebase configuration:NEXT_PUBLIC_APP_SECRET_KET=your-secret-key
NEXT_PUBLIC_REDIS_URL=your-redis-connection-url
-
Run the Next.js app (Client):
npm run dev
-
Run the Node.js app (Server):
npm start
| - productionnpm hotreload
| - development -
Access the app at
http://localhost:3000
. -
To try out different languages in DEV, please follow the steps below -
- Open Chrome
- Goto
Inspect
element - Click: triple dots (...)
- Click: More tools
- Click: Sensors
- Select location
Others...
- Enter
en
orbn
, etc in locale
-
Install Docker and Docker Compose on your system.
-
Build the Docker images:
docker-compose build
-
Start the multi-container application:
docker-compose up -d
-
Access the Next.js app at
http://localhost/
. -
Communicate with the Node.js app with Socket.IO & i18n agent at
3011
&3012
port accordingly.. -
To stop and remove the containers while preserving data volumes:
docker-compose down
To remove the containers and associated volumes:
docker-compose down -v
The IoT Link Nexus project provides an efficient and user-friendly way to manage IoT devices, monitor data in real-time, and capture snapshots of the dashboard. Whether you want to run it in a normal environment or containerized using Docker, this project simplifies the process of IoT device management.
This project is licensed under the MIT License - see the LICENSE.md file for details.
Special thanks to the contributors and open-source libraries that made this project possible.
Please feel free to contribute and add your own features to the project if you like to enrich the repo.