Project-Textract is an advanced OCR (Optical Character Recognition) web application that allows users to extract text from images using cutting-edge AI technology. Built with Next.js frontend and Flask/PaddleOCR backend, this project provides a simple and efficient way to convert images containing text into editable digital text.
Project-Textract is an OCR web application that extracts text from images using Next.js frontend and Flask/PaddleOCR backend with modern UI.
- Drag & Drop Upload: Intuitive file upload with drag-and-drop functionality
- Multiple Formats: Supports PNG, JPG, JPEG, BMP, TIFF, and TIF formats
- Real-time Processing: Instant text extraction with loading indicators
- File Validation: Comprehensive file type and size validation
- AI-Powered OCR: Advanced PaddleOCR engine for accurate text recognition
- Multi-language Support: English language processing with expandable capabilities
- Smart Detection: Automatic text orientation and layout detection
- High Accuracy: PaddleOCR's deep learning models for precise results
- Copy Functionality: One-click copying of extracted text to clipboard
- Download Options: Export extracted text as .txt files
- Formatted Display: Clean, readable text presentation
- Error Handling: Graceful error management and user feedback
- Responsive Design: Mobile-first approach with cross-device compatibility
- Modern UI: Clean, intuitive interface with Tailwind CSS styling
- Interactive Feedback: Visual indicators for processing states
- Accessibility: Keyboard navigation and screen reader support
- Next.js 15 β Full-stack React framework with server-side rendering
- React 19 β Modern component-based architecture
- Tailwind CSS β Utility-first styling framework
- React-Dropzone β Advanced drag-and-drop file handling
- React Icons β Comprehensive icon library
- Flask β Lightweight Python web framework
- PaddleOCR β Industry-leading OCR engine with deep learning
- PaddlePaddle β Baidu's deep learning framework
- Flask-CORS β Cross-origin resource sharing middleware
- Werkzeug β WSGI utility library
- Pillow β Python imaging library
- Netlify β Frontend hosting with continuous deployment
- Render β Backend hosting with automatic scaling
- Environment Variables β Dynamic configuration management
- Node.js (v18 or higher)
- Python (v3.8 or higher)
- Git
-
Navigate to backend directory:
cd ocr-backend -
Create virtual environment:
python -m venv venv
-
Activate virtual environment:
# Windows venv\Scripts\activate # macOS/Linux source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Start the Flask server:
python app.py
-
Navigate to frontend directory:
cd ocr-frontend -
Install dependencies:
npm install
-
Create environment file:
echo "NEXT_PUBLIC_BACKEND_URL=http://localhost:5000" > .env.local
-
Start development server:
npm run dev
-
Access the application: Open your browser and navigate to
http://localhost:3000
- Push your backend code to a Git repository
- Connect Render to your repository
- Configure build command:
pip install -r requirements.txt - Set start command:
python app.py - Configure environment variables as needed
- Push your frontend code to a Git repository
- Connect Netlify to your repository
- Set build command:
npm run build - Set publish directory:
out - Add environment variable:
NEXT_PUBLIC_BACKEND_URL
- Upload Image: Drag and drop or click to select an image file
- Process: Click "Extract Text" to send image to OCR engine
- Review: View extracted text in the output panel
- Export: Copy to clipboard or download as text file
- Repeat: Process additional images as needed
Project-Textract/
βββ ocr-frontend/ # Next.js frontend application
β βββ app/ # Next.js 13+ app directory
β β βββ components/ # Reusable React components
β β β βββ Header.jsx # Application header
β β β βββ UploadComponent.jsx # Image upload interface
β β β βββ OutputComponent.jsx # Text display and export
β β βββ globals.css # Global styles
β β βββ layout.js # Root layout
β β βββ page.js # Main page component
β βββ public/ # Static assets
β βββ package.json # Frontend dependencies
β βββ next.config.mjs # Next.js configuration
βββ ocr-backend/ # Flask backend API
β βββ app.py # Main Flask application
β βββ requirements.txt # Python dependencies
β βββ uploads/ # Temporary file storage
β βββ wsgi.py # WSGI entry point
βββ README.md # Project documentation
- Description: Extract text from uploaded image
- Request: Multipart form data with image file
- Response: JSON with extracted text
- Example:
{ "text": "Extracted text from image" }
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code style and conventions
- Write meaningful commit messages
- Test changes thoroughly
- Update documentation as needed
This project is licensed under the MIT License. See the LICENSE file for details.
- PaddleOCR for the powerful OCR engine
- Next.js for the excellent React framework
- Flask for the lightweight Python framework
- Netlify and Render for hosting solutions
- v1.0.0: Initial release with image upload, text extraction, and copy/download functionality
- v1.1.0: Added drag-and-drop support, improved UI/UX, enhanced error handling
- v1.2.0: Implemented responsive design, added multiple export options, optimized performance
β Star this repository if you found it useful!
πΈ Transform your images into text with Textract!
