This project consists of two main parts: ocr-backend and ocr-frontend.
The backend is implemented in Go and provides the OCR (Optical Character Recognition) functionality using Azure services.
-
Install dependencies:
go mod tidy
-
Run the server:
go run cmd/main.go
The backend uses environment variables for configuration. Ensure you have a .env file with the necessary variables. Example:
```env
PORT=8080
AZURE_OCR_ENDPOINT=<your-azure-ocr-endpoint>
AZURE_OCR_KEY=<your-azure-ocr-key>
```
- Main Entry Point:
cmd/main.go - Environment Initialization:
utils.InitEnv - Handlers:
handlers.AzureHandler,handlers.CheckStatus
The frontend is implemented using Vue 3 and Vite.
VSCode + Volar (and disable Vetur).
TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need Volar to make the TypeScript language service aware of .vue types.
See Vite Configuration Reference.
-
Install dependencies:
npm install
-
Compile and Hot-Reload for Development:
npm run dev
-
Type-Check, Compile and Minify for Production:
npm run build
-
Run Unit Tests with Vitest:
npm run test:unit
-
Lint with ESLint:
npm run lint
- Main Layout:
HomeLayout.vue - Tailwind CSS Configuration:
tailwind.config.js,tailwind.css
This project uses Git for version control. Ensure you have .gitignore files in both ocr-backend and ocr-frontend to exclude unnecessary files from version control.
This project is licensed under the MIT License. See the LICENSE file for details.