The file management surface in Storx is the core of the dashboard. It lets you upload new files, browse your library in grid or list view, search by name, download content, and permanently remove files you no longer need. All file metadata is stored in Neon PostgreSQL while the binary content lives in ImageKit CDN.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nayalsaurav/Storx/llms.txt
Use this file to discover all available pages before exploring further.
Supported File Types
The upload endpoint validates MIME types before accepting a file. Storx supports:- Images — any MIME type that starts with
image/(e.g.image/png,image/jpeg,image/webp) - PDFs — the exact MIME type
application/pdf
400 response:
Uploading Files
File uploads flow throughuseFileOperations.uploadFile(), which builds a FormData payload and POSTs it to /api/files/upload.
| Context | ImageKit path |
|---|---|
| Root (no folder) | /storex/{userId} |
| Inside a folder | /storex/{userId}/folder/{parentId} |
550e8400-e29b-41d4-a716-446655440000.pdf) is used in ImageKit to avoid collisions.
Batch uploads are handled by handleFileUpload, which iterates over all selected files, calls uploadFile for each, and reports failures via toast notifications:
Storage Limit
Every user has a 15 GB storage quota. TheuseStorage hook initialises the total as 15 * 1024 * 1024 * 1024 bytes, fetches current usage from GET /api/storage, and exposes it as a StorageInfo object:
StorageIndicator component in the sidebar renders a progress bar using storageInfo.percentage, capped at 100%.
File sizes are formatted for display using formatFileSize from lib/file-utils.ts:
getFileIcon utility returns an appropriate Lucide React icon element based on the file’s MIME type or isFolder flag:
View Modes
The dashboard supports two display modes controlled by theViewMode type:
Grid View
Rendered by
FileGrid, this mode lays files out in a responsive card grid
(2 → 6 columns depending on viewport). Thumbnail images are shown for files
that have a thumbnailUrl; other types fall back to a coloured icon from
getFileIcon. Starred files show a yellow star badge on their thumbnail.List View
Rendered by
FileList, this mode displays files in a table with Name,
Size, Type, and Modified columns. Each row has a ⋮ dropdown
menu for per-file actions including download, star, and delete.Grid3X3 / List toggle buttons in ActionBar. The active mode is highlighted with the default button variant.
FileItem Interface
All file and folder records share theFileItem interface:
File Actions
All per-file actions are available through the⋮ dropdown in list view, powered by useFileOperations:
| Action | Hook method | API endpoint |
|---|---|---|
| Download | handleDownload(fileId, fileName) | GET /api/files/{fileId}/download?userId={userId} |
| Star / Unstar | handleStarToggle(fileId, isCurrentlyStarred) | PATCH /api/files/{fileId}/star |
| Move to Trash | (see Trash docs) | PATCH /api/files/{fileId}/trash |
| Delete | handleDelete(fileId, fileName) | DELETE /api/files/{fileId} |
Blob and triggers a programmatic <a> click to save it:
fetchStorageInfo() refresh so the storage indicator updates immediately.
Searching Files
Search is performed client-side inside theDashboard component. The searchQuery state from useDashboardState is applied as a case-insensitive substring filter before passing files to either FileGrid or FileList:
Header component calls setSearchQuery on every keystroke — no debounce, no server round-trip. Files already loaded for the current folder are filtered in memory.