How allweonedev/presentation-ai works
Based on our analysis of the file tree and the README, this project is an open-source, full-stack AI-powered presentation generator built with Next.js and React. Its key purpose is to generate, edit, and present slides using AI technologies, integrating multiple services such as OpenAI for content generation, Together AI for image generation, and NextAuth for authentication. The project is structured as a modern full-stack web application with clearly separated concerns.
Main Components
• Frontend Application: Built using Next.js and React. It includes pages (under src/app) for dashboard, authentication, presentation creation, editing, and viewing. There is an extensive folder structure devoted to components for presentation editing (custom elements, outline, theme, text editor using Plate Editor), drag-and-drop functionality, and various UI parts (in src/components/ui).
• Backend/API: The application leverages Next.js API routes (in src/app/api) for authentication (NextAuth routes), presentation generation (including outline and slide generation), image generation (UploadThing), and file handling.
• Server-side Logic: Under src/server, code handles authentication, database connectivity, and other server-related utilities. There is also integration with Next.js middleware (src/middleware.ts).
• Database Layer: Managed by Prisma (prisma/schema.prisma) which integrates with a PostgreSQL database.
• External Services:
• AI Content Generation via the OpenAI API.
• Image Generation via the Together AI API.
• Authentication integrations with Google (via NextAuth).
• File Uploads handled by UploadThing.
• State and Context Management: The project employs multiple React hooks (in src/hooks) and state management (in src/states) along with several context providers (in src/provider) that wrap the application to supply configuration and theme data.
Out the Relationships and Interactions
• Client (Browser) interacts with the Frontend Application to request pages and functionality.
• Frontend components, including specialized editors and UI elements, communicate with API routes (for tasks like generating outlines or presentations) through HTTP requests and via Next.js server-side functions.
• API endpoints serve as the bridge between the frontend and backend server logic. They coordinate authentication (using NextAuth), initiate AI-content generation, manage file uploads, and interact with the PostgreSQL database through Prisma.
• The server-side code (in src/server) handles business logic tasks, server configuration, and interacts with external APIs.
• External services (OpenAI, Together AI, Google OAuth, UploadThing) are directly integrated within the API logic and during client-side interactions (e.g., triggering image generation or handling sign-in flows).
Architectural Patterns and Important Technologies
• Framework/Library Choices: Next.js for server-side rendering and routing, React for UI, and TypeScript for static typing.
• Component-based Architecture: The frontend is modularized into many reusable components (e.g., presentation editor, theme selectors, drag-and-drop elements, text editors) that demonstrate separation of concerns.
• API and Server Abstraction: Use of Next.js API routes to encapsulate backend logic and separate presentation layers from service/API integrations.
• External Service Integration: Distinct services are used for content and image generation, authentication, and file uploads.
• Drag-and-Drop and Rich Text Editing: Specialized components and hooks (under src/components/presentation/editor and src/components/text-editor) indicate advanced front–end interactions using libraries like DND Kit and Plate Editor.
• From Frontend to API (HTTP requests for generating presentations, authentication, etc.).
• From API to External Services (for AI and image generation).
• From API to Database (via Prisma).
• UI Components (e.g., rectangles for pages and components).
• Data Storage (e.g., database symbols for PostgreSQL).
• Clearly label providers like NextAuth, Tanstack, and integration points for UploadThing.
• Out the comprehensive directory structure to capture specialized areas – such as the presentation and text editing functionalities – to ensure that every core function (AI generation, customization, real-time editing, authentication) is clearly represented.