# Presenton - AI Presentation Generator

AI-powered presentation generator with Azure OpenAI integration.

## Overview

**Presenton** is an open-source AI presentation generator that creates professional presentations from prompts, documents, or existing PowerPoint files. Privacy-focused alternative to Gamma, Beautiful.ai, and Decktopus.

- **URL:** https://presentation.ai-impress.com
- **Repository:** https://github.com/presenton/presenton
- **AI Provider:** Azure OpenAI (GPT-5 + DALL-E 3)

## Features

- AI-generated presentations from text prompts
- Document upload support (PDF, DOCX, PPTX)
- Custom template creation (HTML + Tailwind CSS)
- Export to PPTX and PDF formats
- Model Context Protocol (MCP) server support
- Local data processing (privacy-focused)

## Architecture

```
presenton/
├── docker-compose.yml    # Container configuration with Traefik
├── .env                  # Azure OpenAI credentials
├── README.md            # This file
└── app_data/            # Persistent storage (auto-created)
    ├── presentations/   # Generated presentations
    ├── templates/       # Custom templates
    └── uploads/         # Uploaded documents
```

## Technology Stack

**Frontend:**
- Next.js (React)
- Node.js 20
- Port: 3000 (internal)

**Backend:**
- FastAPI (Python 3.11)
- Port: 8000 (internal)

**Additional Services:**
- MCP Server (Port: 8001)
- Nginx (Port: 80 - exposed via Traefik)

**AI Integration:**
- Azure OpenAI GPT-5 (text generation)
- Azure OpenAI DALL-E 3 (image generation)

## Configuration

### Environment Variables (.env)

**LLM Configuration:**
- `LLM=custom` - Use custom Azure OpenAI endpoint
- `CUSTOM_LLM_URL` - Azure OpenAI chat completions URL
- `CUSTOM_LLM_API_KEY` - Azure API key
- `CUSTOM_MODEL=gpt-5` - Model name
- `TOOL_CALLS=true` - Enable function calling

**Image Generation:**
- `IMAGE_PROVIDER=dall-e-3` - Use DALL-E 3 for images
- `OPENAI_API_KEY` - Azure DALL-E API key

**Advanced Features:**
- `CAN_CHANGE_KEYS=true` - Allow API key changes in UI
- `EXTENDED_REASONING=true` - Enable for GPT-5
- `DISABLE_ANONYMOUS_TELEMETRY=true` - Privacy

### Traefik Integration

Presenton is configured to work with Traefik reverse proxy:
- **Domain:** presentation.ai-impress.com
- **SSL:** Automatic via Let's Encrypt (Cloudflare DNS)
- **Network:** traefik-public

## Usage

### Start the service

```bash
cd /opt/02-core/presenton
docker compose up -d
```

### View logs

```bash
docker logs presenton -f
```

### Stop the service

```bash
docker compose down
```

### Restart the service

```bash
docker compose restart
```

### Update to latest version

```bash
docker compose pull
docker compose up -d
```

## API Access

**API Documentation:**
- Swagger UI: https://presentation.ai-impress.com/api/v1/docs
- OpenAPI spec: https://presentation.ai-impress.com/api/v1/openapi.json

**Generate Presentation Endpoint:**
```bash
POST /api/v1/ppt/presentation/generate
```

**Example Request:**
```bash
curl -X POST "https://presentation.ai-impress.com/api/v1/ppt/presentation/generate" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Create a presentation about AI trends in 2025",
    "slide_count": 10,
    "language": "en",
    "tone": "professional",
    "export_format": "pptx"
  }'
```

## Troubleshooting

### Container won't start

Check logs for errors:
```bash
docker logs presenton --tail 100
```

Check if Traefik network exists:
```bash
docker network ls | grep traefik-public
```

### Azure OpenAI connection issues

Verify environment variables:
```bash
docker exec presenton env | grep -E "LLM|CUSTOM|OPENAI"
```

Test Azure OpenAI endpoint:
```bash
curl -X POST "https://aipmress-ai-n8n.cognitiveservices.azure.com/openai/deployments/gpt-5/chat/completions?api-version=2025-01-01-preview" \
  -H "Content-Type: application/json" \
  -H "api-key: YOUR_API_KEY" \
  -d '{"messages":[{"role":"user","content":"Hello"}]}'
```

### DALL-E image generation not working

Azure DALL-E uses a different API format than OpenAI. If images fail to generate:

1. Check logs: `docker logs presenton | grep -i "dall-e"`
2. Verify DALL-E endpoint is accessible
3. Consider using Pexels as alternative (free stock photos)

To switch to Pexels:
```bash
# Edit .env
IMAGE_PROVIDER=pexels
PEXELS_API_KEY=your_pexels_key  # Get free at https://www.pexels.com/api/
```

### Performance issues

Increase container resources in docker-compose.yml:
```yaml
deploy:
  resources:
    limits:
      cpus: '4'
      memory: 4G
```

## Maintenance

### Backup presentations

```bash
# Create backup
tar -czf presenton-backup-$(date +%Y%m%d).tar.gz app_data/

# Restore from backup
tar -xzf presenton-backup-YYYYMMDD.tar.gz
```

### Clear cache and temp files

```bash
docker exec presenton sh -c "rm -rf /tmp/*"
```

### Monitor disk usage

```bash
du -sh app_data/
```

## Security

- API keys stored in .env (excluded from Git)
- SSL/HTTPS via Traefik with Let's Encrypt
- Local data processing (no cloud uploads)
- API key changes allowed via UI (can be locked with `CAN_CHANGE_KEYS=false`)

## Resources

- **CPU:** 1-2 cores (recommended)
- **RAM:** 1-2 GB
- **Disk:** ~1 GB (image) + presentations storage

## Links

- **Official Docs:** https://github.com/presenton/presenton
- **Issue Tracker:** https://github.com/presenton/presenton/issues
- **Docker Hub:** ghcr.io/presenton/presenton

## Support

For issues specific to this deployment:
- Check container logs: `docker logs presenton`
- Review Traefik logs: `docker logs traefik`
- Contact: AI-Impress Infrastructure Team

---

**Last Updated:** 2025-11-05
**Version:** latest
**Deployment:** Production
