Create a file management system that allows users to organize and manage files and folders. The application should feature a tree structure, file previews, and interactive organization capabilities.
-
Explorer Page (
/app/page.js
)- Split view layout:
- Folder tree navigation
- File/folder content view
- Breadcrumb navigation
- Search bar with file/folder filtering
- Split view layout:
-
File Preview Page (
/app/files/[fileId]/page.js
)- Preview different file types:
- Documents (text preview)
- Images (thumbnail and full view)
- Code files (syntax highlighting)
- File metadata panel
- Actions toolbar (download, share link, rename)
- Preview different file types:
-
Folder Component (
/app/components/FolderView.js
)- Grid/List view toggle
- Sort options (name, date, size, type)
- Multi-select functionality
- Context menu for actions
-
File Operations (
/app/components/FileOperations.js
)- Drag and drop for file organization
- Cut/Copy/Paste operations
- Bulk file operations
- Create new folder
// /app/data/fileSystemData.js
export const fileSystem = {
root: {
id: "root",
name: "Root",
type: "folder",
children: ["folder1", "folder2", "file1"],
created: "2024-10-15T10:00:00Z",
modified: "2024-10-30T15:30:00Z"
},
items: {
folder1: {
id: "folder1",
name: "Documents",
type: "folder",
parent: "root",
children: ["file2", "file3"],
created: "2024-10-15T10:00:00Z",
modified: "2024-10-30T15:30:00Z"
},
folder2: {
id: "folder2",
name: "Images",
type: "folder",
parent: "root",
children: ["file4", "file5"],
created: "2024-10-15T10:00:00Z",
modified: "2024-10-30T15:30:00Z"
},
file1: {
id: "file1",
name: "readme.md",
type: "markdown",
parent: "root",
size: 1024,
created: "2024-10-15T10:00:00Z",
modified: "2024-10-30T15:30:00Z",
content: "# Project Documentation..."
},
file2: {
id: "file2",
name: "report.txt",
type: "text",
parent: "folder1",
size: 2048,
created: "2024-10-15T10:00:00Z",
modified: "2024-10-30T15:30:00Z",
content: "Monthly Report..."
}
}
}
export const fileOperations = [
{
id: "op1",
type: "move",
items: ["file1"],
from: "root",
to: "folder1",
timestamp: "2024-10-30T15:30:00Z",
user: "John Doe"
}
]
- Use Next.js 14 with App Router
- Implement drag and drop using
react-beautiful-dnd
- Use Tailwind CSS for styling
- Implement client-side state management
- Use TypeScript
- Add keyboard navigation support
- Implement proper error boundaries and loading states
-
TreeView (
/app/components/TreeView.js
)- Expandable folder structure
- Drag and drop targets
- Selection handling
- Context menu integration
-
FilePreview (
/app/components/FilePreview.js
)- File type detection
- Preview rendering
- Download functionality
- Sharing options
-
BreadcrumbNav (
/app/components/BreadcrumbNav.js
)- Current path display
- Navigation shortcuts
- Path editing
-
File Search (
/app/components/Search.js
)- Real-time search results
- File type filters
- Recent searches
- Advanced search options
-
Selection Manager (
/app/components/SelectionManager.js
)- Multi-select with shift/ctrl
- Bulk operations
- Selection persistence
- Selected items counter
-
User Interface
- Intuitive navigation
- Responsive layout
- Smooth interactions
- Accessibility features
-
State Management
- File system operations
- Selection state
- Undo/Redo functionality
- Path management
-
Performance
- Efficient tree rendering
- Lazy loading
- Smooth animations
- Memory management
-
Code Quality
- TypeScript usage
- Component organization
- Error handling
- Documentation
- Create basic file system structure
- Implement navigation and preview
- Add drag and drop functionality
- Implement file operations
- Add search and filters
- Polish UI and add animations
- Working file explorer interface
- File preview system
- Drag and drop functionality
- Search and filter implementation
- Complete type definitions
- Error handling implementation
-
Accessibility
- Keyboard navigation
- Screen reader support
- ARIA labels
- Focus management
-
Error Handling
- Operation failures
- Network errors
- Invalid operations
- Data consistency