The OCR Web Application is a tool that allows users to extract text from images using Optical Character Recognition (OCR). It is built with:
- Frontend: Next.js (hosted on Netlify)
- Backend: Flask + PaddleOCR (hosted on Render)
This project is designed to provide a simple and efficient way to convert images containing text into editable digital text.
- Image Upload: Upload images (JPEG, PNG, etc.) containing text.
- Text Extraction: Extract text from images using PaddleOCR.
- Responsive Design: Works seamlessly on desktop and mobile devices.
- CORS Support: Backend configured with CORS for cross-origin requests.
- Environment Variables: Dynamic backend URL configuration using environment variables.
- Error Handling: Basic error handling for invalid file types and server errors.
To run this project locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/your-username/your-repo-name.git cd your-repo-name
-
Set Up the Backend
- Navigate to the backend folder:
cd backend
- Create a virtual environment and install dependencies:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
- Start the Flask server:
python app.py
-
Set Up the Frontend
- Navigate to the frontend folder:
cd ../frontend
- Install dependencies:
npm install
- Start the Next.js development server:
npm run dev
- Access the Application
Open your browser and go to http://localhost:3000.
Backend
- Deploy the Flask backend to Render or another hosting platform.
- Set the NEXT_PUBLIC_BACKEND_URL environment variable to the deployed backend URL.
Frontend
- Deploy the Next.js frontend to Netlify.
- Set the NEXT_PUBLIC_BACKEND_URL environment variable in Netlify.
- Open the application in your browser.
- Upload an image containing text.
- Click Extract Text to process the image.
- View the extracted text displayed on the screen.
-
Frontend:
- Next.js
- React
- Tailwind CSS (optional, if used)
-
Backend:
- Flask
- PaddleOCR
-
Hosting:
- Netlify (Frontend)
- Render (Backend)
your-repo-name/
├── frontend/ # Next.js frontend code
│ ├── pages/
│ ├── public/
│ ├── styles/
│ └── package.json
├── backend/ # Python backend code
│ ├── app.py
│ ├── requirements.txt
│ └── uploads/
└── README.md
This project is licensed under the MIT License. See the LICENSE file for details.
- PaddleOCR for the OCR functionality.
- Next.js and Flask for the frontend and backend frameworks.
- Netlify and Render for hosting.
- v1.0.0: Initial release with image upload, text extraction, and basic error handling.