Inspiration 💡

Public speaking is one of the most common fears, and practicing in an empty room or in front of a mirror rarely provides the constructive feedback needed to improve. Often, we rehearse without knowing if our pacing is right, if we are missing critical points on our slides, or if we are using too many filler words. We wanted to bridge this gap by creating an accessible, intelligent, and interactive environment where anyone can practice their presentations and receive instant, actionable feedback. Thus, MockPres (Mock Presentation Simulator) was born—an AI-powered presentation coach that simulates a real audience, whether it's a strict professor, a supportive mentor, or a ruthless venture capitalist.

What it does 🚀

MockPres is a web-based presentation simulator. The user workflow is simple but powerful:

  1. Upload: Users upload their presentation slides in PDF format.
  2. Select Persona: Users choose an AI evaluator (e.g., Sarcastic Professor, VC Investor) or create a custom one.
  3. Present: Users go through their slides one by one, recording their voice as they present.
  4. Instant Grading: The audio is transcribed and compared against the extracted text of the slides.
  5. Dashboard: The user receives a comprehensive breakdown of their performance, including an overall score (calculated as $\frac{\sum \text{criteria scores}}{\text{max score}}$), words-per-minute (WPM), filler word counts, key missed points, and a specific "roast" or feedback tailored to the chosen persona's personality.

The app supports both English and Vietnamese, making it accessible to a wider audience.

How we built it 🛠️

We designed MockPres with a modern, serverless architecture to ensure scalability and fast iteration:

  • Frontend: Built with Next.js (React) and styled with pure CSS modules utilizing a sleek, glassmorphic UI. The frontend handles microphone access, audio blob chunking, and the interactive slide viewer. It is hosted on Vercel.
  • Backend: We used AWS Lambda and API Gateway to create a robust, serverless API. This allowed us to keep costs low while handling intensive processing tasks.
  • Storage: Amazon S3 is used to securely store the uploaded PDFs and the temporary audio .wav files via presigned URLs.
  • AI & Data Processing: The Lambda function uses PyMuPDF to extract text from the slides. We integrated OpenAI's Whisper API for highly accurate speech-to-text transcription and GPT-4 for the intelligent grading engine. By employing advanced prompt engineering, we force the LLM to output structured JSON data containing the scores, criteria breakdowns, and persona-specific feedback.
  • Security: To protect our backend and AI credits, we implemented a lightweight, password-protected gateway using custom x-api-key validation at the AWS API Gateway layer.

Challenges we ran into 🛑

Building a real-time audio and AI processing app came with a unique set of hurdles:

  • Serverless Timeouts: API Gateway has a hard 29-second timeout. Initially, processing a slide (transcribing audio + LLM grading) could exceed this limit. We had to optimize the prompt structure and streamline the pipeline to ensure the Lambda function returns the grading payload before the timeout occurs.
  • CORS and Preflight Headaches: Securing our AWS API Gateway with custom API keys led to complex CORS (Cross-Origin Resource Sharing) issues. We had to carefully configure OPTIONS preflight requests in our Lambda and API Gateway to safely allow the frontend to inject authentication headers without getting blocked by the browser.
  • State Management: Synchronizing the browser's MediaRecorder API with the UI state—ensuring the user doesn't skip slides while audio is still uploading—required careful React hook management (useRef vs useState).
  • Prompt Engineering: Getting an LLM to reliably output strict JSON containing mathematical scores, while simultaneously adopting the persona of a "Ruthless Tech Lead," was surprisingly difficult. It required multiple iterations of system prompts to prevent the AI from breaking character or outputting malformed JSON.

What we learned 🧠

  • Full-Stack AWS Integration: We gained deep, practical experience hooking up a Next.js frontend to a serverless AWS backend, specifically dealing with IAM permissions, presigned S3 URLs, and API Gateway configurations.
  • Advanced React Patterns: We learned how to manage complex asynchronous UI states, such as implementing drag-to-scroll galleries and secure client-side authentication flows.
  • AI Orchestration: We learned how to effectively combine multiple AI models (speech-to-text and text-to-text) to create a cohesive user experience that feels like magic.

What's next for MockPres 🔮

Moving forward, we plan to implement:

  1. Web Extension: Allowing users to practice directly over Google Slides or Canva without having to export to PDF first.
  2. Asynchronous Processing: Transitioning from synchronous API Gateway requests to an event-driven architecture (e.g., AWS SQS + WebSockets) to support incredibly long presentations without timeout fears.
  3. Video Analysis: Integrating computer vision to analyze the user's body language, eye contact, and facial expressions during the presentation.

Built With

Share this project:

Updates