CheatCodeIARE is a web-based, AI-powered tool specifically designed to help students automatically generate academic presentations (PPTs) and comprehensive reports (DOCX) effortlessly. Simply by providing a problem statement or a set of questions, the app uses Google's Gemini AI to instantly generate structured, professionally formatted, and exam-ready documents.
- 🔐 Student Login System: Session-based authentication to store student details (Name, Roll No/Student ID) to auto-fill documents.
- 🧠 AI-Powered Content Generation: Uses Google Gemini API (
gemini-flash-latest) to generate highly accurate, academically appropriate content. - 📊 Automated PPT Generation: Instantly generates Presentation slides (.pptx) based on a topic or problem statement.
- 📝 Automated Report Generation: Generates multi-page Word documents (.docx) addressing up to 10 academic questions.
- 🎨 Custom Templates & Master Slides: Uses predefined PPT themes and DOCX templates to ensure professional and consistent formatting.
- 🌙 Student-Friendly UI: Designed with a modern aesthetic optimized for ease of use.
The core functionality of generating PowerPoint presentations involves combining AI response structuring and programmatic slide generation:
- User Input: The student logs in and provides their
Department,Subject, and a specificProblem Statementor topic. - AI Content Structuring:
- The backend constructs a prompt instructing the Gemini AI to generate a presentation outline matching the problem statement.
- The AI outputs a strictly formatted JSON object containing the presentation
title,introduction, 5-7indexitems, 5-7slides(each with a heading and 3-5 bullet points), and aconclusion.
- Slide Assembly (
PptxGenJS):- The application uses the
pptxgenjslibrary to initialize a new PowerPoint presentation. - Slide Masters: Pre-defined master slides are applied to ensure consistent branding, utilizing custom assets (
image1.pngfor title screens,image2.pngfor logos, and a colored footer). - Data Injection: The student's name, roll number, and subject are injected directly into the Title Slide.
- Slide Creation: The app programmatically iterates through the AI-generated JSON content, generating individual slides for the Index, Introduction, Content (bullet points), Conclusion, and finally, a "Thank You" slide.
- The application uses the
- Download: The presentation is compiled into a
.pptxbuffer and sent to the user as a direct download formatted as[StudentName]_AAT.pptx.
Apart from presentations, CheatCodeIARE excels at generating detailed, exam-ready Word documents:
- User Input: The student enters various academic details (Course Title, Semester, Regulation, etc.) along with up to 10 questions.
- Batched AI Processing:
- To ensure high quality, the questions are processed through the Gemini API in batches.
- Strict pacing and formatting rules are applied to generate plain text content that's safe to be injected into a DOCX format, explicitly avoiding unsupported markdown formats and translating structural components (like tables) into basic string representations.
- XML Transformation: The generated markdown text is programmatically parsed and converted directly into Word-compatible XML string constructs (
<w:p>,<w:r>,<w:tbl>, etc.). This ensures smooth paragraphs, structural tables, and proper line breaks. - Template Patching (
docxtemplater&pizzip):- The app reads a base template file (
assets/ReportTemplate.docx). (A utility scriptpatch_template.jsis included to convert{answer}tags to{@answer}tags within the template to allow raw XML injection). - Using
docxtemplater, the app iterates through these placeholders and injects the raw XML content generated in the previous step, alongside the student's personal details.
- The app reads a base template file (
- Download: The generated document is zipped, compressed, and downloaded directly as
[StudentName]_Report.docx.
- Frontend: HTML, Vanilla CSS, JavaScript, EJS
- Backend: Node.js, Express.js
- AI Integration:
@google/generative-ai(Gemini API) - Document APIs:
pptxgenjs(PPTX generation),docxtemplater&pizzip(DOCX template manipulation) - Sessions & Analytics:
express-session,@vercel/analytics - Hosting: Configured for Vercel
- Node.js installed
- Google Gemini API Key
- Clone the repository / download the files.
- Install dependencies:
npm install
- Create a
.envfile in the root directory and add your API key:GEMINI_API_KEY=your_gemini_api_key_here
Start the server:
node index.jsThe application will be running at http://localhost:8080.