Skip to content

Repository files navigation

Media Library Dashboard

A modern, full-featured media management dashboard built with Next.js 16, featuring advanced file upload, preview, editing, and organization capabilities.

✨ Features

  • πŸ“€ Media Upload: Drag-and-drop file upload with React Dropzone
  • πŸ–ΌοΈ Media Gallery: Grid and single view layouts with virtual scrolling
  • πŸ‘οΈ Preview & Download: Built-in media preview with download functionality
  • ✏️ Edit & Delete: Manage media files with edit and delete operations
  • 🎯 Media Picker: Reusable media picker component for selecting files
  • πŸŒ“ Theme Support: Dark/light mode with next-themes
  • πŸ“± Responsive Design: Mobile-first responsive UI
  • πŸ”„ State Management: Redux Toolkit with RTK Query for efficient data fetching
  • 🎨 Modern UI: shadcn/ui components with Radix Nova style
  • βœ… Form Validation: React Hook Form with Zod schema validation

πŸ› οΈ Tech Stack

Core

UI & Styling

State & Data Management

  • State Management: Redux Toolkit
  • API Layer: RTK Query
  • React Integration: react-redux

Forms & Validation

Additional Libraries

  • File Upload: react-dropzone
  • Notifications: Sonner
  • UI Primitives: @base-ui/react, radix-ui

πŸ“ Project Structure

dashboard/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                      # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ layout.tsx            # Root layout
β”‚   β”‚   β”œβ”€β”€ page.tsx              # Home page (Media Template)
β”‚   β”‚   └── globals.css           # Global styles
β”‚   β”œβ”€β”€ components/               # Reusable UI components
β”‚   β”‚   └── ui/                   # shadcn/ui components
β”‚   β”œβ”€β”€ templates/                # Feature templates
β”‚   β”‚   └── Media/                # Media management feature
β”‚   β”‚       β”œβ”€β”€ Components/       # Media-specific components
β”‚   β”‚       β”œβ”€β”€ Contexts/         # React Context providers
β”‚   β”‚       β”œβ”€β”€ Hooks/            # Custom hooks
β”‚   β”‚       β”œβ”€β”€ Redux/            # Redux slices & API
β”‚   β”‚       β”œβ”€β”€ Types/            # TypeScript definitions
β”‚   β”‚       β”œβ”€β”€ Utils/            # Utility functions
β”‚   β”‚       └── Validators/       # Zod schemas
β”‚   β”œβ”€β”€ redux/                    # Redux store configuration
β”‚   β”œβ”€β”€ lib/                      # Shared utilities
β”‚   β”œβ”€β”€ core/                     # Core configuration
β”‚   └── providers/                # React providers
β”œβ”€β”€ public/                       # Static assets
└── @types/                       # Custom type definitions

πŸš€ Getting Started

Prerequisites

  • Node.js 20+
  • pnpm 8+

Installation

  1. Clone the repository

    git clone <repository-url>
    cd dashboard
  2. Install dependencies

    pnpm install
  3. Set up environment variables

    Create a .env.local file in the root directory:

    NEXT_PUBLIC_API_URL=your_api_url
    NEXT_PUBLIC_FRONTEND_URL=your_frontend_url
  4. Run the development server

    pnpm dev
  5. Open your browser

    Navigate to http://localhost:3000

πŸ“œ Available Scripts

  • pnpm dev - Start development server
  • pnpm build - Build for production
  • pnpm start - Start production server
  • pnpm lint - Run ESLint
  • pnpm format - Format code with Prettier

🎨 Component Architecture

Media Template Structure

The media library follows a modular architecture:

Media/
β”œβ”€β”€ MediaTemplate.tsx           # Main template container
β”œβ”€β”€ MediaPicker.tsx             # Media picker component
β”œβ”€β”€ Components/
β”‚   β”œβ”€β”€ MediaGridView.tsx       # Grid layout view
β”‚   β”œβ”€β”€ MediaSingleView.tsx     # Single item view
β”‚   β”œβ”€β”€ MediaUploaderBox.tsx    # Upload interface
β”‚   β”œβ”€β”€ MediaPreview.tsx        # Media preview
β”‚   β”œβ”€β”€ MediaEditModal.tsx      # Edit modal
β”‚   └── MediaDeleteAlert.tsx    # Delete confirmation
β”œβ”€β”€ Contexts/
β”‚   └── MediaContext.tsx        # Media state context
β”œβ”€β”€ Redux/
β”‚   └── MediaAPISlice.ts        # RTK Query API
└── Hooks/
    └── useMediaDownload.ts     # Download functionality

πŸ”§ Configuration Files

  • next.config.ts - Next.js configuration
  • tailwind.config.js - Tailwind CSS configuration
  • tsconfig.json - TypeScript configuration
  • components.json - shadcn/ui configuration
  • eslint.config.mjs - ESLint configuration
  • postcss.config.mjs - PostCSS configuration

🌐 Environment Variables

Variable Description Required
NEXT_PUBLIC_API_URL Backend API URL βœ…
NEXT_PUBLIC_FRONTEND_URL Frontend URL βœ…

🎯 Key Features Explained

Media Upload

  • Drag-and-drop interface powered by react-dropzone
  • Multiple file support
  • Upload progress tracking
  • File type validation

Media Management

  • View uploaded media in grid or single view
  • Preview images and videos
  • Download media files
  • Edit media metadata
  • Delete media with confirmation

State Management

  • Centralized state with Redux Toolkit
  • Efficient data fetching with RTK Query
  • Optimistic updates for better UX
  • Automatic cache invalidation

πŸ“š Learn More

Next.js Resources

UI/Component Resources

State Management Resources

🚒 Deployment

Deploy on Vercel

The easiest way to deploy this Next.js app is using Vercel:

  1. Push your code to GitHub/GitLab/Bitbucket
  2. Import your repository to Vercel
  3. Configure environment variables
  4. Deploy!

Deploy with Vercel

For more details, check the Next.js deployment documentation.

Other Deployment Options

This application can be deployed on any platform that supports Node.js:

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License.

πŸ‘₯ Authors

Your Name / Team Name

πŸ™ Acknowledgments


Built with ❀️ using Next.js and TypeScript

About

A modern, full-featured media management dashboard built with Next.js 16, featuring advanced file upload, preview, editing, and organization capabilities.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages