Skip to content

sidmax7/pgen2

Repository files navigation

PowerPoint Generator

An AI-powered presentation generator that creates professional Google Slides presentations for courses using Next.js, Google's Gemini API, and the Google Slides API.

Features

  • Document Parsing: Upload course materials and course structure documents in various formats (PDF, DOCX, TXT)
  • Intelligent Session Detection: System automatically identifies session structure from your materials
  • Customizable Presentations: Choose from multiple themes, fonts, and layout options
  • AI-Powered Content Generation: Leverages Google's Gemini API to create high-quality presentation content
  • Google Slides Integration: Automatically creates editable Google Slides presentations
  • Preview & Feedback: Review generated presentations with AI-powered improvement suggestions

How It Works

  1. Upload Documents: Provide your course structure document and supporting materials
  2. Select Session: Choose which session from your course structure to create a presentation for
  3. Customize Design: Select a theme and customize font and layout options
  4. Generate Presentation: AI analyzes your documents and creates a structured presentation
  5. Review & Edit: Preview the presentation, provide feedback, and make adjustments
  6. Access & Share: Open your presentation directly in Google Slides for further editing

Document Format Requirements

The application accepts multiple document formats and intelligently processes them:

Course Structure Document

Your course structure document should contain clear session or module divisions. The system will automatically detect:

  • Session titles and numbers
  • Topics covered in each session
  • Learning objectives or outcomes

Supporting Documents

These can include:

  • Detailed content for each session
  • Examples, case studies, and exercises
  • References and additional resources

Tech Stack

  • Frontend: Next.js 15 with App Router, TypeScript, TailwindCSS
  • AI: Google Gemini API for content generation and analysis
  • Backend: Server-side API routes, Firebase for storage and authentication
  • Presentation: Google Slides API for generating professional slides

Prerequisites

Before you begin, ensure you have:

  1. Node.js 18+ installed
  2. A Firebase project set up
  3. A Google Cloud project with the Slides API and Drive API enabled
  4. A Google Gemini API key
  5. A Google Service Account with access to Google Slides and Drive

Setup

  1. Clone the repository:
git clone https://github.com/yourusername/ppt-generator.git
cd ppt-generator
  1. Install dependencies:
npm install
  1. Create a .env.local file in the root directory with the following variables:
# Firebase Configuration
NEXT_PUBLIC_FIREBASE_API_KEY=your-api-key
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=your-messaging-sender-id
NEXT_PUBLIC_FIREBASE_APP_ID=your-app-id
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=your-measurement-id

# Gemini API Key
NEXT_PUBLIC_GEMINI_API_KEY=your-gemini-api-key

# Google Service Account (Base64 encoded JSON)
GOOGLE_SERVICE_ACCOUNT_KEY=your-base64-encoded-service-account-key
  1. To encode your service account key as base64:
# On Linux/Mac
cat your-service-account.json | base64

# On Windows (PowerShell)
[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes((Get-Content -Raw -Path your-service-account.json)))
  1. Run the development server:
npm run dev
  1. Open http://localhost:3000 in your browser.

Usage Guide

1. Upload Documents

  • Upload your course structure document (syllabus, course outline)
  • Upload supporting materials (lecture notes, resources)
  • The system automatically attempts to identify which document contains the course structure

2. Select Session

  • View a preview of detected sessions from your course structure
  • Select the specific session you want to create a presentation for
  • Alternatively, enter a session number manually

3. Customize Design

  • Choose from professional, academic, creative, minimal, or tech-oriented themes
  • Customize the font family for optimal readability
  • Select a slide layout style that best suits your content

4. Generate Presentation

  • The AI analyzes your documents to extract relevant content for the chosen session
  • Content is structured into a logical flow with appropriate slides
  • Progress is displayed in real-time as your presentation is created

5. Review and Share

  • Preview the generated presentation
  • Receive AI-powered feedback and improvement suggestions
  • Open the presentation directly in Google Slides for further customization
  • Share the presentation with collaborators or students

Firebase Setup

  1. Create a new Firebase project at https://console.firebase.google.com/
  2. Enable Authentication, Firestore, and Storage
  3. Set up Firestore security rules
  4. Create a web app and copy the configuration to your .env.local file

Google Cloud Setup

  1. Create a new project at https://console.cloud.google.com/
  2. Enable the Google Slides API and Google Drive API
  3. Create a service account with the following roles:
    • Google Slides API > Slides Creator
    • Google Drive API > Drive File Creator
  4. Create and download a JSON key for the service account
  5. Encode the JSON key as base64 and add it to your .env.local file

Gemini API Setup

  1. Get a Gemini API key from https://ai.google.dev/
  2. Add the API key to your .env.local file

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors