This document summarizes what has been built and ensures all requirements are met.
- ✅ Express server with MongoDB connection
- ✅ GridFS for file storage
- ✅ Mongoose models (Text, ImageMeta, FileMeta, RandomKeys)
- ✅ TTL indexes for auto-expiration (2 hours)
- ✅ Controllers for CRUD operations
- ✅ Middleware (error handler, upload, rate limiting, CORS, Helmet)
- ✅ Routes for all API endpoints
- ✅ File validation utilities
- ✅ nanoid key generator
- ✅ React 18 with React Router
- ✅ Upload page with form
- ✅ View content page
- ✅ UploadForm component
- ✅ PreviewImage component
- ✅ FileDownload component
- ✅ API helper utilities
- ✅ Error handling and loading states
- ✅ Copy-to-clipboard functionality
- ✅ Tailwind CSS integration
- POST /api/createContent - Accepts text, images[], files[]
- File size validation (<10MB)
- MIME type validation
- Upload to GridFS
- Save text in "Text" collection
- Save metadata in "ImageMeta" and "FileMeta"
- Generate randomKey using nanoid
- Store mapping in "RandomKeys" collection
- GET /api/readContent/:randomKey
- DELETE /api/delete/:randomKey
- Auto-delete after 2 hours (TTL indexes)
- Multer memoryStorage
- Stream to GridFSBucket
- Global error handler
- CORS + Helmet + Rate Limiting
- Clean folder structure
- Full code with comments
- README.md
- Postman collection
- Upload Page (/) with form
- Textarea for text input
- File input for multiple files
- Image input for multiple images
- Submit button
- Call POST /api/createContent
- Show random key after upload
- Copy Link button
- Open Content button
- File size validation (10MB)
- Error display
- Disable button while uploading
- Upload progress indicator
- View Content Page (/view/:key)
- Fetch using GET /api/readContent/:randomKey
- Display text output
- Preview images
- Download file buttons
- Expired content message
- Delete button (DELETE /api/delete/:randomKey)
- React + Hooks
- Axios
- React Router
- Tailwind CSS
- Complete src/ folder
- Routes setup
- API helper file
- Error/Loading UI
- Copy-to-clipboard logic
- .env sample
- Instructions to run
- Production build steps
cd backend
npm install
# Create .env from env.example.txt and add MongoDB URI
npm run dev # or npm startcd frontend
npm install
# Optional: Create .env for custom API URL
npm start # Development
npm run build # Production build- POST /api/createContent - Upload content
- GET /api/readContent/:randomKey - Read content
- GET /api/download/:fileId - Download file
- DELETE /api/delete/:randomKey - Delete content
- GET /health - Health check
- Text - Text content with expiration
- ImageMeta - Image metadata with GridFS reference
- FileMeta - File metadata with GridFS reference
- RandomKeys - Key-to-content mapping
All use TTL indexes for automatic expiration after 2 hours.
- Helmet.js for security headers
- CORS configuration
- Rate limiting (100 req/15min general, 50 req/hour creation)
- File type validation
- File size limits (10MB)
- Executable file blocking
- express
- mongoose
- multer
- nanoid
- cors
- helmet
- express-rate-limit
- dotenv
- react
- react-dom
- react-router-dom
- react-scripts
- axios
- Tailwind CSS (via CDN)
- README.md - Comprehensive project documentation
- SETUP.md - Quick setup guide
- PROJECT_SUMMARY.md - This file
- backend/README.md - Backend-specific docs
- postman_collection.json - Postman API collection
- ✅ Unlimited text upload
- ✅ Multiple image upload (up to 20)
- ✅ Multiple file upload (up to 20)
- ✅ Random key generation
- ✅ Content expiration (2 hours)
- ✅ GridFS file storage
- ✅ Modern UI with Tailwind CSS
- ✅ Responsive design
- ✅ Error handling
- ✅ Loading states
- ✅ File preview (images)
- ✅ File download
- ✅ Copy to clipboard
- ✅ Delete functionality
- ✅ Auto-cleanup via TTL
- Add user authentication
- Add custom expiration times
- Add password protection for content
- Add content analytics
- Add email notifications
- Add drag-and-drop file upload
- Add image gallery view
- Add file preview (PDF, etc.)
- Add search functionality
- Add content statistics dashboard
For issues or questions, refer to:
- README.md for detailed documentation
- SETUP.md for setup instructions
- Backend/README.md for API details
Project Status: ✅ Complete and Ready to Use