NOTE: This project is a WORK-IN-PROGRESS.
This project contains a browser-based application demonstrating how to use fin-ocr-sdk. The application performs OCR (Optical Character Recognition) on data received from a video capture device (e.g., your device's webcam).
This demo application includes two demos:
- Check Image OCR Analysis: Upload a check image directly to extract MICR data using the fin-ocr-sdk. This process runs in the browser, so your image data will remain on your device.
- Analyze Generated Check Image: Generate a simulated check image and run OCR to extract critical MICR data.
Ensure you have the following installed on your system:
- Git
- Node.js (v20.x or higher, which includes npm)
- npm (comes with Node.js)
Clone both the SDK and the demo application repositories:
git clone https://github.com/discoverfinancial/fin-ocr-sdk.git
git clone https://github.com/discoverfinancial/fin-ocr-browser-demo.git
Navigate to the SDK directory, install dependencies, build it, and link it globally:
cd fin-ocr-sdk
npm run build
npm link
Note for users with restricted npm global path
If the normal global path for npm is restricted on your corporate machine, you can still use npm link
by following these steps:
-
Set up a local npm prefix:
- Configure npm to use a local directory for global installations. This allows you to use
npm link
without requiring access to the restricted global path. - Run the following command:
npm config set prefix ~/.npm-global
- This changes the global installation directory to
~/.npm-global
, which should be accessible even with corporate restrictions.
- Configure npm to use a local directory for global installations. This allows you to use
-
Add the new npm global directory to your PATH:
- Add the following line to your
.bashrc
,.zshrc
, or corresponding shell configuration file:export PATH=~/.npm-global/bin:$PATH
- Then, source the file to update your current shell session:
source ~/.bashrc # or source ~/.zshrc
- Add the following line to your
-
Use
npm link
as usual:
-
Set up a local npm prefix:
- Configure npm to use a local directory for global installations by running the following command in your terminal (Command Prompt or PowerShell):
npm config set prefix "%USERPROFILE%\npm-global"
- This changes the global installation directory to
%USERPROFILE%\npm-global
, which is within your user profile and should be accessible despite corporate restrictions.
- Configure npm to use a local directory for global installations by running the following command in your terminal (Command Prompt or PowerShell):
-
Add the new npm global directory to your PATH:
- Open the Environment Variables settings in Windows.
- Add
%USERPROFILE%\npm-global\bin
to yourPATH
variable.
-
Use
npm link
as usual:
Next, navigate to the fin-ocr-browser-demo directory and run the following commands to install the necessary dependencies and build the project:
cd ../fin-ocr-browser-demo
npm link @discoverfinancial/fin-ocr-sdk
npm run build
To start the application:
npm run dev
Then open the application in your browser on the indicated port, which is http://localhost:5173 by default.