---
Task ID: 1
Agent: Upload API Creator
Task: Create the missing /api/upload route for file uploads

Work Log:
- Created src/app/api/upload/route.ts
- Implemented POST handler with FormData parsing (file + type)
- Added MIME type validation per category (image, video, audio, document)
- Added file size limits: 10MB for images/video/audio, 5MB for documents
- Created upload directories: public/uploads/{avatar,message,voice,document}
- Type mapping: avatar→image, message→image, voice→audio, document→document
- Generates unique filenames using timestamp + 6-char random string
- Returns { url: "/uploads/{type}/{filename}" } on success
- Proper error responses with 400/500 status codes
- Lint passed cleanly

Stage Summary:
- Upload API fully functional at POST /api/upload
- Compatible with ProfileModule.tsx (avatar uploads) and MessagesModule.tsx (message/voice/document attachments)
- Files saved to public/uploads/{type}/ directory with unique names
