🔑Getting Started

API Keys Setup

Configure Razorpay payments, RazorpayX payouts, and OAuth authentication for Google and GitHub.

Razorpay Payment Gateway

Razorpay handles all payment processing for buyer purchases.

Step 1: Create Razorpay Account

  1. 1. Visit razorpay.com and sign up for a free account
  2. 2. Complete KYC verification (required for live mode)
  3. 3. For testing, you can use test mode without KYC

Step 2: Get API Keys

  1. 1. Log in to Razorpay Dashboard
  2. 2. Go to Settings → API Keys
  3. 3. Click Generate Test Keys or Generate Live Keys
  4. 4. Copy both Key ID and Key Secret

Step 3: Add to Environment Variables

Add to server/.env:

# Razorpay Payment Gateway
RAZORPAY_KEY_ID=rzp_test_your_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret
💡

Test Card Numbers

Card: 4111 1111 1111 1111
CVV: 123
Expiry: 12/28
Name: Test User

RazorpayX Payout System

RazorpayX enables automated bank transfers for seller payouts.

Step 1: Activate RazorpayX

  1. 1. In Razorpay Dashboard, go to RazorpayX section
  2. 2. Click Get Started
  3. 3. Complete business verification
  4. 4. Create a Current Account or use Payout Links

Step 2: Get RazorpayX Credentials

  1. 1. Go to Settings → API Keys in RazorpayX dashboard
  2. 2. Generate API keys for RazorpayX
  3. 3. Note your Account Number from Current Account section

Step 3: Configure Environment

Add to server/.env:

# RazorpayX Payouts
RAZORPAYX_ACCOUNT_NUMBER=your_account_number
RAZORPAYX_KEY_ID=rzp_test_your_razorpayx_key
RAZORPAYX_KEY_SECRET=your_razorpayx_secret
⚠️

Important

RazorpayX requires business verification and may take 2-3 days to activate. Use test mode for development.

Google OAuth Setup

Step 1: Create Google Cloud Project

  1. 1. Go to Google Cloud Console
  2. 2. Create a new project or select existing one
  3. 3. Enable Google+ API

Step 2: Create OAuth Credentials

  1. 1. Go to APIs & Services → Credentials
  2. 2. Click Create Credentials → OAuth Client ID
  3. 3. Select Web Application
  4. 4. Add authorized redirect URI: http://localhost:5000/auth/google/callback
  5. 5. Copy Client ID and Client Secret

Step 3: Configure OAuth

Add to server/.env:

# Google OAuth
GOOGLE_CLIENT_ID=your_google_client_id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=http://localhost:5000/auth/google/callback

GitHub OAuth Setup

Step 1: Create OAuth App

  1. 1. Go to GitHub Settings → Developer settings
  2. 2. Click OAuth Apps → New OAuth App
  3. 3. Fill in application details:
    • • Application name: BitForge
    • • Homepage URL: http://localhost:3000
    • • Authorization callback URL: http://localhost:5000/auth/github/callback
  4. 4. Click Register Application

Step 2: Get Credentials

  1. 1. Copy the Client ID
  2. 2. Generate a new Client Secret
  3. 3. Save both securely

Step 3: Update Environment

Add to server/.env:

# GitHub OAuth
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
GITHUB_REDIRECT_URI=http://localhost:5000/auth/github/callback

Resend Email (Optional)

Configure Resend for transactional emails like OTP verification, password reset, and notifications.

Setup Steps

  1. 1. Sign up at resend.com
  2. 2. Verify your domain or use Resend's test domain
  3. 3. Go to API Keys section
  4. 4. Create a new API key
# Resend Email
RESEND_API_KEY=re_your_resend_api_key
RESEND_FROM_EMAIL='BitForge <no-reply@bittforge.in>'

Verify Configuration

Test your API keys to ensure everything is configured correctly:

cd server
node test-api.js

This script will test all API connections and report any issues.

Next Steps