### Local Development Setup Commands Source: https://context7.com/dileep01712/promptslide/llms.txt Provides the command-line instructions to clone the repository, install dependencies, generate the Prisma client, and start the development servers for both backend and frontend. ```bash git clone https://github.com/Dileep01712/PromptSlide.git cd backend pip install -r requirements.txt npx prisma generate uvicorn main:app --reload cd ../frontend npm install npm run dev ``` -------------------------------- ### Setup PromptSlide Frontend with Node.js and npm Source: https://github.com/dileep01712/promptslide/blob/main/README.md Installs frontend dependencies using npm and starts the development server for the frontend. The frontend runs on http://localhost:5173. ```bash cd frontend npm install npm run dev ``` -------------------------------- ### Setup PromptSlide Backend with Python and Uvicorn Source: https://github.com/dileep01712/promptslide/blob/main/README.md Installs backend dependencies using pip and starts the backend server using Uvicorn. The backend is required for full features and runs on http://localhost:8000. ```bash cd backend pip install -r requirements.txt uvicorn main:app --reload ``` -------------------------------- ### Local Development Setup Source: https://context7.com/dileep01712/promptslide/llms.txt Instructions for setting up and running the PromptSlide application locally, including backend and frontend. ```APIDOC ## Local Development Setup Complete setup instructions for running the PromptSlide application locally with both backend and frontend servers. ### Steps 1. **Clone the repository**: ```bash git clone https://github.com/Dileep01712/PromptSlide.git cd PromptSlide ``` 2. **Setup Backend**: ```bash cd backend pip install -r requirements.txt npx prisma generate uvicorn main:app --reload # Backend runs at http://localhost:8000 ``` 3. **Setup Frontend** (in a new terminal): ```bash cd frontend npm install npm run dev # Frontend runs at http://localhost:5173 ``` 4. **Optional: Prisma Studio**: ```bash npx prisma studio # Opens at http://localhost:5555 ``` 5. **API Documentation Access**: - Swagger UI: `http://localhost:8000/docs` - ReDoc: `http://localhost:8000/redoc` ``` -------------------------------- ### Initialize Prisma Studio for Database Management Source: https://github.com/dileep01712/promptslide/blob/main/README.md Starts Prisma Studio, a GUI tool for viewing and managing the project's database. This command is run from the backend directory. ```bash npx prisma studio ``` -------------------------------- ### Clone PromptSlide Repository Source: https://github.com/dileep01712/promptslide/blob/main/README.md Clones the PromptSlide project repository from GitHub and navigates into the project directory. This is the first step for local setup. ```bash git clone https://github.com/Dileep01712/PromptSlide.git cd PromptSlide ``` -------------------------------- ### GET /api/user/get-pptx Source: https://context7.com/dileep01712/promptslide/llms.txt Retrieves the most recently generated PowerPoint presentation file. ```APIDOC ## GET /api/user/get-pptx ### Description Returns the most recently generated PowerPoint presentation file for download. ### Method GET ### Endpoint /api/user/get-pptx ### Response #### Success Response (200) - **file** (binary) - The PPTX file content. #### Response Example Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation ``` -------------------------------- ### GET /api/user/convert-ppt-to-pdf Source: https://context7.com/dileep01712/promptslide/llms.txt Converts the latest generated PPTX file to PDF format. ```APIDOC ## GET /api/user/convert-ppt-to-pdf ### Description Converts the latest generated PPTX file to PDF format using LibreOffice headless mode. Files are automatically deleted after 30 minutes. ### Method GET ### Endpoint /api/user/convert-ppt-to-pdf ### Response #### Success Response (200) - **file** (binary) - The PDF file content. #### Response Example Content-Type: application/pdf ``` -------------------------------- ### GET /api/user/details Source: https://context7.com/dileep01712/promptslide/llms.txt Retrieves the authenticated user's profile information. ```APIDOC ## GET /api/user/details ### Description Retrieves the authenticated user's profile information using the JWT token from the Authorization header. ### Method GET ### Endpoint /api/user/details ### Parameters #### Headers - **Authorization** (string) - Required - Bearer ### Response #### Success Response (200) - **firstName** (string) - User first name - **email** (string) - User email ``` -------------------------------- ### Environment Configuration Source: https://context7.com/dileep01712/promptslide/llms.txt Lists the required environment variables for running the PromptSlide backend server. ```APIDOC ## Environment Configuration Required environment variables for running the PromptSlide backend server with all features enabled. ### Variables - **DATABASE_URL** (string) - Required - MongoDB connection string. - **JWT_SECRET** (string) - Required - Secret key for JWT authentication. - **GROQ_API_KEY** (string) - Required - API key for Groq LLM service. - **GOOGLE_CLIENT_ID** (string) - Required - Client ID for Google OAuth. - **GOOGLE_CLIENT_SECRET** (string) - Required - Client secret for Google OAuth. - **GOOGLE_TOKEN_URL** (string) - Required - Token URL for Google OAuth. ``` -------------------------------- ### Generate Presentation via AI Service Source: https://context7.com/dileep01712/promptslide/llms.txt Demonstrates how to invoke the presentation generation service. It uses the Groq API to process topic, tone, and language parameters to create a structured PPTX file. ```python from app.services.text_generator import generate_presentation_from_content generate_presentation_from_content( title="Climate Change Solutions", tone="Professional", language="English", num_slides=6, index=0 ) ``` -------------------------------- ### POST /api/user/signup/google Source: https://context7.com/dileep01712/promptslide/llms.txt Registers a new user using Google OAuth authentication. ```APIDOC ## POST /api/user/signup/google ### Description Registers a new user using Google OAuth authentication by exchanging an authorization code for tokens. ### Method POST ### Endpoint /api/user/signup/google ### Request Body - **auth_code** (string) - Required - Google OAuth authorization code - **redirect_uri** (string) - Required - Redirect URI used in OAuth flow ### Request Example { "auth_code": "4/0AX4XfWh...", "redirect_uri": "http://localhost:5173" } ### Response #### Success Response (200) - **id** (string) - User ID - **firstName** (string) - User first name - **email** (string) - User email - **refresh_token** (string) - JWT refresh token ``` -------------------------------- ### Configure Environment Variables Source: https://context7.com/dileep01712/promptslide/llms.txt Lists the essential environment variables required for the backend, including database connection strings, authentication secrets, and API keys for LLM integration. ```bash DATABASE_URL="mongodb+srv://username:password@cluster.mongodb.net/promptslide" JWT_SECRET="your-secure-jwt-secret-key" GROQ_API_KEY="gsk_your_groq_api_key" GOOGLE_CLIENT_ID="your-google-client-id.apps.googleusercontent.com" GOOGLE_CLIENT_SECRET="your-google-client-secret" ``` -------------------------------- ### POST /api/user/signup Source: https://context7.com/dileep01712/promptslide/llms.txt Registers a new user account using email and password. ```APIDOC ## POST /api/user/signup ### Description Registers a new user account with email and password, storing credentials securely with bcrypt hashing. Returns user details and a JWT refresh token. ### Method POST ### Endpoint /api/user/signup ### Request Body - **user** (object) - Required - User registration details - **firstName** (string) - Required - **lastName** (string) - Required - **email** (string) - Required - **password** (string) - Required ### Request Example { "user": { "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "password": "securePassword123" } } ### Response #### Success Response (200) - **id** (string) - User ID - **firstName** (string) - User first name - **lastName** (string) - User last name - **email** (string) - User email - **refresh_token** (string) - JWT refresh token ``` -------------------------------- ### Convert Presentation to PDF API Source: https://context7.com/dileep01712/promptslide/llms.txt Converts the latest generated PPTX file to PDF format using LibreOffice headless mode. Files are automatically cleaned up after 30 minutes. ```bash curl -X GET http://localhost:8000/api/user/convert-ppt-to-pdf -o "presentation.pdf" ``` -------------------------------- ### PowerPoint Generation Service Source: https://context7.com/dileep01712/promptslide/llms.txt Creates professional presentations using the python-pptx library. Supports customizable templates and structured slide content. ```python from app.services.pptx_generator import create_presentation presentation_data = {"title": "Quarterly Sales Report", "slides": [...]} create_presentation(presentation_data, template_index=0) ``` -------------------------------- ### POST /api/user/user_input Source: https://context7.com/dileep01712/promptslide/llms.txt Generates a PowerPoint presentation based on user inputs. ```APIDOC ## POST /api/user/user_input ### Description Generates a PowerPoint presentation from user inputs including topic, tone, language, and optional file upload. ### Method POST ### Endpoint /api/user/user_input ### Parameters #### Request Body (Multipart Form Data) - **title** (string) - Required - Presentation title - **tone** (string) - Required - Professional, Creative, Casual, or Formal - **language** (string) - Required - Language of the presentation - **num_slides** (integer) - Required - Number of slides - **style** (integer) - Required - Template style index - **file** (file) - Optional - PDF or DOCX file for content enhancement ### Request Example curl -X POST http://localhost:8000/api/user/user_input \ -F "title=Quarterly Business Review" \ -F "tone=Formal" \ -F "language=English" \ -F "num_slides=10" \ -F "style=2" \ -F "file=@/path/to/report.pdf" ### Response #### Success Response (200) - **message** (string) - Confirmation message ``` -------------------------------- ### POST /api/user/login/google Source: https://context7.com/dileep01712/promptslide/llms.txt Authenticates an existing user via Google OAuth. ```APIDOC ## POST /api/user/login/google ### Description Authenticates an existing user via Google OAuth and returns user data with a JWT refresh token. ### Method POST ### Endpoint /api/user/login/google ### Request Body - **auth_code** (string) - Required - Google OAuth authorization code - **redirect_uri** (string) - Required - Redirect URI ### Request Example { "auth_code": "4/0AX4XfWh...", "redirect_uri": "http://localhost:5173" } ### Response #### Success Response (200) - **id** (string) - User ID - **firstName** (string) - User first name - **email** (string) - User email - **refresh_token** (string) - JWT refresh token ``` -------------------------------- ### POST /api/user/login Source: https://context7.com/dileep01712/promptslide/llms.txt Authenticates an existing user via email and password. ```APIDOC ## POST /api/user/login ### Description Authenticates an existing user with email and password credentials and returns a JWT refresh token. ### Method POST ### Endpoint /api/user/login ### Request Body - **user** (object) - Required - Login credentials - **email** (string) - Required - **password** (string) - Required ### Request Example { "user": { "email": "john.doe@example.com", "password": "securePassword123" } } ### Response #### Success Response (200) - **id** (string) - User ID - **firstName** (string) - User first name - **email** (string) - User email - **refresh_token** (string) - JWT refresh token ``` -------------------------------- ### Generate Presentation API Source: https://context7.com/dileep01712/promptslide/llms.txt Generates a PowerPoint presentation based on user-defined parameters. Supports optional file uploads (PDF/DOCX) which are processed via FAISS for content enhancement. ```bash curl -X POST http://localhost:8000/api/user/user_input \ -F "title=Introduction to Machine Learning" \ -F "tone=Professional" \ -F "language=English" \ -F "num_slides=7" \ -F "style=0" curl -X POST http://localhost:8000/api/user/user_input \ -F "title=Quarterly Business Review" \ -F "tone=Formal" \ -F "language=English" \ -F "num_slides=10" \ -F "style=2" \ -F "file=@/path/to/quarterly_report.pdf" ``` -------------------------------- ### AI Text Generation Service Source: https://context7.com/dileep01712/promptslide/llms.txt This service uses the Groq API with the LLaMA 3 model to generate structured presentation content based on user inputs and retrieved context. ```APIDOC ## AI Text Generation Service The text generator service uses the Groq API with LLaMA 3 model to generate structured presentation content based on user inputs and retrieved context from the vector database. ### Method `POST` (Implied by function call, actual endpoint not specified) ### Endpoint `/generate_presentation` (Hypothetical endpoint for the service) ### Parameters #### Request Body - **title** (string) - Required - The topic for the presentation. - **tone** (string) - Optional - The desired tone of the presentation (e.g., "Professional", "Creative", "Casual"). Defaults to "Professional". - **language** (string) - Optional - The output language for the presentation. Defaults to "English". - **num_slides** (integer) - Optional - The number of content slides (excluding the title slide). Defaults to a reasonable number if not specified. - **index** (integer) - Optional - The template style index (0-5). Defaults to 0. ### Request Example ```json { "title": "Climate Change Solutions", "tone": "Professional", "language": "English", "num_slides": 6, "index": 0 } ``` ### Response #### Success Response (200) - **presentation_path** (string) - The file path to the generated PPTX presentation. #### Response Example ```json { "presentation_path": "app/presentations/ppt/Climate Change Solutions.pptx" } ``` ``` -------------------------------- ### Register User via Google OAuth API Source: https://context7.com/dileep01712/promptslide/llms.txt Registers a new user using Google OAuth. It exchanges an authorization code for tokens and verifies the identity to create a passwordless account. ```bash curl -X POST http://localhost:8000/api/user/signup/google \ -H "Content-Type: application/json" \ -d '{ "auth_code": "4/0AX4XfWh...", "redirect_uri": "http://localhost:5173" }' ``` -------------------------------- ### Register User via Email API Source: https://context7.com/dileep01712/promptslide/llms.txt Registers a new user account using email and password. Credentials are hashed with bcrypt and stored in MongoDB, returning user details and a 7-day JWT refresh token. ```bash curl -X POST http://localhost:8000/api/user/signup \ -H "Content-Type: application/json" \ -d '{ "user": { "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "password": "securePassword123" } }' ``` -------------------------------- ### Download Generated Presentation API Source: https://context7.com/dileep01712/promptslide/llms.txt Retrieves the most recently generated PowerPoint file. The endpoint returns a binary file with appropriate MIME type headers. ```bash curl -X GET http://localhost:8000/api/user/get-pptx -o "presentation.pptx" ``` -------------------------------- ### Configure ESLint for Type-Aware Linting in JavaScript Source: https://github.com/dileep01712/promptslide/blob/main/frontend/README.md This JavaScript snippet shows how to configure ESLint's parserOptions to enable type-aware linting rules for TypeScript projects. It specifies the necessary `project` files and `tsconfigRootDir` for the ESLint parser to correctly interpret the TypeScript configuration. ```javascript export default { // other rules... parserOptions: { ecmaVersion: 'latest', sourceType: 'module', project: ['./tsconfig.json', './tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: __dirname, }, } ``` -------------------------------- ### Retrieve User Profile API Source: https://context7.com/dileep01712/promptslide/llms.txt Fetches the profile information for the currently authenticated user. Requires a valid JWT token passed in the Authorization header. ```bash curl -X GET http://localhost:8000/api/user/details \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ``` -------------------------------- ### Authenticate User via Email API Source: https://context7.com/dileep01712/promptslide/llms.txt Authenticates existing users by verifying email and password against stored bcrypt hashes. Returns a JWT refresh token upon successful login. ```bash curl -X POST http://localhost:8000/api/user/login \ -H "Content-Type: application/json" \ -d '{ "user": { "email": "john.doe@example.com", "password": "securePassword123" } }' ``` -------------------------------- ### Database Schema (Prisma) Source: https://context7.com/dileep01712/promptslide/llms.txt Defines the User model using Prisma for MongoDB, supporting both traditional and Google OAuth authentication. ```APIDOC ## Database Schema (Prisma) The application uses Prisma with MongoDB for user data persistence. The schema defines a User model with an optional password field to support both traditional and Google OAuth authentication. ### Model: User #### Fields - **id** (String) - Required - MongoDB ObjectId, primary key. - **firstName** (String) - Required - User's first name. - **lastName** (String) - Required - User's last name. - **email** (String) - Required - User's email address, unique. - **password** (String) - Optional - User's password, used for traditional authentication. Null for OAuth users. ``` -------------------------------- ### Authenticate User via Google OAuth API Source: https://context7.com/dileep01712/promptslide/llms.txt Authenticates existing users using Google OAuth. It validates the ID token and returns user profile data along with a JWT refresh token. ```bash curl -X POST http://localhost:8000/api/user/login/google \ -H "Content-Type: application/json" \ -d '{ "auth_code": "4/0AX4XfWh...", "redirect_uri": "http://localhost:5173" }' ``` -------------------------------- ### Define User Model with Prisma Source: https://context7.com/dileep01712/promptslide/llms.txt Defines the MongoDB user schema using Prisma. It includes support for both standard password-based authentication and Google OAuth by making the password field optional. ```prisma model User { id String @id @default(auto()) @map("_id") @db.ObjectId firstName String lastName String email String @unique password String? } ``` -------------------------------- ### Presentation Data Structure Schema Source: https://context7.com/dileep01712/promptslide/llms.txt Defines the JSON structure used by the AI to generate slide content, including titles, subtitles, and individual slide objects. ```json { "title": "Introduction to Machine Learning", "subtitle": "A comprehensive overview of ML concepts and applications", "slides": [ { "id": 1, "title": "What is Machine Learning?", "content": "Machine Learning is a subset of artificial intelligence..." } ] } ``` -------------------------------- ### FAISS Vector Database Operations Source: https://context7.com/dileep01712/promptslide/llms.txt Manages document embeddings for semantic search. Supports adding chunks, searching by topic, and clearing the index. ```python from app.services.faiss_vector_db import add_to_vector_db, search_in_vector_db, clear_vector_db chunks = ["Machine learning algorithms learn from data patterns."] add_to_vector_db(chunks) related_key_points = search_in_vector_db("Introduction to Neural Networks", top_k=10) clear_vector_db() ``` -------------------------------- ### Text Extraction and Processing Utility Source: https://context7.com/dileep01712/promptslide/llms.txt Extracts raw text from PDF or DOCX files, cleans the content, and splits it into chunks for vector database storage. ```python from app.utils.text_processing import extract_text_from_file, clean_text, chunk_text file_path = "app/uploads/document.pdf" extracted_content = extract_text_from_file(file_path) cleaned_text = clean_text(extracted_content) text_chunks = chunk_text(cleaned_text, max_chunk_size=500) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.