A modern, secure file sharing platform built with React and Node.js that allows users to upload, share, and manage files with advanced features like password protection, expiry dates, and QR code generation.
- File Upload: Drag & drop interface for easy file uploads
- Secure Sharing: Generate short links for file sharing
- Password Protection: Protect files with passwords
- Expiry Management: Set automatic expiration dates for files
- QR Code Generation: Generate QR codes for easy mobile sharing
- File Preview: Preview files before downloading
- Download Tracking: Monitor download statistics
- User Authentication: Secure login/signup system
- User Dashboard: Comprehensive dashboard with file management
- Profile Management: Update user profile and settings
- File Statistics: Track uploads, downloads, and file types
- Cloud Storage: Files stored securely on Cloudinary
- Multiple File Types: Support for images, videos, documents, and more
- Email Sharing: Send file links via email
- File Search: Search through uploaded files
- Responsive Design: Works seamlessly on desktop and mobile
- Real-time Updates: Live dashboard updates
- React 18 - Modern UI framework
- Vite - Fast build tool and dev server
- Redux Toolkit - State management
- React Router - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- React Dropzone - Drag & drop file uploads
- React Icons - Icon library
- React Toastify - Toast notifications
- Axios - HTTP client
- Node.js - JavaScript runtime
- Express.js - Web framework
- MongoDB - NoSQL database
- Mongoose - MongoDB ODM
- JWT - Authentication tokens
- bcryptjs - Password hashing
- Multer - File upload middleware
- Cloudinary - Cloud storage service
- Nodemailer - Email functionality
- QRCode - QR code generation
- ShortID - Short URL generation
- Node.js (v16 or higher)
- MongoDB
- Cloudinary account
-
Clone the repository
git clone <repository-url> cd filesharing/server
-
Install dependencies
npm install
-
Environment Configuration Create a
.envfile in the server directory:PORT=5000 MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret CLIENT_URL=http://localhost:5173 BASE_URL=http://localhost:5000 CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret EMAIL_USER=your_email@gmail.com EMAIL_PASS=your_email_app_password
-
Start the server
npm start
-
Navigate to client directory
cd ../client -
Install dependencies
npm install
-
Start the development server
npm run dev
- Open your browser and navigate to
http://localhost:5173 - Create a new account or sign in
- Access your dashboard to start uploading files
- Click on the "Upload" tab in the dashboard
- Drag and drop files or click to browse
- Configure options:
- Set password protection (optional)
- Set expiry date (optional)
- Click "Upload" to complete the process
- After upload, files appear in your dashboard
- Click on a file to view details
- Copy the generated short link
- Share the link with others
- Optionally generate QR code for mobile sharing
- Recipients click on the shared link
- If password protected, enter the password
- Click download to save the file
filesharing/
βββ client/ # React frontend
β βββ src/
β β βββ components/ # React components
β β β βββ Auth/ # Authentication components
β β β βββ Dashboard/ # Dashboard components
β β β βββ ...
β β βββ redux/ # Redux store and slices
β β βββ config/ # Configuration files
β β βββ ...
β βββ package.json
βββ server/ # Node.js backend
β βββ src/
β β βββ controllers/ # Route controllers
β β βββ models/ # Database models
β β βββ routes/ # API routes
β β βββ middlewares/ # Custom middlewares
β β βββ config/ # Configuration files
β β βββ ...
β βββ package.json
βββ README.md
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logoutGET /api/auth/profile- Get user profile
POST /api/files/upload- Upload filesGET /api/files/user- Get user's filesGET /api/files/:fileId- Get file detailsDELETE /api/files/:fileId- Delete filePUT /api/files/:fileId/status- Update file statusPUT /api/files/:fileId/expiry- Update file expiryPUT /api/files/:fileId/password- Update file passwordPOST /api/files/:fileId/download- Download filePOST /api/files/:fileId/verify-password- Verify file passwordGET /api/files/share/:code- Resolve share link
POST /api/files/:fileId/qr- Generate QR codePOST /api/files/:fileId/email- Send file via emailGET /api/files/search- Search files
- JWT Authentication: Secure token-based authentication
- Password Hashing: Bcrypt encryption for passwords
- File Encryption: Optional password protection for files
- CORS Protection: Cross-origin resource sharing security
- Input Validation: Server-side validation for all inputs
- Rate Limiting: Protection against abuse
- Set up environment variables on your hosting platform
- Deploy to platforms like Heroku, Railway, or DigitalOcean
- Configure MongoDB connection
- Set up Cloudinary credentials
- Build the project:
npm run build - Deploy the
distfolder to platforms like Vercel, Netlify, or GitHub Pages - Update API endpoints in configuration
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit your changes:
git commit -am 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the ISC License.
For support and questions:
- Create an issue in the repository
- Contact the development team
Utpal Kumar
- GitHub: @utpal-kumar-08
- v1.0.0 - Initial release with core file sharing features
- Basic authentication and file management
- Cloud storage integration
- QR code generation
- Email sharing functionality
Built with β€οΈ using React and Node.js