A modern device management portal built with Next.js, providing comprehensive IoT device management, organization administration, and user authentication capabilities.
- Device Listing: View and manage devices with active and inventory tabs
- Device Details: Comprehensive device information, activation details, and event tracking
- Add Devices: Multiple methods to add devices:
- QR code scanning
- Manual entry
- CSV import
- Device Operations: Update, delete, and manage device configurations
- Network Server Integration: Connect devices to network servers
- Device Models: Manage and select from available device models
- Email/Password Authentication: Secure sign-in and sign-up
- Social Authentication: Sign in with Google and Apple
- Password Recovery: Forgot password and reset password flows
- OTP Verification: Email-based OTP for account verification
- Session Management: Secure session handling with NextAuth.js
- Internationalization: Full support for English (en) and Vietnamese (vi)
- Modern UI: Built with shadcn/ui components and Radix UI primitives
- Animations: Smooth transitions powered by Framer Motion
- Profile Management: Update user profile information
- Preferences: Customize account settings and preferences
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe development
- React 18 - UI library
- NextAuth.js v5 - Authentication framework
- SWR - Data fetching and caching
- Zustand - State management
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - Re-usable component library
- Radix UI - Accessible component primitives
- Framer Motion - Animation library
- Lucide React - Icon library
- React Hook Form - Form state management
- Zod - Schema validation
- @hookform/resolvers - Form validation resolvers
- next-intl - Internationalization for Next.js
- TanStack Table - Powerful table/data grid
- Day.js - Date manipulation
- PapaParse - CSV parsing
- QR Scanner - QR code scanning
- Sonner - Toast notifications
- Node.js 18+
- Yarn (recommended) or npm/pnpm/bun
- Clone the repository:
git clone https://github.com/Space-DF/spacedf-admin-portal.git
cd spacedf-admin-portal- Install dependencies:
yarn install
# or
npm install-
Set up environment variables: Create a
.env.localfile in the root directory with the required environment variables. Refer to your project's environment configuration for the specific variables needed. -
Run the development server:
yarn dev
# or
npm run dev- Open http://localhost:3000 in your browser.
This project is configured to use the SpaceDF shadcn/ui registry (@spacedf) defined in components.json.
To install a new UI component from the SpaceDF registry (for example, button), run:
npx shadcn@latest add @spacedf/buttonYou can replace button with any other component name exposed by the SpaceDF registry.
yarn dev- Start development serveryarn build- Build for productionyarn start- Start production serveryarn lint- Run ESLintyarn lint:fix- Fix ESLint errors and format codeyarn format- Format code with Prettier
spacedf-portal/
βββ src/
β βββ app/ # Next.js App Router pages
β β βββ [locale]/ # Internationalized routes
β β β βββ (withLayout)/ # Layout-wrapped pages
β β β β βββ devices/ # Device management pages
β β β βββ auth/ # Authentication pages
β β βββ api/ # API routes
β βββ components/ # Reusable UI components
β β βββ ui/ # shadcn/ui components
β β βββ layouts/ # Layout components
β β βββ icons/ # Custom icons
β βββ containers/ # Feature containers
β β βββ devices/ # Device management
β β βββ auth/ # Authentication flows
β β βββ components/ # Shared containers
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility libraries
β βββ stores/ # Zustand stores
β βββ types/ # TypeScript type definitions
β βββ utils/ # Utility functions
β βββ configs/ # Configuration files
β βββ contexts/ # React contexts
β βββ i18n/ # Internationalization config
β βββ styles/ # Global styles
βββ messages/ # Translation files
β βββ en/ # English translations
β βββ vi/ # Vietnamese translations
βββ public/ # Static assets
βββ ...config files
The application supports multiple languages:
- English (en) - Default locale
- Vietnamese (vi)
To add a new language:
- Add the locale to
src/i18n/request.ts - Update the middleware matcher in
src/middleware.ts - Create translation files in
messages/<locale>/ - Update
src/types/global.d.tswith the new locale type
The project uses Tailwind CSS with a custom design system:
- Custom color palette defined in
src/configs/tailwindcss/color.ts - Custom animations and keyframes
- CSS variables for theming
Authentication is handled by NextAuth.js v5 with:
- Credentials provider (email/password)
- OAuth providers (Google, Apple)
- JWT-based sessions
- Protected routes via middleware
- ESLint - Code linting with Next.js and Prettier configs
- Prettier - Code formatting
- Husky - Git hooks
- lint-staged - Pre-commit linting
- Commitlint - Conventional commit messages
Licensed under the Apache License, Version 2.0
See the LICENSE file for details.
