This project is an Autonomous Generative AI Agent designed to automatically create professional presentations from minimal user input. The system leverages Generative AI, FastAPI, and Google Authentication to provide a secure, scalable, and intelligent solution for presentation creation.
Users can sign up, log in (including via Google OAuth), submit a topic or prompt, and receive a structured, AI-generated presentation outline or content.
-
🔐 Authentication System
- Email & Password Signup/Login
- Google OAuth 2.0 Login (ID Token based)
-
🤖 Generative AI Agent
- Converts prompts into structured presentation content
- Slide-wise logical flow
-
⚡ FastAPI Backend
- High performance REST APIs
- Automatic API documentation with Swagger
-
🗄️ Database Integration
- User management
- Secure token handling
-
🧪 Token Validation Utilities
- Google ID token verification
- Python 3.10+
- FastAPI
- SQLAlchemy
- OAuth 2.0 (Google Authentication)
- JWT
This repository contains a full-stack prototype that generates presentation slides (PowerPoint) from a user prompt using AI agents. The project is split into two main parts:
backend/— FastAPI service that runs agents, handles authentication, generates slides and builds PPTX files.frontend/— Vite + React TypeScript app that provides a UI for signup/login and generating/downloading presentations.
This README documents how to run each part, environment variables, key files, and debugging notes.
- Start backend:
cd backend
python -m venv ../genAI_env # optional: create venv at repo root
# activate venv (Windows)
genAI_env\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000- Start frontend:
cd frontend
npm install
npm run dev
# open http://localhost:8081- Location:
backend/ - Entry:
backend/main.py(FastAPI app) - Important packages:
fastapi,uvicorn,sqlalchemy,python-jose,passlib,httpx,python-dotenv,python-pptx,Pillow. - Requirements: see
backend/requirements.txt.
Key endpoints
POST /auth/signup— create user (returnsaccess_token)POST /auth/login— login (returnsaccess_token)POST /auth/google-login— accept Google ID token and return app tokenPOST /generate_ppt— protected endpoint (requires Bearer JWT) that runs the planning/execution agents and returns a PPTX file.
Authentication
- JWT tokens are issued by the backend (
auth.utils.create_access_token) and validated viaauth.dependencies.get_current_user. - During development the backend accepts tokens via
Authorization: Bearer <token>, and (fallback) viaaccess_tokenquery param orx-access-tokenheader to support browser form downloads.
Important backend files
backend/auth/— authentication routes, models, Google token verification.backend/agents/— planner & executor agents. Images are produced bybackend/agents/executor/image_agent.py(uses OpenAI to craft Unsplash queries and fetches images via Unsplash API).backend/ppt/ppt_builder.py— builds the final PPTX and embeds images (downloads viahttpx).
Environment variables (backend)
GOOGLE_CLIENT_ID— Google OAuth client id (for Google Login flow).OPENAI_API_KEY— OpenAI API key (used by image_agent and LLMs).UNSPLASH_ACCESS_KEY— Unsplash API key for fetching images.JWT_SECRET_KEY,JWT_ALGORITHM,JWT_EXPIRE_MINUTES— JWT config (inbackend/core/config.pyor.env).
Notes on images
- The backend downloads images (Unsplash) during execution and embeds them into the PPTX. If PPTX generated via a fetch/XHR appears to lack images but running the backend independently produces images, try the browser-form fallback (frontend has a small retry) or run the backend locally and invoke
POST /generate_pptdirectly (server-side generation works).
- Location:
frontend/ - Framework: Vite + React + TypeScript
- Entry:
frontend/src/main.tsxand pages underfrontend/src/pages/(notablyLogin.tsx,Register.tsx,Dashboard.tsx). - Env:
frontend/.envcontainsVITE_API_BASE_URL(defaults tohttp://localhost:8000).
Auth & API
- Auth context:
frontend/src/contexts/AuthContext.tsx— manages token +getAuthHeader()helper that returnsAuthorization: Bearer <token>for API calls. - The Dashboard
Generatebutton POSTs to${VITE_API_BASE_URL}/generate_pptwith theAuthorizationheader and downloads the returned PPTX blob. If the blob is unexpectedly small (images missing), frontend triggers a fallback hidden form POST with the token inaccess_tokenquery param to force a normal browser download that matches backend behavior.
Key frontend files
frontend/src/pages/Dashboard.tsx— generation UI and download logic.frontend/src/contexts/AuthContext.tsx— login/register wrappers that call backend/auth/*endpoints and storeaccess_tokeninlocalStorage.
Dev scripts
npm run dev— start Vite dev server (default port in this workspace is8081).
- Start backend on port
8000(see above). - Start frontend on port
8081(see above). - In the app: sign up or sign in (or use Google login flow).
- Open
Dashboard, enter a topic, choose slide count and style, and click Generate Presentation. - The browser will download the generated
.pptx. If images are missing, the frontend will attempt a form-based retry that includes the token in the query string to force a full server-side download.
-
If images are missing in the downloaded PPTX but backend generates images when run standalone:
- Confirm
OPENAI_API_KEYandUNSPLASH_ACCESS_KEYare set and valid in the backend environment. - Start backend locally and call
/generate_pptusingcurlor via browser form to confirm server-produced PPTX contains images. - The frontend includes a fallback (hidden form POST) to handle differences between XHR downloads and full browser downloads.
- Confirm
-
CORS: backend allows CORS from the frontend dev origin (
http://localhost:8081) inbackend/main.py— update if you run the frontend on a different origin.
backend/test_ppt_builder_script.py— quick script to exercise theppt_builderlocally.backend/test_image.py— utilities for testing image fetch logic.
- Keep authentication logic in
frontend/src/contexts/AuthContext.tsxsynced with backend/authroutes. - If you improve image generation reliability, prefer fixing server-side behavior in
backend/agents/executor/image_agent.pyorbackend/ppt/ppt_builder.pyrather than relying on frontend fallbacks.
MIT
If you want this README expanded with examples, OpenAPI summary snippets, or a CONTRIBUTING guide, tell me which sections to expand.
Below are example outputs produced by this project. The images and sample presentation are included in the repository under the Results/ folder so you can preview or download them directly.
These images are representative samples generated and embedded into slides during PPT creation.
You can find additional generated images in the Results/images/ folder.
Download a sample generated presentation to inspect slide layout, embedded images, and notes:
- Start the backend (recommended port
8000):
cd backend
genAI_env\Scripts\activate # or activate your Python venv
pip install -r requirements.txt
uvicorn main:app --reload --port 8000- Start the frontend (recommended port
8081):
cd frontend
npm install
npm run dev
# open http://localhost:8081 in your browser- Generate a presentation via the app UI or call the backend
POST /generate_pptendpoint. Generated slides, embedded images, and output PPTX files are saved under theResults/folder by the test scripts and some local runs.
Notes:
- If images do not appear in a downloaded
.pptx, try generating from the backend directly (server-side generation) or inspectbackend/output/andResults/for logs and saved assets.



