SpaceDF is a modern web application for IoT device tracking and digital twin visualization. Built with Next.js 14, it provides real-time device monitoring, 3D mapping, interactive dashboards, and comprehensive space management capabilities.
- 🌐 Real-time Device Tracking - Monitor IoT devices with live updates via MQTT
- 🗺️ 3D Digital Twin Visualization - Interactive 3D maps powered by MapLibre and deck.gl
- 📊 Customizable Dashboards - Build custom dashboards with various widget types (charts, gauges, sliders, switches)
- 🏢 Multi-tenant Spaces - Organize devices and data in workspaces
- 👥 Team Collaboration - Manage team members, roles, and permissions
- 🌍 Internationalization - Support for multiple languages (English, Vietnamese)
- 🎨 Modern UI - Built with Radix UI, Tailwind CSS, and shadcn/ui components
- 🔐 Authentication - Secure authentication with NextAuth.js
- Next.js 14 - React framework with App Router
- React 18 - UI library
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Accessible component primitives
- shadcn/ui - High-quality component system
- Framer Motion - Animation library
- MapLibre - Interactive maps
- deck.gl - WebGL-powered visualization framework
- Recharts - Composable charting library
- SWR - Data fetching and caching
- Zustand - Lightweight state management
- React Hook Form - Form state management
- Zod - Schema validation
- MQTT - Real-time device telemetry
- WebSocket - Live updates
- next-intl - Internationalization framework
- NextAuth.js v5 - Authentication solution
Before you begin, ensure you have the following installed:
- Node.js 18.x or later
- Yarn 1.22.x or later (package manager)
- Git for version control
-
Clone the repository
git clone https://github.com/Space-DF/spacedf-web-app.git cd spacedf-web-app -
Install dependencies
yarn install
-
Set up environment variables
Create a
.env.localfile in the root directory:NEXTAUTH_SECRET=your-nextauth-secret NEXTAUTH_URL=http://localhost:3000 AUTH_API=your-auth-api-url MAPTILER_API_KEY=your-maptiler api key # MQTT Configuration DASHBOARD_DASHBOARD_MQTT_USERNAME=your-mqtt-username DASHBOARD_DASHBOARD_MQTT_PASSWORD=your-mqtt-password DASHBOARD_DASHBOARD_MQTT_PROTOCOL=ws DASHBOARD_DASHBOARD_MQTT_PORT=8883 DASHBOARD_DASHBOARD_MQTT_BROKER=your-mqtt-broker
-
Run the development server
yarn dev
-
Open your browser
Navigate to http://{your-org}.localhost:3000
yarn dev- Start development serveryarn build- Build for productionyarn start- Start production serveryarn lint- Run ESLintyarn format- Format code with Prettier
spacedf-web-app/
├── src/
│ ├── app/ # Next.js App Router pages
│ │ ├── [locale]/ # Internationalized routes
│ │ └── api/ # API routes
│ ├── components/ # Reusable UI components
│ │ ├── ui/ # shadcn/ui components
│ │ ├── icons/ # Icon components
│ │ └── layouts/ # Layout components
│ ├── containers/ # Page-specific containers
│ ├── lib/ # Core utilities
│ │ ├── auth.ts # Authentication utilities
│ │ ├── spacedf.ts # SpaceDF SDK client
│ │ └── mqtt.ts # MQTT client
│ ├── stores/ # Zustand state management
│ ├── hooks/ # Custom React hooks
│ └── utils/ # Helper functions
├── messages/ # Internationalization files
├── public/ # Static assets
└── package.json # Dependencies
Required environment variables:
| Variable | Description |
|---|---|
NEXTAUTH_URL |
Base URL of your application (e.g., http://localhost:3000) |
NEXTAUTH_SECRET |
Secret key for NextAuth.js - generate here |
AUTH_API |
SpaceDF authentication API endpoint |
MAPTILER_API_KEY |
MapTiler api key for get map address (server-side only) |
DASHBOARD_DASHBOARD_MQTT_USERNAME |
MQTT broker username |
DASHBOARD_DASHBOARD_MQTT_PASSWORD |
MQTT broker password |
DASHBOARD_DASHBOARD_MQTT_PROTOCOL |
MQTT protocol (ws or wss) |
DASHBOARD_DASHBOARD_MQTT_PORT |
MQTT broker port |
DASHBOARD_DASHBOARD_MQTT_BROKER |
MQTT broker hostname |
Licensed under the Apache License, Version 2.0
See the LICENSE file for details.
