Project TODO
File Storage Integration Tasks
Database Schema & Migrations
- [x] Add files table to drizzle/schema.ts with metadata columns (id, userId, fileName, fileKey, url, mimeType, size, createdAt, updatedAt)
- [x] Add file_shares table for access control (id, fileId, userId, sharedBy, createdAt)
- [x] Run pnpm db:push to apply migrations
Backend API Implementation
- [x] Create server/db.ts helpers: createFile, getFile, listUserFiles, deleteFile, updateFile
- [x] Implement file upload tRPC procedure with file validation (size, type)
- [x] Implement file list tRPC procedure with pagination
- [x] Implement file download URL tRPC procedure (presigned URL)
- [x] Implement file delete tRPC procedure
- [x] Implement file share tRPC procedure for access control
- [x] Add error handling and validation for all file operations
Frontend Components & Pages
- [x] Create FileUpload component with drag-and-drop support
- [x] Create FileList component with table/grid view
- [x] Create FileManager page at /files route
- [ ] Create FileDetail page for individual file info
- [x] Add file management navigation to App.tsx
- [ ] Implement file preview for supported types (images, PDFs, text)
Testing & Validation
- [x] Write vitest tests for file upload endpoint
- [x] Write vitest tests for file list endpoint
- [x] Write vitest tests for file delete endpoint
- [x] Write vitest tests for file sharing/access control
- [x] Test file size validation and error handling
- [ ] Test concurrent uploads and race conditions
UI/UX Polish
- [x] Add loading states for file operations
- [x] Add success/error toast notifications
- [ ] Add confirmation dialogs for destructive actions
- [x] Add file type icons to FileList
- [x] Add file size formatting (KB, MB, GB)
- [ ] Add search/filter functionality to FileList
- [ ] Add sorting options (name, date, size)
Documentation & Deployment
- [ ] Document file storage architecture in README
- [ ] Document API endpoints and usage examples
- [ ] Verify S3 storage configuration in production
- [ ] Test file uploads in staging environment
- [x] Create checkpoint after feature completion