An intelligent PDF reading and recognition system that supports OCR recognition, Text-to-Speech (TTS), and AI conversation features for PDF documents.
Read for You is a full-stack web application designed to provide users with an intelligent PDF reading experience. The system integrates Azure Document Intelligence for OCR recognition, supports multilingual text extraction, and provides text-to-speech functionality to help users read documents more conveniently.
- π PDF Upload & Management: Support for PDF file upload, preview, and categorized management
- π Intelligent OCR Recognition: Document recognition powered by Azure Document Intelligence
- π£οΈ Text-to-Speech (TTS): Convert recognized text to speech with multilingual support
- π€ AI Chat Assistant: Integrated AI chat functionality to assist with document understanding
- π Multilingual Support: Support for Chinese, English, and other languages
- πΎ Cloud Storage Integration: File storage using Azure Blob Storage
- π± Responsive Design: Optimized for desktop and mobile devices
- Framework: Django 4.2.16
- Core Dependencies:
django-cors-headers: Cross-origin request handlingPyPDF2: PDF file processingazure-storage-blob: Azure Blob Storage integrationrequests: HTTP request handlingpython-dotenv: Environment variable management
- Framework: Vue 3.5+
- Build Tool: Vite 7.1+
- Core Dependencies:
pdfjs-dist: PDF renderingpdf-lib: PDF manipulation@echogarden/fvad-wasm: Voice activity detection@azure/static-web-apps-cli: Azure Static Web Apps deployment
- Azure Document Intelligence: OCR document recognition
- Azure Blob Storage: File storage
- Azure App Service: Backend deployment
- Azure Static Web Apps: Frontend deployment
ReadForYou_Web/
βββ backend/ # Django backend
β βββ manage.py # Django management script
β βββ requirements.txt # Python dependencies
β βββ db.sqlite3 # SQLite database
β βββ read_for_you/ # Main application
β β βββ settings.py # Django settings
β β βββ urls.py # URL routing
β β βββ views.py # View functions
β β βββ constants.py # Constants configuration
β β βββ Services/ # Service layer
β β β βββ AzureBlobService.py # Azure Blob service
β β β βββ PDFService.py # PDF processing service
β β β βββ ProcessingService.py # Processing service
β β β βββ RecognitionServices.py # Recognition service
β β βββ static/ # Static files
β βββ scripts/ # Utility scripts
β βββ traverse_books.py # Book traversal script
β
βββ frontend/ # Vue frontend
βββ package.json # Node.js dependencies
βββ vite.config.js # Vite configuration
βββ index.html # Entry HTML
βββ src/
β βββ App.vue # Main app component
β βββ main.js # Application entry
β βββ constants.js # Constants configuration
β βββ components/ # Vue components
β β βββ IndexPage.vue # Home page
β β βββ ReadingPage.vue # Reading page
β β βββ TopNav.vue # Top navigation
β β βββ AIChat/ # AI chat components
β βββ utils/ # Utility functions
β βββ i18n.js # Internationalization
β βββ PDFService.js # PDF service
β βββ TTS.js # TTS service
β βββ TTSManager.js # TTS manager
β βββ TTSPlayer.js # TTS player
β βββ IndexedDBService.js # Local storage
βββ public/ # Public resources
- Python: 3.9 or higher
- Node.js: 16.0 or higher
- npm: 8.0 or higher
- Clone the repository
git clone https://github.com/junyingshao_microsoft/ReadForYou.git
cd ReadForYou_Web/backend- Create virtual environment
python -m venv venv
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activate- Install dependencies
pip install -r requirements.txt- Configure environment variables
Create a .env file and configure the following environment variables:
# Azure Blob Storage
AZURE_STORAGE_CONNECTION_STRING=your_connection_string
AZURE_STORAGE_CONTAINER_NAME=your_container_name
# Azure Document Intelligence
DOCUMENT_INTELLIGENCE_ENDPOINT=your_endpoint
DOCUMENT_INTELLIGENCE_KEY=your_key- Database migration
python manage.py migrate- Run development server
python manage.py runserverThe backend service will start at http://127.0.0.1:8000.
- Navigate to frontend directory
cd frontend- Install dependencies
npm install- Configure API endpoint
Edit the src/constants.js file to configure the backend API address:
export const API_BASE_URL = 'http://127.0.0.1:8000';- Run development server
npm run devThe frontend service will start at http://localhost:5173.
- Build for production
npm run buildEndpoint: POST /recognition
Description: Upload PDF file and perform OCR recognition
Parameters:
file: PDF file (multipart/form-data)pageNum: Page range (e.g., "1-3" or "1,3,5")language: Language code (URL parameter, e.g., "zh-CN")
Response Example:
{
"status": "success",
"data": {
"text": "Recognized text content",
"pdf": "data:application/pdf;base64,..."
}
}Endpoint: GET /getCoverImages
Description: Get all book cover image URLs
Response Example:
{
"success": true,
"count": 10,
"images": [
{
"url": "https://...",
"name": "book_cover_1.jpg"
}
]
}Endpoint: GET /getStoragedData
Description: Retrieve files from Azure Blob Storage
Parameters:
prefix: File path prefixtype: File type (pdf, jpg, png, etc.)
Endpoint: GET /getBookMetadata
Description: Get metadata information for a specific book
Parameters:
prefix: Book path prefix
Backend Deployment (Azure App Service):
- Deployment URL: https://readforyou-fwanhpcfatfedqce.canadacentral-01.azurewebsites.net
- Using Gunicorn as WSGI server
Frontend Deployment (Azure Static Web Apps):
- Build static files using
npm run build - Deploy via Azure Static Web Apps CLI
Server Information:
- VM IP: 4.193.237.95
- Domain: https://readforyou.xyz
extractPDF: Extract PDF pages based on page rangenormalizePageRange: Normalize page range format
uploadFile: Upload files to Azure Blob StoragedownloadFile: Download files from Azure Blob StoragegetAllCoverImages: Get all cover images
- Integrated with Azure Document Intelligence API
- Support for synchronous and asynchronous recognition
- Multilingual document recognition
- Coordinate PDF processing and recognition workflow
- Handle formatting and storage of recognition results
Contributions, issues, and feature requests are welcome!
- Fork this repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details
- Project Maintainer: junyingshao_microsoft
- Repository: ReadForYou
For more detailed project design documentation, please visit: Read for You Project Design
- Azure Document Intelligence
- Azure Blob Storage
- Vue.js Community
- Django Community
β If this project helps you, please give us a Star!