BravePDF - AI-Powered PDF Tool Suite

BravePDF is a comprehensive, AI-powered web application for all your PDF needs. Built with a modern tech stack, it provides a suite of powerful tools ranging from document conversion and optimization to intelligent analysis and interaction. This source code provides a ready-to-deploy, subscription-based SaaS application that you can sell to your own customers.

BravePDF Demo

User Dashboard

BravePDF Demo

Features


Tech Stack


Prerequisites

Before you begin, ensure you have the following accounts and tools set up:

  1. Node.js: v18.x or later.
  2. Firebase Account: To manage users, data, and service credentials.
  3. Google AI (Gemini) API Key: To power the AI features.
  4. Stripe Account: To process subscription payments.
  5. Vercel Account: For easy deployment and hosting.

.env Configuration

Rename the .env.example file to .env.local and fill in your actual environment variables.
Do NOT commit .env.local to version control.

# --- Firebase Client Configuration ---
NEXT_PUBLIC_FIREBASE_API_KEY="AIza..."
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN="your-project-id.firebaseapp.com"
NEXT_PUBLIC_FIREBASE_PROJECT_ID="your-project-id"
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET="your-project-id.appspot.com"
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID="..."
NEXT_PUBLIC_FIREBASE_APP_ID="1:..."

# --- Firebase Admin/Server Configuration ---
FIREBASE_PROJECT_ID="your-project-id"
FIREBASE_CLIENT_EMAIL="firebase-adminsdk-xxx@your-project-id.iam.gserviceaccount.com"
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"

# --- Stripe Configuration ---
STRIPE_SECRET_KEY="sk_test_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."

# --- Google AI (Gemini) Configuration ---
GEMINI_API_KEY="AIza..."

Step-by-Step Setup Instructions

1. Initial Project Setup

  1. Download and extract the source code folder.
  2. Open your terminal, navigate into the project directory, and install dependencies:
    yarn install
  3. Rename .env.example to .env.local:
    mv .env.example .env.local
  4. Fill in your .env.local file with your actual values (see .env Configuration section above).

2. Firebase Configuration

  1. Create a Firebase Project: Go to the Firebase Console and create a new project.
  2. Create a Web App:
  3. Enable Firestore & Authentication:
  4. Create a Service Account:

3. Stripe Configuration

  1. Create Products & Prices:
  2. Get API Keys:
  3. Set Up Webhook:

4. Google AI (Gemini) API Key

  1. Go to Google AI Studio.
  2. Create and copy your API key into GEMINI_API_KEY in .env.local.

Superadmin Access

To gain superadmin access to manage users and analytics:

  1. Sign up for an account using the app's signup page.
  2. Find your user UID in Firebase Authentication section.
  3. In Firestore database, update your user document’s role field from "user" to "superadmin".
  4. Log out and back in; you will now see admin panel access.

Deployment to Vercel or Netlify

Recommended hosting is Vercel, but you may also use Netlify or any other platform that supports Next.js.

  1. Push your source code to a GitHub repository.
  2. Import the repo into your Vercel or Netlify account.
  3. Configure environment variables on your hosting platform exactly as in your local .env.local file.
  4. Trigger a deploy/build. The platform will install dependencies using yarn automatically.
  5. After deployment, update your Stripe webhook endpoint with the production URL provided by your host.

Local Development

To run the application locally:

yarn dev

This will start the app on http://localhost:9002.


Congratulations! Your AI-powered PDF SaaS is now fully configured and ready to be marketed.