Skip to content

Space-DF/spacedf-admin-portal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SpaceDF Portal

A modern device management portal built with Next.js, providing comprehensive IoT device management, organization administration, and user authentication capabilities.

πŸš€ Features

Device Management

  • 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

Authentication & User Management

  • 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

User Experience

  • 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

Account Settings

  • Profile Management: Update user profile information
  • Preferences: Customize account settings and preferences

πŸ› οΈ Tech Stack

Core

Authentication & API

UI & Styling

Forms & Validation

Internationalization

  • next-intl - Internationalization for Next.js

Additional Libraries

πŸ“¦ Getting Started

Prerequisites

  • Node.js 18+
  • Yarn (recommended) or npm/pnpm/bun

Installation

  1. Clone the repository:
git clone https://github.com/Space-DF/spacedf-admin-portal.git
cd spacedf-admin-portal
  1. Install dependencies:
yarn install
# or
npm install
  1. Set up environment variables: Create a .env.local file in the root directory with the required environment variables. Refer to your project's environment configuration for the specific variables needed.

  2. Run the development server:

yarn dev
# or
npm run dev
  1. Open http://localhost:3000 in your browser.

Using SpaceDF UI components

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/button

You can replace button with any other component name exposed by the SpaceDF registry.

πŸ“œ Available Scripts

  • yarn dev - Start development server
  • yarn build - Build for production
  • yarn start - Start production server
  • yarn lint - Run ESLint
  • yarn lint:fix - Fix ESLint errors and format code
  • yarn format - Format code with Prettier

πŸ—οΈ Project Structure

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

🌍 Internationalization

The application supports multiple languages:

  • English (en) - Default locale
  • Vietnamese (vi)

To add a new language:

  1. Add the locale to src/i18n/request.ts
  2. Update the middleware matcher in src/middleware.ts
  3. Create translation files in messages/<locale>/
  4. Update src/types/global.d.ts with the new locale type

🎨 Styling

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

Authentication is handled by NextAuth.js v5 with:

  • Credentials provider (email/password)
  • OAuth providers (Google, Apple)
  • JWT-based sessions
  • Protected routes via middleware

πŸ“ Code Quality

  • ESLint - Code linting with Next.js and Prettier configs
  • Prettier - Code formatting
  • Husky - Git hooks
  • lint-staged - Pre-commit linting
  • Commitlint - Conventional commit messages

License

Licensed under the Apache License, Version 2.0
See the LICENSE file for details.

SpaceDF - A project from Digital Fortress

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages