PowerPoint Generator is an API-based project designed to automate the generation of professional slide presentations. It provides endpoints to create, retrieve, configure, and download presentations in PPTX format. The application is structured to ensure modularity and scalability, with a focus on efficient content generation and storage management.
Deployed App Link: https://pptgenerator.onrender.com
- Create Presentations: Generate presentations dynamically via API.
- Retrieve Details: Fetch metadata and configuration details of presentations.
- Download PPTX: Export and download presentations as PowerPoint files.
- Configure Slides: Update presentation configurations for customization.
slide_generator_api/
├── app/
│ ├── __init__.py # Application initialization
│ ├── main.py # Entry point of the API
│ ├── models.py # Database models
│ ├── services/ # Core business logic
│ │ ├── __init__.py
│ │ ├── content_generator.py # Generates content for slides
│ │ └── slide_generator.py # Generates slide layouts
│ ├── utils/ # Utility modules
│ │ ├── __init__.py
│ │ └── storage.py # Handles file storage
│ └── static/
│ └── index.html # HTML template for front-end (if any)
├── requirements.txt # Python dependencies
└── .env # Environment configuration
URL: /presentations
Method: POST
Description: Creates a new presentation with generated content and saves it.
{
"topic": "<String>",
"num_slides": "<Integer>",
"custom_content": "<string (optional)>"
}
Parameter | Type | Required | Description |
---|---|---|---|
topic |
string | Yes | The topic of the presentation. |
num_slides |
integer | Yes | Number of slides to generate. |
custom_content |
string | No | Optional custom content to include in slides. |
{
"id": "<string>",
"message": "Presentation created successfully"
}
{
"detail": "An error occurred while creating the presentation."
}
URL: /presentations/{presentation_id}
Method: GET
Description: Retrieves the details of a specific presentation.
Parameter | Type | Description |
---|---|---|
presentation_id |
string | The ID of the presentation to fetch. |
{
"id": "<string>",
"slides": [
{
"title": "<string>",
"content": "<string>"
},
]
}
{
"detail": "Presentation not found"
}
URL: /presentations/{presentation_id}/download
Method: GET
Description: Downloads the generated presentation as a .pptx
file.
Parameter | Type | Description |
---|---|---|
presentation_id |
string | The ID of the presentation to fetch. |
- A
.pptx
file with the generated presentation.
{
"detail": "Presentation not found"
}
URL: /presentations/{presentation_id}/configure
Method: POST
Description: Updates an existing presentation's slides using provided configurations.
Parameter | Type | Description |
---|---|---|
presentation_id |
string | The ID of the presentation to update. |
{
"slides": [
{
"title": "<string>",
"content": "<string>"
},
]
}
Parameter | Type | Required | Description |
---|---|---|---|
slides |
array | Yes | An array of slide objects to update. |
{
"message": "Presentation updated successfully",
"presentation": {
"id": "<string>",
"slides": [
{
"title": "<string>",
"content": "<string>"
},
]
}
}
- 404 Not Found:
{ "detail": "Presentation not found" }
- 400 Bad Request:
{ "detail": "Unable to update the presentation" }
- Install the required dependencies:
pip install -r requirements.txt
- Set the
GOOGLE_API_KEY
in the.env
file. - Start the FastAPI server:
uvicorn main:app --reload
- Python 3.8+
- Virtual Environment (recommended)
-
Clone the repository:
git clone https://github.com/nag2mani/PowerPointGenerator.git cd PowerPointGenerator/slide_generator_api
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up the environment variables in
.env
:SECRET_KEY=your_secret_key DEBUG=True DATABASE_URL=your_database_url
-
Run the application:
python app/main.py
This project is licensed under the MIT License. See the LICENSE file for more details.
For queries or support, reach out to:
- Email: [email protected]
- GitHub: nag2mani