🚀Getting Started

Quick Start Guide

Get BitForge up and running in 15 minutes. This guide walks you through project setup, environment configuration, and your first test transaction.

Prerequisites

Before you begin, make sure you have the following installed:

  • Node.js 18+ and npm/yarn package manager
  • MongoDB (local or MongoDB Atlas)
  • Git for version control
  • Razorpay Account for payments (Sign up here)

1Clone the Repository

Start by cloning the BitForge repository to your local machine:

git clone https://github.com/Swapnil454/BitForge.git
              cd BitForge

2Install Dependencies

Install dependencies for both the server and client:

Server Dependencies

cd server
npm install

Client Dependencies

cd ../client
npm install

3Configure Environment Variables

Create environment files for both server and client:

Server Environment (.env)

Create server/.env file:

# Database
MONGO_URI=mongodb://localhost:27017/bitforge

# Server
PORT=5000
NODE_ENV=development

# JWT
JWT_SECRET=your_super_secret_jwt_key_change_this

# Razorpay
RAZORPAY_KEY_ID=rzp_test_your_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret

# RazorpayX Payouts
RAZORPAYX_ACCOUNT_NUMBER=your_account_number
RAZORPAYX_KEY_ID=rzp_test_your_key_id
RAZORPAYX_KEY_SECRET=your_razorpayx_secret

# OAuth
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=http://localhost:5000/auth/google/callback

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

# Client URL
CLIENT_URL=http://localhost:3000

# Resend (Optional for emails)
RESEND_API_KEY=your_resend_api_key
RESEND_FROM_EMAIL='BitForge <no-reply@bittforge.in>'

Client Environment (.env.local)

Create client/.env.local file:

NEXT_PUBLIC_API_URL=http://localhost:5000
⚠️

Important

Replace the placeholder values with your actual credentials. Never commit sensitive keys to version control. See our API Keys Setup guide for detailed instructions.

4Set Up Database

Ensure MongoDB is running. If using local MongoDB:

# Start MongoDB service
# On Mac (Homebrew):
brew services start mongodb-community

# On Linux:
sudo systemctl start mongod

# On Windows:
# MongoDB runs as a service by default after installation

Or use MongoDB Atlas for a hosted solution.

5Run the Application

Start the Server

cd server
npm run dev

Server will start on http://localhost:5000

Start the Client

In a new terminal:

cd client
npm run dev

Client will start on http://localhost:3000

Success!

Your BitForge instance should now be running. Open http://localhost:3000 in your browser.

6Create an Admin Account

Run the test user creation script to set up admin and test accounts:

cd server
node scripts/createTestUsers.js

This creates three test accounts:

  • 👤 Admin: admin@bitforge.com / password123
  • 💼 Seller: seller@bitforge.com / password123
  • 🛒 Buyer: buyer@bitforge.com / password123

7Test Your First Transaction

Let's test the complete purchase flow:

  1. 1. Sign in as a seller and upload a test product
  2. 2. Sign in as admin and approve the product
  3. 3. Sign in as a buyer and make a purchase using Razorpay test mode
  4. 4. Use Razorpay test card numbers:
    Card Number: 4111 1111 1111 1111
                      CVV: Any 3 digits
                      Expiry: Any future date
                      Name: Any name

Next Steps

Need Help?

Running into issues? Our support team is here to help.