Skip to content

AI-powered web application that allows authenticated users to generate, refine, and export structured business documents.

Notifications You must be signed in to change notification settings

barveakshat/DocForge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

DocForge AI - Intelligent Document Generation Platform

DocForge AI Version

Create professional documents and presentations with AI-powered section-by-section generation

Features โ€ข Installation โ€ข Usage โ€ข Deployment


๐ŸŽฏ Overview

DocForge AI is a cutting-edge document generation platform that revolutionizes how you create professional Word documents and PowerPoint presentations. Using Meta Llama 3.3 70B Instruct via OpenRouter, it provides intelligent, section-by-section content generation with advanced editing capabilities.

Why DocForge AI?

  • โœจ AI-Powered Generation - Leverages state-of-the-art Llama 3.3 70B model
  • ๐Ÿ“ Section-by-Section Control - Generate and refine individual sections independently
  • ๐ŸŽจ Professional Formatting - Export polished Word docs and PowerPoint slides
  • ๐Ÿ”„ Iterative Refinement - Improve content with natural language instructions
  • ๐Ÿ’ฌ Collaboration Features - Comments, feedback, and revision tracking
  • ๐ŸŽฏ AI Template Suggestions - Let AI suggest document structure based on your topic
  • ๐Ÿ” Secure & Private - Firebase authentication with Google Sign-In support

โœจ Features

Core Capabilities

1. Intelligent Document Creation

  • Word Documents (.docx) - Professional reports, articles, and documentation
  • PowerPoint Presentations (.pptx) - Engaging slides with structured content
  • AI-Suggested Outlines - One-click template generation from your topic
  • Manual Structure Control - Define sections/slides before generation

2. Advanced Editing Suite

  • AI Refinement - Improve sections with prompts like:
    • "Make this more formal and professional"
    • "Convert to bullet points"
    • "Add specific examples and statistics"
    • "Shorten to 150 words"
  • Feedback System - Like/dislike tracking for quality control
  • Comments - Add notes and feedback on individual sections
  • Database Persistence - All changes stored in Firestore

3. Professional Export

  • Word Documents - Proper heading styles, bullet points, bold/italic formatting
  • PowerPoint Slides - Title slides, section dividers, professional layouts
  • Markdown Support - Full markdown parsing in exports
  • Quality Output - Publication-ready documents

4. Project Management

  • Dashboard - View all your projects at a glance
  • History - Access previous projects with all edits preserved
  • Resume Editing - Continue where you left off
  • Multi-User Support - Secure user authentication

๐Ÿ› ๏ธ Tech Stack

Frontend

  • React 18, Vite, TailwindCSS
  • Firebase SDK, Axios, React Router
  • Lucide Icons

Backend

  • FastAPI (Python), Firebase Admin SDK
  • Google Firestore (NoSQL Database)
  • OpenRouter API (Llama 3.3 70B)
  • python-docx, python-pptx

๐Ÿ“‹ Prerequisites

  • Node.js 18+ and npm
  • Python 3.9+
  • Firebase Project (Firestore + Authentication)
  • OpenRouter API Key
  • Git

๐Ÿ”ง Installation

1. Clone Repository

git clone https://github.com/yourusername/docforge-ai.git
cd docforge-ai

2. Backend Setup

cd backend
python -m venv venv
venv\Scripts\activate  # Windows
# source venv/bin/activate  # macOS/Linux

pip install -r requirements.txt

Create backend/.env:

OPENROUTER_API_KEY=your_openrouter_api_key
FIREBASE_SERVICE_ACCOUNT_JSON=path/to/serviceAccount.json
FIRESTORE_PROJECT_ID=your-firebase-project-id
FRONTEND_URL=http://localhost:5173

3. Firebase Configuration

  1. Create Firebase project at console.firebase.google.com
  2. Enable Firestore Database
  3. Enable Authentication (Email/Password + Google)
  4. Generate service account key โ†’ Save as backend/serviceAccount.json

4. Frontend Setup

cd frontend
npm install

Create frontend/.env:

VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id
VITE_API_BASE_URL=http://localhost:8000

