A comprehensive MongoDB-powered solution for managing IoT sensors and devices with real-time status tracking, search capabilities, and admin-friendly UI.
- Centralized Device Management: Store all sensor/device information in a MongoDB database
- Dynamic Status Updates: Real-time status monitoring with instant UI updates
- Advanced Search: Quickly find devices by type, IP, status, or description
- Admin Dashboard: Intuitive interface for CRUD operations
- Custom Fields: Dynamically add new fields to device records
- Filtering & Sorting: Organize devices by status or alphabetical order
- Responsive Design: Works on desktop and mobile devices
Frontend:
- React.js (with hooks)
- Tailwind CSS
- Axios for API calls
Backend:
- Node.js
- Express.js
- MongoDB (with Mongoose ODM)
- Node.js (v16 or higher)
- MongoDB Atlas account or local MongoDB instance
- npm or yarn
-
Clone the repository:
git clone https://github.com/yourusername/iot-device-management.git cd iot-device-management
-
Install dependencies:
npm install # or yarn install
-
Set up environment variables: Create a
.env
file in the root directory with the following:MONGODB_URI=your_mongodb_connection_string PORT=3000
-
Start the development server:
npm run dev # or yarn dev
-
Open your browser and navigate to:
http://localhost:3000
Endpoint | Method | Description |
---|---|---|
/api/chat |
POST | Main endpoint for all CRUD operations |
Request body should include: { query: 'fetch|create|update|delete', data: {...} } |
- Fill in the device details in the creation form
- Click "Create Sensor"
- The new device will appear in the dashboard
- Click the "Edit" button on any device card
- Modify the fields as needed
- Click "Save Changes"
- Enter field name and value in the "Add Field" section
- Click "Add Field"
- The field will be added to the current form
- Use the search bar to find devices by any attribute
- Select status from the dropdown to filter
- Choose sort order (A-Z or Z-A)
iot-device-management/
├── client/ # Frontend React application
│ ├── components/ # Reusable UI components
│ ├── pages/ # Application pages
│ └── ...
├── server/ # Backend server
│ ├── models/ # MongoDB models
│ ├── routes/ # API routes
│ └── ...
├── .env.example # Environment variables template
├── package.json # Project dependencies
└── README.md # This file
We welcome contributions! Please follow these steps:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.