OneDrive ↔ Google Drive Streamer
A secure, high-performance application to stream files bidirectionally between Microsoft OneDrive and Google Drive. Now powered by a Node.js Express backend for reliable server-side streaming and token management.
Features
- <EFBFBD> Bidirectional Transfers: Move files from OneDrive to Google Drive AND Google Drive to OneDrive.
- 🚀 Server-Side Streaming: Files are piped directly between cloud providers on the server, ensuring faster and more reliable transfers for large files.
- <EFBFBD> Secure OAuth 2.0: Implements robust Authorization Code Flow via the backend.
- 📊 Real-time Progress: Track transfer status with live progress updates.
- 📁 File Management: Browse and select files from your connected cloud storage.
Prerequisites
- Node.js (v18 or higher)
- npm or yarn
Setup
1. Clone the repository
git clone <repository-url>
cd <repository-directory>
2. Install Dependencies
You need to install dependencies for both the frontend and the backend.
Frontend:
npm install
Backend:
cd server
npm install
cd ..
3. Configure OAuth Applications
Step A: Microsoft Azure (OneDrive)
- Go to Azure Portal → Azure Active Directory → App registrations
- Click "New registration"
- Fill in:
- Name:
CloudStream Transfer(or any name) - Supported account types: "Accounts in any organizational directory and personal Microsoft accounts"
- Redirect URI: Select "Single-page application (SPA)" and enter:
- Development:
http://localhost:5173/auth/callback - Production:
https://yourdomain.com/auth/callback
- Development:
- Name:
- Click Register
- Copy the Application (client) ID → This is your
VITE_MS_CLIENT_ID - Go to Certificates & secrets → New client secret
- Add a description and expiry
- Copy the Value immediately (shown only once) → This is your
MS_CLIENT_SECRET
- Go to API permissions → Add a permission → Microsoft Graph → Delegated permissions
- Add:
Files.Read,Files.Read.All,Files.ReadWrite,Files.ReadWrite.All,User.Read - Click Grant admin consent (if you're an admin)
- Add:
Step B: Google Cloud (Google Drive)
- Go to Google Cloud Console
- Create a new project or select existing one
- Go to APIs & Services → Enabled APIs & Services
- Click + ENABLE APIS AND SERVICES
- Search for "Google Drive API" and Enable it
- Go to APIs & Services → Credentials
- Click + CREATE CREDENTIALS → OAuth client ID
- If prompted, configure the OAuth consent screen first:
- User Type: External
- App name, support email, developer email (required fields)
- Scopes: Add
https://www.googleapis.com/auth/drive
- If prompted, configure the OAuth consent screen first:
- Back to Credentials → OAuth client ID:
- Application type: Web application
- Name:
CloudStream Transfer - Authorized redirect URIs:
http://localhost:5173/auth/callback(development)https://yourdomain.com/auth/callback(production)
- Click Create
- Copy Client ID → This is your
VITE_GOOGLE_CLIENT_ID - Copy Client Secret → This is your
GOOGLE_CLIENT_SECRET
Step C: Create Environment Files
Frontend (.env in root directory):
VITE_MS_CLIENT_ID=your_microsoft_client_id
VITE_GOOGLE_CLIENT_ID=your_google_client_id
Backend (server/.env):
PORT=9173
# Microsoft (same Client ID as frontend + secret)
VITE_MS_CLIENT_ID=your_microsoft_client_id
MS_CLIENT_SECRET=your_microsoft_client_secret
# Google (same Client ID as frontend + secret)
VITE_GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
# Must match your OAuth app redirect URI
REDIRECT_URI=http://localhost:5173/auth/callback
🔐 Security Note: Client IDs are public (like your app's name). Client Secrets are private and ONLY stored on the backend - never exposed to browsers. Your files are safe!
4. Run the Application
You need to run both the backend server and the frontend client.
Start Backend (Terminal 1):
cd server
npm run dev
Server runs on http://localhost:3001
Start Frontend (Terminal 2):
npm run dev
Frontend runs on http://localhost:5173
Project Structure
/server: Node.js Express Backendsrc/routes: API endpoints (/auth,/transfer)src/services: Cloud provider integration (onedrive.ts,googledrive.ts)
/src: React Frontendcomponents: UI components (Cards, Progress, Alerts)lib/api.ts: API client for communicating with the backendApp.tsx: Main application logic and state management
Technologies
- Frontend: React, TypeScript, Vite, Tailwind CSS, Lucide Icons, Shadcn UI
- Backend: Node.js, Express, TypeScript, Axios, Microsoft Graph Client, Google APIs
Docker & Coolify Deployment
Local Docker
# Build and run with Docker Compose
docker-compose up --build
# Access at http://localhost
Coolify Deployment
From Public Repository
- In Coolify, go to Projects → New → From Git Repository
- Select GitHub/GitLab/Bitbucket and enter the repo URL
- Set Build Pack to
Docker Compose - Configure environment variables in Coolify's UI
From Private Repository
- In Coolify, go to Settings → Private Keys and add your SSH key
- Create new project with Private Repository option
- Use SSH URL:
git@github.com:username/repo.git - Configure environment variables in Coolify's UI
Required Environment Variables (Coolify UI)
| Variable | Description |
|---|---|
VITE_MS_CLIENT_ID |
Microsoft/Azure OAuth Client ID |
MS_CLIENT_SECRET |
Microsoft/Azure OAuth Secret |
VITE_GOOGLE_CLIENT_ID |
Google OAuth Client ID |
GOOGLE_CLIENT_SECRET |
Google OAuth Secret |
REDIRECT_URI |
https://yourdomain.com/auth/callback |
Important
: Update your OAuth app redirect URIs in Azure Portal and Google Cloud Console to match your Coolify domain.
License
ISC