Skip to content

Shubhamkahar196/SecureSharing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SecureSharing πŸ”

A modern, secure file sharing platform built with React and Node.js that allows users to share files with advanced security features including password protection, expiration dates, and view limits.

✨ Features

πŸ”’ Security First

  • Password Protection: Secure your files with custom passwords
  • Expiration Dates: Set automatic file expiration
  • View Limits: Control how many times files can be accessed
  • JWT Authentication: Secure user authentication system
  • Unique Share Links: UUID-based sharing links with 122 bits of entropy

🎨 Modern UI/UX

  • Responsive Design: Works seamlessly on desktop and mobile
  • Dark/Light Mode: Toggle between themes
  • Tailwind CSS: Modern, utility-first styling
  • Smooth Animations: Enhanced user experience with CSS animations
  • Intuitive Interface: Clean and user-friendly design

πŸ“ File Management

  • Multiple File Types: Support for images, videos, documents, and more
  • Drag & Drop Upload: Easy file uploading interface
  • File Preview: View file information before sharing
  • Bulk Operations: Manage multiple files efficiently
  • Real-time Updates: Live file status updates

πŸš€ Live Demo

πŸ› οΈ Tech Stack

Frontend

  • React 19 - Modern React with latest features
  • Vite - Fast build tool and development server
  • Tailwind CSS - Utility-first CSS framework
  • React Router - Client-side routing
  • Axios - HTTP client for API calls
  • Context API - State management

Backend

  • Node.js - JavaScript runtime
  • Express.js - Web application framework
  • MongoDB - NoSQL database
  • Mongoose - MongoDB object modeling
  • JWT - JSON Web Tokens for authentication
  • Bcrypt - Password hashing
  • Multer - File upload handling
  • CORS - Cross-origin resource sharing

πŸ“‹ Prerequisites

Before running this project, make sure you have:

  • Node.js (v16 or higher)
  • npm or yarn
  • MongoDB (local installation or MongoDB Atlas)
  • Git

⚑ Quick Start

1. Clone the Repository

git clone https://github.com/Shubhamkahar196/SecureSharing.git
cd SecureSharing

2. Backend Setup

cd backend
npm install

# Create .env file
cp .env.example .env
# Edit .env with your configuration

3. Frontend Setup

cd ../frontend
npm install

4. Environment Variables

Create a .env file in the backend directory:

# Database
MONGODB_URI=mongodb://localhost:27017/securesharing
# or use MongoDB Atlas
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/securesharing

# JWT Secret
JWT_SECRET=your-super-secret-jwt-key-here

# Server Port
PORT=5000

# File Upload Settings
MAX_FILE_SIZE=10485760  # 10MB in bytes
UPLOAD_PATH=./uploads

5. Run the Application

Start Backend (Terminal 1):

cd backend
npm start

Start Frontend (Terminal 2):

cd frontend
npm run dev

The application will be available at:

  • Frontend: http://localhost:5173
  • Backend API: http://localhost:5000

πŸ“ Project Structure

SecureSharing/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── db.js              # Database configuration
β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ authController.js  # Authentication logic
β”‚   β”‚   β”œβ”€β”€ fileController.js  # File management logic
β”‚   β”‚   └── viewController.js  # File viewing logic
β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   └── authMiddleware.js  # JWT authentication middleware
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ User.js           # User model
β”‚   β”‚   └── File.js           # File model
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ authRoutes.js     # Authentication routes
β”‚   β”‚   β”œβ”€β”€ fileRoutes.js     # File management routes
β”‚   β”‚   └── viewRoutes.js     # File viewing routes
β”‚   β”œβ”€β”€ uploads/              # File storage directory
β”‚   β”œβ”€β”€ .env                  # Environment variables
β”‚   β”œβ”€β”€ package.json
β”‚   └── server.js             # Main server file
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/       # Reusable React components
β”‚   β”‚   β”œβ”€β”€ context/          # React Context providers
β”‚   β”‚   β”œβ”€β”€ pages/            # Page components
β”‚   β”‚   β”œβ”€β”€ services/         # API service functions
β”‚   β”‚   β”œβ”€β”€ App.jsx           # Main App component
β”‚   β”‚   └── main.jsx          # Entry point
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.js        # Vite configuration
└── README.md

πŸ”§ API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • GET /api/auth/me - Get current user info

File Management

  • POST /api/files/upload - Upload a file
  • GET /api/files/my-files - Get user's files
  • DELETE /api/files/:id - Delete a file

File Viewing

  • GET /api/view/:shareLink - Get file information
  • POST /api/view/:shareLink/access - Access/download file

πŸš€ Deployment

Frontend (Render)

  1. Connect your GitHub repository to Render
  2. Set build command: npm install && npm run build
  3. Set publish directory: ./dist

Backend (Render)

  1. Connect your GitHub repository to Render
  2. Set build command: npm install
  3. Set start command: npm start
  4. Add environment variables in Render dashboard

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ž Support

For support and questions:

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Built with modern web technologies
  • Inspired by the need for secure file sharing
  • Thanks to the open-source community

Made with ❀️ by Shubham Kahar

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors