A FastAPI-based AI-powered document summarization service that extracts text from uploaded PDF/DOCX files and provides structured summaries in four formats using OpenAI's GPT-4o-mini.
✅ Upload and extract text from PDF and DOCX files
✅ AI-powered document summarization
✅ Provides four summary formats:
- Short Version (30-50 words)
- Detailed Version (100-200 words)
- Technical Version (domain-specific)
- Layman Version (simplified explanation)
✅ View summary history
✅ Delete summaries
| Component | Technology |
|---|---|
| Backend | FastAPI (Python) |
| AI API | OpenAI GPT-4o-mini |
| Storage | AWS S3 (for file uploads, optional) |
| Database | PostgreSQL / Firebase Firestore (future enhancement) |
| Auth | Firebase Auth (future enhancement) |
| Frontend | React (planned integration) |
git clone https://github.com/your-username/ai-summarizer.git
cd ai-summarizerpython -m venv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windowspip install -r requirements.txtCreate a .env file in the project root and add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_hereuvicorn main:app --host 0.0.0.0 --port 8000 --reload| Method | Endpoint | Description |
|---|---|---|
POST |
/upload |
Upload a file (PDF/DOCX) and extract text |
POST |
/summarize |
Get AI-generated summaries in four formats |
GET |
/history |
Retrieve previous summaries (mock data for now) |
DELETE |
/delete |
Delete a summary (mock implementation) |
curl -X 'POST' \
'http://localhost:8000/upload' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F '[email protected]'{
"message": "File uploaded successfully",
"text": "Extracted text content here..."
}curl -X 'POST' \
'http://localhost:8000/summarize' \
-H 'Content-Type: application/json' \
-d '{"text": "Your extracted text here"}'{
"short_version": "...",
"detailed_version": "...",
"technical_version": "...",
"layman_version": "..."
}🚀 User Authentication (Google login, Firebase Auth)
🚀 Storage & History (Save summaries in PostgreSQL/Firebase)
🚀 Payment Integration (Stripe, PayPal for API access)
🚀 Frontend (React Integration)
This project is licensed under the MIT License.