5. Get OpenRouter API Key

  1. Visit openrouter.ai
  2. Sign up and add credits
  3. Generate API key
  4. Add to backend/.env

๐ŸŽฎ Usage

Start Development Servers

Terminal 1 - Backend:

cd backend
venv\Scripts\activate
uvicorn main:app --reload

Terminal 2 - Frontend:

cd frontend
npm run dev

Open http://localhost:5173

Creating Your First Document

  1. Sign Up / Login
  2. Dashboard โ†’ "Generate New Document"
  3. Enter Topic (e.g., "Market Analysis of Electric Vehicles")
  4. Select Format (Document or Presentation)
  5. Click "โœจ AI-Suggest Outline" (or manually define structure)
  6. Generate - AI creates content section-by-section
  7. Refine - Improve sections with AI assistance
  8. Export - Download professional document

๐Ÿ“ฆ Project Structure

DocForge/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ main.py              # FastAPI routes
โ”‚   โ”œโ”€โ”€ models.py            # Pydantic models
โ”‚   โ”œโ”€โ”€ ai_client.py        # Llama integration
โ”‚   โ”œโ”€โ”€ firestore_client.py # Database operations
โ”‚   โ”œโ”€โ”€ exporter.py         # Document export
โ”‚   โ”œโ”€โ”€ config.py           # Configuration
โ”‚   โ”œโ”€โ”€ requirements.txt    # Dependencies
โ”‚   โ””โ”€โ”€ .env                # Environment variables
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Dashboard.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Generate.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Editor.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Login.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ context/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ AuthContext.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ api.js
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ firebase.js
โ”‚   โ”‚   โ””โ”€โ”€ App.jsx
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ .env
โ”œโ”€โ”€ .gitignore
โ””โ”€โ”€ README.md

๐Ÿš€ Deployment

Backend (Render, Railway, Fly.io)

  1. Set environment variables:

    OPENROUTER_API_KEY=...
    FIREBASE_SERVICE_ACCOUNT_JSON=...
    FIRESTORE_PROJECT_ID=...
    FRONTEND_URL=https://your-domain.com
    
  2. Start command:

    uvicorn main:app --host 0.0.0.0 --port $PORT
  3. Update CORS in main.py with production URL

Frontend (Vercel, Netlify)

  1. Build:

    npm run build
  2. Set environment variables (all VITE_* vars)

  3. Deploy dist folder

Firestore Security Rules

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /projects/{projectId} {
      allow read, write: if request.auth != null &&
                         resource.data.user_id == request.auth.uid;

      match /sections/{sectionId} {
        allow read, write: if request.auth != null;
      }
    }
  }
}

๐Ÿ“Š API Endpoints

Authentication

  • POST /auth/verify - Verify token

Projects

  • GET /projects - List projects
  • POST /projects - Create project
  • GET /projects/{id} - Get project
  • GET /projects/{id}/content - Get sections

Generation

  • POST /generate-structured-document - Generate with structure
  • POST /projects/generate-outline - AI-suggest outline

Sections

  • POST /projects/{id}/sections/{sid}/refine - Refine section
  • POST /projects/{id}/sections/{sid}/feedback - Like/dislike
  • POST /projects/{id}/sections/{sid}/comment - Add comment

Export

  • GET /projects/{id}/export/{type} - Export document

๐Ÿ”’ Security

  • Firebase Auth with JWT tokens
  • User-based access control
  • Environment variables for secrets
  • CORS configuration
  • Pydantic input validation
  • Firestore security rules

๐Ÿค Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open Pull Request

๐Ÿ“ License

MIT License - see LICENSE file for details


๐Ÿ™ Acknowledgments

  • Meta AI - Llama 3.3 70B
  • OpenRouter - AI model access
  • Firebase - Auth & database
  • FastAPI, React, TailwindCSS

๐Ÿ—บ๏ธ Roadmap

  • PDF export
  • Real-time collaboration
  • Image upload
  • Custom templates
  • Mobile app
  • Multi-language support
  • Voice input

Built with โค๏ธ for modern document creation

โญ Star on GitHub

About

AI-powered web application that allows authenticated users to generate, refine, and export structured business documents.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published