How sabarees3578/thingzkit-cloud works
Purpose and entry points
Thingzkit Cloud is an IoT management dashboard paired with an Arduino client library and device OTA sketch storage. The browser application starts at src/main.jsx, renders the root application in src/App.jsx, and is built with Vite (vite.config.js). Server/deployment entry points are server.cjs, Dockerfile, and platform manifests railway.toml and render.yaml.
Frontend application shell
The React UI is organized around a dashboard shell: src/components/layout/DashboardLayout.jsx composes navigation from src/components/Sidebar.jsx and top-level controls from src/components/Topbar.jsx. Global styling is initialized in src/styles/globals.css; layout and feature components use colocated CSS modules.
Application state and identity boundary
Shared client state is separated into application/domain state in src/context/AppContext.jsx and authentication state in src/context/AuthContext.jsx. Firebase integration is centralized at src/firebase.js, making Firebase the primary external backend/auth boundary exposed by the frontend. src/data/mockData.js supports local or placeholder dashboard data where live integration is unavailable.
Dashboard and operational views
Page-level modules represent the main IoT control-plane areas: device management (src/pages/DevicesPage.jsx), dashboard visualization (src/pages/DashboardPage.jsx), telemetry/log review (src/pages/DataLogPage.jsx), analytics (src/pages/AnalyticsPage.jsx), alerts (src/pages/AlertsPage.jsx), and automations (src/pages/AutomationsPage.jsx). src/pages/WelcomePage.jsx provides the initial/onboarding route, while settings and team management live in src/pages/SettingsPage.jsx and src/pages/TeamPage.jsx.
Provisioning and dashboard composition
Device/project/widget creation is handled through modal workflows rather than dedicated pages. src/components/modals/AddDeviceWizard.jsx and src/components/modals/AddDeviceModal.jsx drive device onboarding; src/components/modals/NewProjectModal.jsx creates projects; src/components/modals/AddWidgetModal.jsx adds dashboard widgets. The embedded code-editing surface is src/components/WebEditor.jsx, likely linking cloud-side device setup with sketch authoring.
Embedded-device integration
The reusable Arduino-facing SDK is arduino-library/EnthutechIoT/EnthutechIoT.h and arduino-library/EnthutechIoT/EnthutechIoT.cpp. Its intended device-to-cloud patterns are demonstrated by arduino-library/EnthutechIoT/examples/BasicSensor/BasicSensor.ino and arduino-library/EnthutechIoT/examples/FullBidirectional/FullBidirectional.ino, indicating telemetry publishing plus bidirectional cloud/device interaction.
OTA and deployment boundary
Per-device OTA source is stored under device identifiers, including ota/DEV-A2DD2A86/sketch/sketch.ino and ota/DEV-FC61DC23/sketch/sketch.ino. This is a filesystem-backed boundary between cloud-managed device records and deployable firmware artifacts. CI/CD deployment is defined in .github/workflows/deploy.yml; container deployment is supported through Dockerfile, with Railway and Render-specific configuration available.
Main entry points: DashboardLayout.jsx Dashboard shell · App.jsx Root app · sketch.ino OTA sketches · firebase.js Firebase
Components 19
React dashboard
Browser control-plane application.
- Vite build
vite.config.js - Browser entry
src/main.jsx - Root app
src/App.jsx - Dashboard shell
src/components/layout/DashboardLayout.jsx - Sidebar & topbar
- Domain state
src/context/AppContext.jsx - Auth state
src/context/AuthContext.jsx - Operational views · Devices, dashboards, logs, analytics, alerts, and automations.
- Welcome route
src/pages/WelcomePage.jsx - Settings & team
- Provisioning modals · Creates devices and projects through modal flows.
- Widget composer
src/components/modals/AddWidgetModal.jsx - Web editor · Cloud-side device setup and sketch authoring surface.
src/components/WebEditor.jsx
Cloud & deployment
Backend boundary, OTA storage, and deployment.
- Firebase · Primary frontend integration boundary.
src/firebase.js - Server entry
server.cjs - OTA sketches · Per-device deployable sketch sources.
ota/DEV-A2DD2A86/sketch/sketch.ino - Deployment pipeline · Builds and deploys the cloud runtime.
.github/workflows/deploy.yml
Embedded integration
Arduino SDK and device firmware.
- EnthutechIoT SDK · Reusable device-to-cloud client library.
arduino-library/EnthutechIoT/EnthutechIoT.cpp - Device examples · Demonstrate telemetry publishing and bidirectional interaction.
arduino-library/EnthutechIoT/examples/FullBidirectional/FullBidirectional.ino
Connections 20
- Vite build → Browser entry: builds
- Browser entry → Root app: renders
- Root app → Dashboard shell: hosts
- Dashboard shell → Sidebar & topbar: composes
- Dashboard shell → Operational views: routes to
- Dashboard shell → Welcome route: routes to
- Dashboard shell → Settings & team: routes to
- Root app → Domain state: uses
- Root app → Auth state: uses
- Auth state → Firebase: authenticates via
- Domain state → Firebase: integrates with
- Operational views → Provisioning modals: opens
- Operational views → Widget composer: composes dashboards with
- Provisioning modals → Web editor: can lead to
- Web editor → OTA sketches: authors
- Server entry → OTA sketches: serves managed
- Deployment pipeline → Server entry: deploys
- EnthutechIoT SDK → Firebase: exchanges cloud data with
- Device examples → EnthutechIoT SDK: uses
- OTA sketches → Device examples: device firmware pattern