A full-stack application for summarizing text and extracting insights using AI — built with FastAPI, Celery, Redis, PostgreSQL, and React.
- Intelligent summarization — submit text and receive a summary with insights generated by GPT-4o mini
- Asynchronous processing — Celery + Redis, without blocking the interface
- Automatic polling — the frontend detects when the result is ready
- Persistent history — all summaries saved in PostgreSQL
- Auto-generated documentation — Swagger UI at
/docsand ReDoc at/redoc - Docker Compose — start the entire stack with a single command
| Layer | Technology |
|---|---|
| Backend | FastAPI 0.115, SQLAlchemy 2, Pydantic v2 |
| Queue | Celery 5.5 + Redis 7 |
| AI | OpenAI SDK 1.x — gpt-4o-mini |
| Database | PostgreSQL 15 |
| Frontend | React 19, Vanilla CSS (dark mode) |
| Infrastructure | Docker, Docker Compose |
- Docker and Docker Compose
- An OpenAI API key: platform.openai.com
# 1. Clone the repository
git clone https://github.com/your-username/ai-summarizer-bot.git
cd ai-summarizer-bot
# 2. Set up environment variables
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY
# 3. Start the full stack
docker compose up --build- Frontend: http://localhost
- API: http://localhost:8000
- Swagger UI: http://localhost:8000/docs
cd backend
python -m venv venv
source venv/bin/activate # Linux/Mac
# venv\Scripts\activate # Windows
pip install -r requirements.txt
export OPENAI_API_KEY=sk-...
# SQLite is used by default if DATABASE_URL is not set
uvicorn app.main:app --reloadcd backend
source venv/bin/activate
celery -A celery_worker.celery worker --loglevel=infoRedis is required for Celery. Run with Docker:
docker run -p 6379:6379 redis:7-alpine
cd frontend
npm install
npm start
# Opens at http://localhost:3000Copy .env.example to .env and fill in the values:
| Variable | Description | Required |
|---|---|---|
OPENAI_API_KEY |
OpenAI API key | Yes |
DATABASE_URL |
PostgreSQL connection URL | Docker only |
POSTGRES_USER |
Database user | Docker only |
POSTGRES_PASSWORD |
Database password | Docker only |
POSTGRES_DB |
Database name | Docker only |
CELERY_BROKER_URL |
Redis broker URL | Docker only |
CELERY_RESULT_BACKEND |
Redis result backend URL | Docker only |
ai-summarizer-bot/
├── backend/
│ ├── app/
│ │ ├── main.py # FastAPI app, routes, CORS
│ │ ├── ai_service.py # OpenAI integration
│ │ ├── tasks.py # Celery tasks with retry
│ │ ├── crud.py # Database operations
│ │ ├── models.py # SQLAlchemy models
│ │ ├── schemas.py # Pydantic v2 schemas
│ │ └── database.py # SQLAlchemy connection
│ ├── celery_worker.py # Worker entrypoint
│ ├── requirements.txt
│ └── Dockerfile
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ └── Summarizer.jsx # Main component
│ │ ├── api.js # HTTP client (native fetch)
│ │ ├── App.jsx
│ │ ├── index.js
│ │ └── index.css # Design system
│ ├── package.json
│ └── Dockerfile
├── docker-compose.yml
├── .env.example
└── README.md
| Method | Route | Description |
|---|---|---|
GET |
/ |
Health check |
POST |
/summarize/ |
Submit text for summarization (returns task_id) |
GET |
/task/{task_id} |
Poll task status |
GET |
/history/ |
List past summaries |
Full documentation: http://localhost:8000/docs
MIT — see LICENSE for details.