From 0558f68bfdb6199d1c0b1e93d6b0ef394ae92295 Mon Sep 17 00:00:00 2001 From: felixindrawan Date: Tue, 24 Sep 2024 14:02:17 -0700 Subject: [PATCH] feat: Add project structure to readme --- README.md | 77 ++++++++++++++++++- VINScanner/js/init.js | 2 +- VINScanner/minimum-elements.html | 2 +- .../{VIN_Template.json => template.json} | 0 4 files changed, 77 insertions(+), 4 deletions(-) rename VINScanner/{VIN_Template.json => template.json} (100%) diff --git a/README.md b/README.md index 7f7b6b4..f90c7af 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,82 @@ | ------------ | ------------------------------------------------------------------------------------ | | `VIN Scanner` | Scan the VIN code from a barcode or a text line and extract the vehicle information. | -## License +## Request a Trial License + +The key "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" used in this solution (found in the js/init.js file) is a test license valid for 24 hours for any newly authorized browser. If you wish to test the SDK further, you can request a 30-day free trial license through the Request a Trial License link. + +## Project Structure + +```text +Sample Project +├── assets +│ ├── ... +│ ├── ... +│ └── ... +├── css +│ └── index.css +├── font +│ ├── ... +│ ├── ... +│ └── ... +├── js +│ ├── const.js +│ ├── index.js +│ ├── init.js +│ └── util.js +├── index.html +└── template.json +``` + + * `/assets` : This directory contains all the static files such as images, icons, etc. that are used in the project. + * `/css` : This directory contains the CSS file(s) used for styling the project. + * `/font` : This directory contains the font files used in the project. + * `/js` : This directory contains all the JavaScript files used in the project. + * `const.js` : This file contains definitions of certain constants or variables used across the project. + * `index.js`: This is the main JavaScript file where the core logic of the project is implemented. + * `init.js` : This file is used for initialization purposes, such as initializing license, load resources, etc. + * `util.js` : This file contains utility functions that are used across the project. + * `index.html` : This is the main HTML file that represents the homepage of the project. + * `template.json` : This file contains predefined templates used in the project. + * `minimum-elements.html` : This HTML file includes the sample project with minimal elements and limited CSS, all contained within a single page. + +## System Requirements + +This project requires the following features to work: + +- Secure context (HTTPS deployment) + + When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons + + - Access to the camera video stream is only granted in a security context. Most browsers impose this restriction. + > Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test. + + - Dynamsoft License requires a secure context to work. + +- `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers` + + The above four features are required for the SDK to work. + +- `MediaDevices`/`getUserMedia` + + This API is required for in-browser video streaming. + +- `getSettings` + + This API inspects the video input which is a `MediaStreamTrack` object about its constrainable properties. + +The following table is a list of supported browsers based on the above requirements: + + | Browser Name | Version | + | :----------: | :--------------: | + | Chrome | v78+1 | + | Firefox | v63+1 | + | Edge | v79+ | + | Safari | v14+ | + + 1 devices running iOS needs to be on iOS 14.3+ for camera video streaming to work in Chrome, Firefox or other Apps using webviews. -You can request a 30-day trial license via the [Request a Trial License](https://www.dynamsoft.com/customer/license/trialLicense/?product=cvs&utm_source=github&package=js) link. +Apart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above. ## Testing diff --git a/VINScanner/js/init.js b/VINScanner/js/init.js index 6e2c4af..e39e327 100644 --- a/VINScanner/js/init.js +++ b/VINScanner/js/init.js @@ -83,7 +83,7 @@ async function initDCE() { let init = (async function initCVR() { await initDCE(); cvRouter = await Dynamsoft.CVR.CaptureVisionRouter.createInstance(); - await cvRouter.initSettings("./VIN_Template.json"); + await cvRouter.initSettings("./template.json"); cvRouter.setInput(cameraEnhancer); /* Filter out unchecked and duplicate results. */ diff --git a/VINScanner/minimum-elements.html b/VINScanner/minimum-elements.html index c1a5783..a07f608 100644 --- a/VINScanner/minimum-elements.html +++ b/VINScanner/minimum-elements.html @@ -67,7 +67,7 @@

cvRouter.setInput(cameraEnhancer); // Set parameters to read VIN through DLR, DBR, and DCP - await cvRouter.initSettings("./VIN_Template.json"); + await cvRouter.initSettings("./template.json"); // Filter out unchecked and duplicate results. const filter = new Dynamsoft.Utility.MultiFrameResultCrossFilter(); diff --git a/VINScanner/VIN_Template.json b/VINScanner/template.json similarity index 100% rename from VINScanner/VIN_Template.json rename to VINScanner/template.json