A complete AI-powered presentation generation system that creates professional PowerPoint presentations from text content. Built with FastAPI backend, Presenton API for PPT generation, Ollama LLM for content analysis, and Pexels for image integration.
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ Frontend โโโโโโโถโ Backend โโโโโโโถโ Presenton โ
โ (Browser) โ โ Middleware โ โ API โ
โโโโโโโโโโโโโโโ โโโโโโโโฌโโโโโโโโ โโโโโโโโโโโโโโโ
โ
โโโโโโโดโโโโโโโ
โ โ
โโโโโโผโโโโโ โโโโโผโโโโโ
โ Ollama โ โ Pexels โ
โ LLM โ โ API โ
โโโโโโโโโโโ โโโโโโโโโโ
- AI Content Analysis: Uses Ollama (qwen-oss:20) to analyze and structure content
- Automatic Slide Generation: Creates 4-8 slides with proper structure
- Image Integration: Automatically fetches relevant images from Pexels
- Transcript Generation: Generate presentation scripts using Zephyr 7B model
- Multiple Templates: Administrative, Educational, and General styles
- Progress Tracking: Real-time generation progress updates
- Export Options: Download as PowerPoint (PPTX), PDF, or transcript text
- Modern UI: Responsive, professional interface in Traditional Chinese
- Docker & Docker Compose
- Python 3.9+
- Ollama installed locally
- Internet connection (for Pexels API)
# Install Ollama (if not already installed)
curl https://ollama.ai/install.sh | sh
# Download the model
ollama pull qwen-oss:20
# Verify installation
ollama list# Create project directory
mkdir teaching-ppt-generator
cd teaching-ppt-generator
# Create directory structure
mkdir -p backend/app/{api,services,utils}
mkdir -p frontend
mkdir -p outputCopy all the provided files from the artifacts into their respective directories:
teaching-ppt-generator/
โโโ docker-compose.yml
โโโ .env
โโโ README.md
โโโ backend/
โ โโโ Dockerfile
โ โโโ requirements.txt
โ โโโ app/
โ โโโ __init__.py
โ โโโ main.py
โ โโโ config.py
โ โโโ models.py
โ โโโ api/
โ โ โโโ __init__.py
โ โ โโโ routes.py
โ โโโ services/
โ โโโ __init__.py
โ โโโ ollama_service.py
โ โโโ pexels_service.py
โ โโโ presenton_service.py
โ โโโ content_processor.py
โโโ frontend/
โโโ index.html
# Build and start all services
docker-compose up -d
# Check logs
docker-compose logs -f
# Verify services are running
curl http://localhost:5000/api/healthOpen frontend/index.html in your browser, or serve it with:
# Using Python
cd frontend
python3 -m http.server 8080
# Then visit: http://localhost:8080Once the backend is running, visit:
- Swagger UI: http://localhost:5000/docs
- ReDoc: http://localhost:5000/redoc
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/generate |
Start presentation generation |
| GET | /api/progress/{task_id} |
Check generation progress |
| GET | /api/download/{id}/pptx |
Download PowerPoint file |
| GET | /api/download/{id}/pdf |
Download PDF file |
| GET | /api/health |
Health check |
Environment variables in .env:
# Presenton API
PRESENTON_API_KEY=sk-presenton-...
PRESENTON_API_URL=http://localhost:8000
# Ollama
OLLAMA_URL=http://localhost:11434
OLLAMA_MODEL=qwen-oss:20
# Pexels
PEXELS_API_KEY=your_key_here
# Backend
BACKEND_PORT=5000
CORS_ORIGINS=*-
Administrative (่กๆฟ็ฐกๅ ฑ)
- Professional, formal, structured style
- Best for business reports, meetings
-
Educational (ๆๅญธ็ฐกๅ ฑ)
- Clear, teaching-oriented, easy to understand
- Best for courses, tutorials, training
-
General (ไธ่ฌ็ฐกๅ ฑ)
- Flexible, universal, visual style
- Best for general presentations
-
Input Content:
- Minimum 50 characters required
- Supports: meeting notes, course outlines, product intros, research, proposals
-
Select Template:
- Choose from 3 available templates
- Each optimized for different use cases
-
Generate:
- Click "็ๆ็ฐกๅ ฑ" (Generate)
- Wait 30-60 seconds for processing
- Watch real-time progress updates
-
Download:
- Download as PowerPoint (.pptx)
- Download as PDF (.pdf)
- Generate and download presentation transcript (.txt)
The system uses Zephyr 7B model to generate professional presentation scripts:
-
Three Speaking Styles:
- Educational (ๆๅญธๅผ) - Clear, step-by-step explanations
- Formal (ๆญฃๅผ) - Professional business language
- Conversational (ๅฐ่ฉฑๅผ) - Easy, relatable style
-
Smart Duration Estimation: Calculates speaking time based on content
-
Slide-by-Slide Scripts: Individual scripts for each slide
-
Full Transcript: Complete presentation script with timing
- Generate a presentation first
- Click "็ๆๆผ่ฌ็จฟ" (Generate Transcript)
- Select speaking style
- Wait 30-60 seconds for generation
- Download as text file
ใๆๅฝฑ็ 1: ไบบๅทฅๆบๆ
งๆ่ฒๆ็จใ
[้ ไผฐๆ้: 45็ง]
ๅไฝ่ๅธซใๅๅญธๅๅคงๅฎถๅฅฝ๏ผไปๅคฉๆๅ่ฆไธ่ตทๆข่จไธๅไปคไบบ่ๅฅฎ็ไธป้ก...
ใๆๅฝฑ็ 2: ๅญธ็ฟ็ฎๆจใ
[้ ไผฐๆ้: 60็ง]
ๅจ้ๅงไนๅ๏ผ่ฎๆๅๅ
ไบ่งฃไปๅคฉ็ๅญธ็ฟ็ฎๆจใ้ฆๅ
...
# Check if Ollama is running
curl http://localhost:11434/api/tags
# Check available models
ollama list
# Pull missing models
ollama pull qwen-oss:20
ollama pull zephyr:7b
# Restart Ollama if needed
ollama serve# Check Presenton container logs
docker logs presenton-api
# Restart Presenton
docker-compose restart presenton# Check backend logs
docker-compose logs backend
# Rebuild backend
docker-compose up -d --build backendcd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run server
uvicorn app.main:app --reload --host 0.0.0.0 --port 5000# Test health endpoint
curl http://localhost:5000/api/health
# Test generation (replace content with your text)
curl -X POST http://localhost:5000/api/generate \
-H "Content-Type: application/json" \
-d '{
"content": "้ๆฏไธๅๆธฌ่ฉฆๅ
งๅฎน๏ผ็จๆผ็ๆๆๅญธ็ฐกๅ ฑใไธป่ฆ่จ่ซAIๆ่กๅจๆ่ฒไธญ็ๆ็จใๅ
ๆฌๆฉๅจๅญธ็ฟใๆทฑๅบฆๅญธ็ฟ็ญไธป้กใ",
"template": "educational",
"language": "zh-TW"
}'teaching-ppt-generator/
โโโ backend/ # Backend API service
โ โโโ app/
โ โ โโโ main.py # FastAPI application
โ โ โโโ config.py # Configuration management
โ โ โโโ models.py # Pydantic models
โ โ โโโ api/
โ โ โ โโโ routes.py # API endpoints
โ โ โโโ services/
โ โ โโโ ollama_service.py # LLM integration
โ โ โโโ pexels_service.py # Image search
โ โ โโโ presenton_service.py # PPT generation
โ โ โโโ content_processor.py # Main orchestrator
โ โโโ requirements.txt
โ โโโ Dockerfile
โโโ frontend/ # Frontend web interface
โ โโโ index.html # Single-page application
โโโ output/ # Generated presentations
โโโ docker-compose.yml # Docker orchestration
โโโ .env # Environment variables
โโโ README.md # This file
- API Keys: Never commit
.envfile to version control - CORS: Set proper origins in production (not
*) - Rate Limiting: Consider adding rate limiting for production
- File Cleanup: Implement periodic cleanup of
/outputdirectory
-
Environment Variables
# Use production URLs PRESENTON_API_URL=https://your-presenton-domain.com CORS_ORIGINS=https://your-frontend-domain.com DEBUG=False -
Reverse Proxy
- Use nginx or Caddy in front of the backend
- Enable HTTPS with Let's Encrypt
-
Monitoring
- Add logging service (e.g., ELK stack)
- Monitor Ollama performance
- Track API usage and costs
-
Scaling
- Use Redis for task queue
- Add load balancer for multiple backend instances
- Consider Kubernetes for orchestration
- Average Generation Time: 30-60 seconds
- Ollama Processing: 10-20 seconds
- Presenton Generation: 15-30 seconds
- Image Fetching: 5-10 seconds
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License.
- Presenton: PPT generation engine
- Ollama: Local LLM inference
- Pexels: Free stock photos
- FastAPI: Modern Python web framework
For issues and questions:
- Check the Troubleshooting section
- Review API documentation at
/docs - Check Docker logs:
docker-compose logs - Verify Ollama status:
ollama list
- Initial release
- Support for 3 template types
- Ollama integration (qwen-oss:20)
- Pexels image integration
- PPTX and PDF export
- Add more template styles
- Support for custom branding
- Batch processing
- User authentication
- Presentation history
- Custom image uploads
- Multi-language support
- Advanced editing features
Made with โค๏ธ for educators and presenters