Skip to content

hsr88/my-private-drive

Repository files navigation

☁️ MyPrivateDrive (Your Personal Cloud Drive)

A lightweight, private, and free Google Drive alternative. Built with React, Vite, and Firebase.

You control the data, you have access, you own the cloud (up to 5GB free on the Firebase Spark plan).

✨ Features

🔒 Privacy: Access protected by a unique "Space Name" (acts as a password).

📂 Folders: Create directory structures to organize files.

🚀 Smart Upload: Drag & Drop support, multi-file queuing.

📦 Batch Download (ZIP): Download multiple files at once as a generated .zip archive (client-side compression).

📱 Mobile First: Optimized specifically for touch devices (long-press to select/CTRL+LMB on desktop).

👀 Media Preview: Built-in lightbox for images and video player.

📊 Quota Manager: Visual indicator of your storage usage.

🔗 Sharing: Generate direct download links.

🛠️ Installation & Setup

This project is "Serverless". You only need a free Google account and a static hosting provider (e.g., Vercel, Netlify, or Firebase Hosting).

Step 1: Firebase Setup

Go to Firebase Console and create a project.

Authentication: Enable Anonymous sign-in.

Firestore Database: Create a database in production mode.

Storage: Create a bucket for files.

Security Rules: Set rules for Firestore and Storage to:

allow read, write: if request.auth != null;

Step 2: CORS Configuration (Critical for ZIP download)

To allow the app to download files for zipping, you must configure CORS on your Google Cloud Storage bucket.

Open Google Cloud Shell.

Create a configuration file:

cat > cors.json <<EOF
[
  {
    "origin": ["*"],
    "method": ["GET"],
    "maxAgeSeconds": 3600
  }
]
EOF

Apply it to your bucket (replace your-project-id with your actual bucket name):

gsutil cors set cors.json gs://your-project-id.firebasestorage.app

Step 3: Local Development

Clone the repository:

git clone [https://github.com/hsr88/my-private-drive.git](https://github.com/hsr88/my-private-drive.git)
cd my-private-drive

Install dependencies (includes jszip for archiving):

npm install

Create a .env file in the root directory and add your Firebase keys:

VITE_API_KEY=your_api_key
VITE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_PROJECT_ID=your-project
VITE_STORAGE_BUCKET=your-project.firebasestorage.app
VITE_MESSAGING_SENDER_ID=123456789
VITE_APP_ID=1:123456789:web:abcdef

Run the app:

npm run dev

🤝 Contribution

Created by hsr88

About

Your own private cloud storage. Serverless, free, and privacy-first. Built with React & Firebase.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors