https://github.com/terryminn/ocr-service
A microservice-based OCR tool that extracts text from images using AWS Textract. Built with NestJS, this service provides a secure REST API with API key authentication.
https://github.com/terryminn/ocr-service
aws-textract microservice nestjs ocr
Last synced: 8 months ago
JSON representation
A microservice-based OCR tool that extracts text from images using AWS Textract. Built with NestJS, this service provides a secure REST API with API key authentication.
- Host: GitHub
- URL: https://github.com/terryminn/ocr-service
- Owner: TerryMinn
- Created: 2025-03-18T08:05:56.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-18T08:15:09.000Z (about 1 year ago)
- Last Synced: 2025-03-18T09:27:27.249Z (about 1 year ago)
- Topics: aws-textract, microservice, nestjs, ocr
- Language: TypeScript
- Homepage:
- Size: 114 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📝 OCR Service (Image to Text Extractor)
[](https://github.com/your-repo/ocr-service)
A **microservice-based OCR** tool that extracts **text from images** using **AWS Textract**. Built with **NestJS**, this service provides a secure **REST API** with **API key authentication**.
## 🚀 Features
✅ Extract text from images using **AWS Textract**
✅ Secure **REST API** with **API Key authentication**
✅ **Scalable microservice** architecture
✅ Easy deployment with **Docker** or **Cloud services**
## ⚙️ Tech Stack
- **NestJS** - Backend framework 🏗️
- **AWS Textract** - OCR processing ☁️
- **REST API** - API architecture 🌍
- **API Key Authentication** - Secure access 🔑
## 🛠 Installation & Setup
### 📌 Prerequisites
- **Node.js** installed
- **AWS account** with Textract access
### 🔧 Steps to Run
1. Clone the repository:
```sh
git clone https://github.com/TerryMinn/OCR-Service
cd ocr-service
```
2. Install dependencies:
```sh
npm install
```
3. Set up environment variables:
Create a `.env` file and configure the following:
```env
RESPONSE_URL=
SECRET_KEY=
EXPIRES_IN=
AWS_REGION=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
OCR_API_KEY=
```
4. Start the service:
```sh
npm run start
```
## 🔥 API Docs
### local doc
```
http://localhost:8000/
```
### 1️⃣ Extract Text from Image
📌 **Endpoint:** `POST api/v1/ocr/scan`
📌 **Headers:**
```json
{
"x-api-key": "your_api_key"
}
```
📌 **Body (multipart/form-data):**
```json
{
"passport": "(Upload image file)"
}
```
📌 **Response:**
```json
{
"text": "Extracted text from image"
}
```
## 🔐 Security
🔹 Uses **API key authentication** for secure access.
🔹 Store API keys **securely** and never expose them in public repositories.
## 🚀 Deployment
This service can be deployed using **Docker**, **AWS Lambda**, or any **cloud platform** supporting **NestJS**.
## 👨💻 Author
Developed by **Terry Minn**
📩 Contact: [shinnthantmindev.mm@gmail.com]