How bhaumil111/paperparser works
Project type and purpose
• PaperParser is a full-stack web application whose purpose is to ingest academic PDF papers and output either audio podcasts (via TTS) or PowerPoint slide decks summarizing key points.
File structure
• Top-level directories:
• backend/ – Express.js REST API + Python scripts for PPT generation & helper utilities
• frontend/ – Next.js/TypeScript UI, integrates with Supabase/Firebase for auth & storage
• Key backend subfolders:
• python-scripts/ – handles PPT creation, image extraction, and podcast generation (edge-tts or Google TTS)
• routes/ – upload endpoints used by the frontend
• Key frontend files:
• app/ & components/ – React pages and UI primitives
• lib/ – API abstraction for calling backend, plus Supabase/Firebase configuration
• COMPLETE_SUPABASE_SETUP.md, FIREBASE_SETUP.md – indicate optional auth/storage backends
README
• Confirms architecture: Next.js frontend, Node/Express backend, optional Python dependencies, TTS & PDF parsing libraries, PPTX generator.
• User flow: upload → choose format → process → download/stream.
a. Main components
• User Interface (Next.js frontend)
• Authentication & File Storage (Supabase/Firebase)
• API Gateway (Express.js server)
• Processing Engine (Node modules + Python scripts)
• External Services: PDF parsing library, TTS provider (edge-tts/Google TTS)
• Storage: Generated PPTX/audio files (could be local or cloud storage)
b. Relationships & data flow
1. User uploads PDF via Next.js UI
2. Frontend authenticates user via Supabase/Firebase and stores the PDF
3. Frontend calls Express API /uploads endpoint
4. Express saves file, invokes PDF parsing library to extract text
5. Depending on user choice:
– For PPT: Express calls Python script (generate_ppt.py) → PPTX file returned
– For Podcast: Express passes text to edge-tts/Google TTS module → audio file generated
6. Processed files are stored back to storage (Supabase bucket or local FS)
7. Frontend polls or streams the result for user download/stream
c. Architectural patterns & design principles
– Clear separation of concerns: UI layer, API layer, processing layer
– Micro-workflow for each output format, pluggable via Python scripts or Node modules
– Stateless RESTful endpoints; heavy lifting done in ephemeral worker processes
– Optional externalized auth/storage via Supabase or Firebase
d. Key technologies
– Next.js & React (UI)
– TypeScript (static typing)
– Express.js on Node.js (API)
– Python (PPTX generation scripts)
– edge-tts / Google TTS (podcast)
– PDF parsing library (backend)
– Supabase / Firebase (auth + storage buckets)
Elements
• Rectangles for each component: “Next.js UI,” “Express API,” “Python PPT Generator,” “TTS Engine,” “Supabase Storage,” etc.
• User → UI → API endpoints → processing modules → storage → UI → User
• Frontend (blue)
• Backend/API (green)
• Workers (orange)
• External services & storage (purple)
• Parallelograms for user interface
• Rectangles for servers/processors
Detailed guidance
• Every processing step as a separate node to reflect the Python vs Node pathway
• Error-handling or fallback paths if desired (e.g., Python script failure → API error response)