UNPKG

gmail-to-exchange365

Version:

Complete Gmail to Exchange 365 migration tool with UI - Migrate emails, attachments, and folders seamlessly

89 lines (64 loc) 2.52 kB
# 🚀 Quick Setup Guide ## Step 1: Install Dependencies ```bash npm install ``` ## Step 2: Create .env File Create a `.env` file in the root directory with the following content: ```env # Google OAuth Credentials GOOGLE_CLIENT_ID=your_google_client_id_here GOOGLE_CLIENT_SECRET=your_google_client_secret_here GOOGLE_REDIRECT=http://localhost:3000/google/callback # Microsoft OAuth Credentials MS_CLIENT_ID=your_ms_client_id_here MS_CLIENT_SECRET=your_ms_client_secret_here MS_TENANT_ID=common MS_REDIRECT=http://localhost:3000/ms/callback # Session Configuration SESSION_SECRET=generate_a_random_string_here # Server Configuration PORT=3000 ``` ## Step 3: Get Google OAuth Credentials 1. Visit [Google Cloud Console](https://console.cloud.google.com/) 2. Create a new project (or select existing) 3. Enable **Gmail API** 4. Go to **APIs & Services****Credentials** 5. Click **Create Credentials****OAuth 2.0 Client ID** 6. Choose **Web application** 7. Add redirect URI: `http://localhost:3000/google/callback` 8. Copy **Client ID** and **Client Secret** to `.env` ## Step 4: Get Microsoft OAuth Credentials 1. Visit [Azure Portal](https://portal.azure.com/) 2. Go to **Azure Active Directory****App registrations** 3. Click **New registration** 4. Set name and redirect URI: `http://localhost:3000/ms/callback` 5. Go to **API permissions****Add a permission****Microsoft Graph** 6. Add these **Delegated permissions**: - `Mail.Read` - `Mail.ReadWrite` - `MailboxSettings.ReadWrite` - `offline_access` 7. Click **Grant admin consent** (if you have admin rights) 8. Go to **Certificates & secrets****New client secret** 9. Copy **Application (client) ID** and **Client secret** to `.env` ## Step 5: Generate Session Secret Generate a random string for `SESSION_SECRET`: ```bash # On Linux/Mac: openssl rand -base64 32 # On Windows (PowerShell): [Convert]::ToBase64String((1..32 | ForEach-Object { Get-Random -Maximum 256 })) ``` Or use any random string generator. ## Step 6: Run the Application ```bash npm start ``` Then open `http://localhost:3000` in your browser. ## Troubleshooting - **"Missing required environment variables"**: Make sure your `.env` file exists and has all variables - **OAuth errors**: Double-check redirect URIs match exactly - **Port already in use**: Change `PORT` in `.env` to a different port For more details, see [README.md](README.md).