https://shareany.me A simple and secure temporary file and text sharing application that automatically deletes shared content after 24 hours.
- File Sharing: Upload up to 3 files at once
- Text Sharing: Share text content with unique keywords
- Auto-Expiry: All shared data automatically deletes after 24 hours
- Secure Links: Access shared content via unique generated keywords
- File Management: Download, copy links, or view files directly
- Real-time Feedback: Toast notifications for all actions
- Responsive Design: Modern UI built with React and Tailwind CSS
- React 18 with TypeScript
- Vite for build tooling
- Tailwind CSS for styling
- Radix UI components
- Sonner for toast notifications
- Node.js with Express.js
- MongoDB with Mongoose ODM
- Cloudinary for file storage
- Multer for file upload handling
- CORS enabled for cross-origin requests
shareany/
├── _frontend/ # React frontend application
│ ├── src/
│ │ ├── pages/
│ │ │ ├── SimpleShareAny.tsx # Main upload/share page
│ │ │ └── RetrievePage.tsx # File retrieval page
│ │ ├── App.tsx
│ │ └── main.tsx
│ ├── public/
│ ├── package.json
│ └── vite.config.ts
└── backend/ # Node.js backend API
├── src/
│ ├── app.js # Express app configuration
│ ├── server.js # Server entry point
│ ├── controller.js # Request handlers
│ ├── model.js # MongoDB schemas
│ ├── db.js # Database connection
│ ├── cloudinary.js # File upload service
│ ├── multer.middleware.js # File handling middleware
│ └── services/
│ └── cleanup.service.js # Auto-cleanup service
├── public/temp/ # Temporary file storage
└── package.json
- Node.js (v18 or higher)
- Bun (for frontend) or npm
- MongoDB database
- Cloudinary account
Create a .env file in the backend directory:
MONGODB_URI=your_mongodb_connection_string
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
PORT=5000-
Clone the repository
git clone https://github.com/GhanshyamSharma122/shareany.git cd shareany -
Setup Backend
cd backend npm install npm run dev -
Setup Frontend
cd _frontend bun install bun run dev
The application will be available at:
- Frontend:
http://localhost:8080 - Backend API:
http://localhost:5000
POST /
Content-Type: multipart/form-data
Body:
- text: string (optional)
- files: File[] (optional, max 3 files)GET /:keyword- Upload: Users can upload files and/or text content
- Keyword Generation: System generates a unique keyword using
random-wordslibrary - Storage: Files are uploaded to Cloudinary, metadata stored in MongoDB
- Sharing: Users receive a unique link containing the keyword
- Retrieval: Others can access content using the shared link
- Auto-Cleanup:
cleanUPservice runs every 24 hours to delete expired content
{
text: String, // Optional text content
files: [String], // Array of Cloudinary URLs
keyword: String, // Unique access keyword (indexed)
createdAt: Date, // Auto-generated timestamp
updatedAt: Date // Auto-generated timestamp
}{
createdAt: Date, // Tracks cleanup schedule
updatedAt: Date
}- Auto-Expiry: All data automatically deleted after 24 hours
- Unique Keywords: Random word generation prevents guessing
- CORS Protection: Configured for secure cross-origin requests
- File Type Validation: Handled by Cloudinary
- Temporary Storage: Local files deleted immediately after upload
The frontend is configured for Vercel deployment with:
vercel.jsonfor routing_redirectsfor SPA support
- Update the API_URL in
SimpleShareAny.tsx - Ensure environment variables are set
- MongoDB and Cloudinary services are accessible
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the ISC License.
- Radix UI for accessible components
- Cloudinary for file storage
- MongoDB for database
- Vercel for frontend hosting
Note: This is a temporary sharing service. Do not upload sensitive or important files as they will be automatically deleted after 24 hours.