facecog-liveness-showcase 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +15 -0
- package/.dockerignore +48 -0
- package/.editorconfig +16 -0
- package/.eslintrc.json +47 -0
- package/.vercelignore +7 -0
- package/.vscode/extensions.json +5 -0
- package/.vscode/settings.json +3 -0
- package/DOCKER.md +221 -0
- package/Dockerfile +33 -0
- package/README.md +268 -0
- package/angular.json +156 -0
- package/capacitor.config.ts +9 -0
- package/docker-compose.dev.yml +20 -0
- package/docker-compose.yml +18 -0
- package/ionic.config.json +7 -0
- package/jest.config.js +38 -0
- package/nginx.conf +50 -0
- package/package.json +131 -0
- package/patches/ng-packagr+20.3.2.patch +60 -0
- package/projects/facecog-liveness-verification/README.md +295 -0
- package/projects/facecog-liveness-verification/ng-package.json +7 -0
- package/projects/facecog-liveness-verification/package.json +48 -0
- package/projects/facecog-liveness-verification/scripts/build-with-wrapper-copy.js +38 -0
- package/projects/facecog-liveness-verification/scripts/copy-wrapper-after-ngc.js +35 -0
- package/projects/facecog-liveness-verification/sources/FaceLivenessReactWrapper.tsx +320 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.generated.d.ts +28 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.generated.js +247 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.generated.js.map +1 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.js.map +1 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/aws-face-liveness.component.ts +500 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.html +41 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.scss +234 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.spec.ts +158 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.ts +58 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-verification/camera-verification.component.html +34 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-verification/camera-verification.component.ts +210 -0
- package/projects/facecog-liveness-verification/src/lib/components/dialogs/save-custom-pose-dialog.component.ts +174 -0
- package/projects/facecog-liveness-verification/src/lib/components/facetec-scan/facetec-scan.component.html +45 -0
- package/projects/facecog-liveness-verification/src/lib/components/facetec-scan/facetec-scan.component.scss +87 -0
- package/projects/facecog-liveness-verification/src/lib/components/facetec-scan/facetec-scan.component.ts +182 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.html +394 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.scss +1567 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.spec.ts +699 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.ts +721 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.html +120 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.scss +611 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.spec.ts +605 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.ts +524 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.html +73 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.scss +19 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.spec.ts +673 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.ts +963 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-verification/liveness-verification.component.html +38 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-verification/liveness-verification.component.scss +10 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-verification/liveness-verification.component.ts +233 -0
- package/projects/facecog-liveness-verification/src/lib/components/pose-selection/pose-selection.component.html +17 -0
- package/projects/facecog-liveness-verification/src/lib/components/pose-selection/pose-selection.component.spec.ts +35 -0
- package/projects/facecog-liveness-verification/src/lib/components/pose-selection/pose-selection.component.ts +33 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.html +17 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.scss +156 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.spec.ts +46 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.ts +18 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.html +190 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.scss +534 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.spec.ts +286 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.ts +155 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/analyze-response.interface.ts +16 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/aws-face-liveness.interface.ts +46 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/backend-adapter.interface.ts +21 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/backend-http-client.interface.ts +93 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/backend-response.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/camera-provider.interface.ts +107 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/category-info.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/custom-pose-data.interface.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/custom-pose-repository.interface.ts +48 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/custom-pose-response.interface.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/index.ts +52 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-action-result.interface.ts +13 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-config.interface.ts +17 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-metadata.interface.ts +17 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-result.interface.ts +24 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-verification-config.interface.ts +41 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/multi-backend-analyze-response.interface.ts +21 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/multi-backend-liveness-result.interface.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-definition.interface.ts +35 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-keypoint.interface.ts +12 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-match-result.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-verify-response.interface.ts +8 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/scan-results.interface.ts +29 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-plan.interface.ts +42 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-progress-event.interface.ts +12 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-session.interface.ts +72 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-step-change-event.interface.ts +11 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/video-recording.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/liveness-verification.module.ts +123 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/aws-face-liveness-component.token.ts +23 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/category-info.constant.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/default-liveness-config.constant.ts +18 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/index.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/liveness-verification-config.token.ts +16 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/pose-definitions.constant.ts +377 -0
- package/projects/facecog-liveness-verification/src/lib/models/index.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/models/utils/index.ts +2 -0
- package/projects/facecog-liveness-verification/src/lib/models/utils/pose.utils.spec.ts +76 -0
- package/projects/facecog-liveness-verification/src/lib/models/utils/pose.utils.ts +59 -0
- package/projects/facecog-liveness-verification/src/lib/services/aws-face-liveness.service.ts +49 -0
- package/projects/facecog-liveness-verification/src/lib/services/backend-http.service.spec.ts +111 -0
- package/projects/facecog-liveness-verification/src/lib/services/backend-http.service.ts +130 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/azure-backend.service.spec.ts +69 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/azure-backend.service.ts +72 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/facetec-backend.service.spec.ts +24 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/facetec-backend.service.ts +35 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/mock-backend.service.spec.ts +36 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/mock-backend.service.ts +39 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/openpose-backend.service.spec.ts +81 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/openpose-backend.service.ts +72 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/rekognition-analysis-backend.service.spec.ts +69 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/rekognition-analysis-backend.service.ts +83 -0
- package/projects/facecog-liveness-verification/src/lib/services/camera.service.spec.ts +200 -0
- package/projects/facecog-liveness-verification/src/lib/services/camera.service.ts +155 -0
- package/projects/facecog-liveness-verification/src/lib/services/custom-poses-api.service.ts +117 -0
- package/projects/facecog-liveness-verification/src/lib/services/index.ts +18 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-backend.service.spec.ts +103 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-backend.service.ts +61 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-config.service.spec.ts +109 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-config.service.ts +70 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-orchestrator.service.spec.ts +144 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-orchestrator.service.ts +162 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/hand-gesture-detection.service.ts +315 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/index.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/openpose.service.ts +287 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/pose-comparison.service.ts +353 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/pose-matching.service.ts +2370 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/reference-pose.service.ts +271 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-selection.service.spec.ts +183 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-selection.service.ts +179 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-api.service.spec.ts +159 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-api.service.ts +151 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-plan.service.spec.ts +184 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-plan.service.ts +94 -0
- package/projects/facecog-liveness-verification/src/lib/services/video-recorder.service.spec.ts +52 -0
- package/projects/facecog-liveness-verification/src/lib/services/video-recorder.service.ts +117 -0
- package/projects/facecog-liveness-verification/src/lib/types/detection-strategy.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/index.ts +7 -0
- package/projects/facecog-liveness-verification/src/lib/types/liveness-action.type.ts +31 -0
- package/projects/facecog-liveness-verification/src/lib/types/liveness-backend.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/pose-category.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/pose-difficulty.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/verification-flow-step.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/verification-step-kind.type.ts +4 -0
- package/projects/facecog-liveness-verification/src/public-api.ts +150 -0
- package/projects/facecog-liveness-verification/tsconfig.lib.json +20 -0
- package/projects/facecog-liveness-verification/tsconfig.lib.prod.json +11 -0
- package/projects/facecog-liveness-verification/tsconfig.spec.json +13 -0
- package/projects/facecog-liveness-verification/tsconfig.wrapper.json +15 -0
- package/projects/facecog-liveness-verification-test/src/app/app-routing.module.ts +22 -0
- package/projects/facecog-liveness-verification-test/src/app/app.component.html +3 -0
- package/projects/facecog-liveness-verification-test/src/app/app.component.scss +0 -0
- package/projects/facecog-liveness-verification-test/src/app/app.component.ts +11 -0
- package/projects/facecog-liveness-verification-test/src/app/app.module.ts +27 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home-routing.module.ts +16 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.module.ts +19 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.html +39 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.scss +97 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.spec.ts +24 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.ts +92 -0
- package/projects/facecog-liveness-verification-test/src/app/home/verification-modal.component.ts +106 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Bold_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Medium_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Regular_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-SemiBold_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Thin_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/icon/favicon.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Five_Fingers_Left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Left_Palm.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Ok_Sign_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Peace_Sign_Left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/README.md +77 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Right_Palm.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Speak_Phrase.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Three_Fingers_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Thumbs_Up_Left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Thumbs_Up_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Wave_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/blink.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/blink_twice.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/center_face.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/clap.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/cover_mouth.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/cover_right_eye.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/cross_arms.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/face_straight.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/follow_dot.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/look_down.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/look_up.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/move_closer.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/nod.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/open_mouth.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/raise_eyebrow.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/rotate_face.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/shake_head.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/smile.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/tilt_left.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/tilt_right.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_chin_left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_left_cheek.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_nose_right.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_right_cheek.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/turn_left.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/turn_right.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/wink.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/reference-pose.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/shapes.svg +1 -0
- package/projects/facecog-liveness-verification-test/src/environments/environment.prod.ts +4 -0
- package/projects/facecog-liveness-verification-test/src/environments/environment.ts +17 -0
- package/projects/facecog-liveness-verification-test/src/global.scss +288 -0
- package/projects/facecog-liveness-verification-test/src/index.html +31 -0
- package/projects/facecog-liveness-verification-test/src/main.ts +6 -0
- package/projects/facecog-liveness-verification-test/src/polyfills.ts +55 -0
- package/projects/facecog-liveness-verification-test/src/theme/nextsapien-theme.scss +174 -0
- package/projects/facecog-liveness-verification-test/src/theme/variables.scss +2 -0
- package/projects/facecog-liveness-verification-test/src/zone-flags.ts +6 -0
- package/projects/facecog-liveness-verification-test/tsconfig.app.json +15 -0
- package/projects/facecog-liveness-verification-test/tsconfig.spec.json +14 -0
- package/setup-jest.ts +118 -0
- package/tsconfig.json +41 -0
- package/tsconfig.spec.json +15 -0
- package/vercel.json +24 -0
package/.browserslistrc
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
|
2
|
+
# For additional information regarding the format and rule options, please see:
|
|
3
|
+
# https://github.com/browserslist/browserslist#queries
|
|
4
|
+
|
|
5
|
+
# For the full list of supported browsers by the Angular framework, please see:
|
|
6
|
+
# https://angular.dev/reference/versions#browser-support
|
|
7
|
+
|
|
8
|
+
# You can see what browsers were selected by your queries by running:
|
|
9
|
+
# npx browserslist
|
|
10
|
+
|
|
11
|
+
Chrome >=107
|
|
12
|
+
Firefox >=106
|
|
13
|
+
Edge >=107
|
|
14
|
+
Safari >=16.1
|
|
15
|
+
iOS >=16.1
|
package/.dockerignore
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
npm-debug.log
|
|
4
|
+
yarn-error.log
|
|
5
|
+
|
|
6
|
+
# Build outputs
|
|
7
|
+
dist
|
|
8
|
+
www
|
|
9
|
+
.angular
|
|
10
|
+
|
|
11
|
+
# IDE
|
|
12
|
+
.vscode
|
|
13
|
+
.idea
|
|
14
|
+
*.swp
|
|
15
|
+
*.swo
|
|
16
|
+
*~
|
|
17
|
+
|
|
18
|
+
# OS
|
|
19
|
+
.DS_Store
|
|
20
|
+
Thumbs.db
|
|
21
|
+
|
|
22
|
+
# Git
|
|
23
|
+
.git
|
|
24
|
+
.gitignore
|
|
25
|
+
|
|
26
|
+
# Documentation
|
|
27
|
+
README.md
|
|
28
|
+
*.md
|
|
29
|
+
|
|
30
|
+
# Docker
|
|
31
|
+
Dockerfile
|
|
32
|
+
docker-compose*.yml
|
|
33
|
+
.dockerignore
|
|
34
|
+
|
|
35
|
+
# Tests
|
|
36
|
+
coverage
|
|
37
|
+
*.spec.ts
|
|
38
|
+
karma.conf.js
|
|
39
|
+
e2e
|
|
40
|
+
|
|
41
|
+
# Environment
|
|
42
|
+
.env
|
|
43
|
+
.env.local
|
|
44
|
+
.env.*.local
|
|
45
|
+
|
|
46
|
+
# Logs
|
|
47
|
+
logs
|
|
48
|
+
*.log
|
package/.editorconfig
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Editor configuration, see https://editorconfig.org
|
|
2
|
+
root = true
|
|
3
|
+
|
|
4
|
+
[*]
|
|
5
|
+
charset = utf-8
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 2
|
|
8
|
+
insert_final_newline = true
|
|
9
|
+
trim_trailing_whitespace = true
|
|
10
|
+
|
|
11
|
+
[*.ts]
|
|
12
|
+
quote_type = single
|
|
13
|
+
|
|
14
|
+
[*.md]
|
|
15
|
+
max_line_length = off
|
|
16
|
+
trim_trailing_whitespace = false
|
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"ignorePatterns": ["projects/**/*"],
|
|
4
|
+
"overrides": [
|
|
5
|
+
{
|
|
6
|
+
"files": ["*.ts"],
|
|
7
|
+
"parserOptions": {
|
|
8
|
+
"project": ["tsconfig.json"],
|
|
9
|
+
"createDefaultProgram": true
|
|
10
|
+
},
|
|
11
|
+
"extends": [
|
|
12
|
+
"plugin:@angular-eslint/recommended",
|
|
13
|
+
"plugin:@angular-eslint/template/process-inline-templates"
|
|
14
|
+
],
|
|
15
|
+
"rules": {
|
|
16
|
+
"@angular-eslint/prefer-standalone": "off",
|
|
17
|
+
"@angular-eslint/component-class-suffix": [
|
|
18
|
+
"error",
|
|
19
|
+
{
|
|
20
|
+
"suffixes": ["Page", "Component"]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"@angular-eslint/component-selector": [
|
|
24
|
+
"error",
|
|
25
|
+
{
|
|
26
|
+
"type": "element",
|
|
27
|
+
"prefix": "app",
|
|
28
|
+
"style": "kebab-case"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"@angular-eslint/directive-selector": [
|
|
32
|
+
"error",
|
|
33
|
+
{
|
|
34
|
+
"type": "attribute",
|
|
35
|
+
"prefix": "app",
|
|
36
|
+
"style": "camelCase"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"files": ["*.html"],
|
|
43
|
+
"extends": ["plugin:@angular-eslint/template/recommended"],
|
|
44
|
+
"rules": {}
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
package/.vercelignore
ADDED
package/DOCKER.md
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Docker Setup for Selfie Liveness Verification
|
|
2
|
+
|
|
3
|
+
This document provides instructions for running the Selfie Liveness Verification application using Docker.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Docker Desktop installed (version 20.10+)
|
|
8
|
+
- Docker Compose installed (version 2.0+)
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
### Production Mode (Optimized Build)
|
|
13
|
+
|
|
14
|
+
Build and run the production-optimized version with Nginx:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Build and start the container
|
|
18
|
+
docker-compose up --build
|
|
19
|
+
|
|
20
|
+
# Or run in detached mode
|
|
21
|
+
docker-compose up -d --build
|
|
22
|
+
|
|
23
|
+
# Stop the container
|
|
24
|
+
docker-compose down
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Access the application:** http://localhost:8080
|
|
28
|
+
|
|
29
|
+
### Development Mode (Hot Reload)
|
|
30
|
+
|
|
31
|
+
Build and run the development version with hot-reload:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Build and start the development container
|
|
35
|
+
docker-compose -f docker-compose.dev.yml up
|
|
36
|
+
|
|
37
|
+
# Or run in detached mode
|
|
38
|
+
docker-compose -f docker-compose.dev.yml up -d
|
|
39
|
+
|
|
40
|
+
# Stop the container
|
|
41
|
+
docker-compose -f docker-compose.dev.yml down
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Access the application:** http://localhost:8100
|
|
45
|
+
|
|
46
|
+
## Docker Commands Reference
|
|
47
|
+
|
|
48
|
+
### Build Commands
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Build production image
|
|
52
|
+
docker-compose build
|
|
53
|
+
|
|
54
|
+
# Build development image
|
|
55
|
+
docker-compose -f docker-compose.dev.yml build
|
|
56
|
+
|
|
57
|
+
# Rebuild without cache
|
|
58
|
+
docker-compose build --no-cache
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Container Management
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# View running containers
|
|
65
|
+
docker ps
|
|
66
|
+
|
|
67
|
+
# View container logs
|
|
68
|
+
docker-compose logs -f
|
|
69
|
+
|
|
70
|
+
# Stop all containers
|
|
71
|
+
docker-compose down
|
|
72
|
+
|
|
73
|
+
# Remove containers and volumes
|
|
74
|
+
docker-compose down -v
|
|
75
|
+
|
|
76
|
+
# Restart containers
|
|
77
|
+
docker-compose restart
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Debugging
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Access container shell (production)
|
|
84
|
+
docker exec -it selfie-liveness-production sh
|
|
85
|
+
|
|
86
|
+
# Access container shell (development)
|
|
87
|
+
docker exec -it selfie-liveness-development sh
|
|
88
|
+
|
|
89
|
+
# View real-time logs
|
|
90
|
+
docker-compose logs -f selfie-liveness-app
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Configuration
|
|
94
|
+
|
|
95
|
+
### Port Configuration
|
|
96
|
+
|
|
97
|
+
- **Production:** Port 8080 (mapped to container port 80)
|
|
98
|
+
- **Development:** Port 8100 (mapped to container port 8100)
|
|
99
|
+
|
|
100
|
+
To change ports, edit the `docker-compose.yml` or `docker-compose.dev.yml` files:
|
|
101
|
+
|
|
102
|
+
```yaml
|
|
103
|
+
ports:
|
|
104
|
+
- "YOUR_PORT:80" # Change YOUR_PORT to desired port
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Camera Permissions
|
|
108
|
+
|
|
109
|
+
The Nginx configuration includes proper headers for camera/microphone access:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
Permissions-Policy: camera=*, microphone=*
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Ensure you access the app via HTTPS in production or use localhost for camera permissions to work.
|
|
116
|
+
|
|
117
|
+
## Architecture
|
|
118
|
+
|
|
119
|
+
### Production Build (Multi-stage)
|
|
120
|
+
|
|
121
|
+
1. **Stage 1 (Build):**
|
|
122
|
+
- Uses Node 18 Alpine
|
|
123
|
+
- Installs dependencies
|
|
124
|
+
- Builds production-optimized Angular bundle
|
|
125
|
+
|
|
126
|
+
2. **Stage 2 (Serve):**
|
|
127
|
+
- Uses Nginx Alpine
|
|
128
|
+
- Serves static files
|
|
129
|
+
- Includes gzip compression
|
|
130
|
+
- Implements proper security headers
|
|
131
|
+
|
|
132
|
+
### Development Build
|
|
133
|
+
|
|
134
|
+
- Uses Node 18 Alpine
|
|
135
|
+
- Mounts source code as volume for hot-reload
|
|
136
|
+
- Runs Ionic serve with live-reload enabled
|
|
137
|
+
|
|
138
|
+
## File Structure
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
.
|
|
142
|
+
├── Dockerfile # Production multi-stage build
|
|
143
|
+
├── docker-compose.yml # Production configuration
|
|
144
|
+
├── docker-compose.dev.yml # Development configuration
|
|
145
|
+
├── nginx.conf # Nginx web server configuration
|
|
146
|
+
└── .dockerignore # Files excluded from Docker build
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Troubleshooting
|
|
150
|
+
|
|
151
|
+
### Issue: Camera not working in Docker
|
|
152
|
+
|
|
153
|
+
**Solution:** Camera access requires:
|
|
154
|
+
- HTTPS connection OR localhost
|
|
155
|
+
- Proper browser permissions
|
|
156
|
+
- Container must be accessed via http://localhost (not 0.0.0.0 or container IP)
|
|
157
|
+
|
|
158
|
+
### Issue: Build fails with "npm ERR!"
|
|
159
|
+
|
|
160
|
+
**Solution:**
|
|
161
|
+
```bash
|
|
162
|
+
# Clear Docker cache and rebuild
|
|
163
|
+
docker-compose down -v
|
|
164
|
+
docker system prune -a
|
|
165
|
+
docker-compose build --no-cache
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Issue: Port already in use
|
|
169
|
+
|
|
170
|
+
**Solution:**
|
|
171
|
+
```bash
|
|
172
|
+
# Find process using the port
|
|
173
|
+
lsof -i :8080
|
|
174
|
+
|
|
175
|
+
# Kill the process or change port in docker-compose.yml
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Issue: Hot-reload not working in development
|
|
179
|
+
|
|
180
|
+
**Solution:**
|
|
181
|
+
- Ensure volumes are properly mounted
|
|
182
|
+
- Check file permissions
|
|
183
|
+
- Restart the container
|
|
184
|
+
|
|
185
|
+
## Production Deployment
|
|
186
|
+
|
|
187
|
+
For production deployment:
|
|
188
|
+
|
|
189
|
+
1. **Build the image:**
|
|
190
|
+
```bash
|
|
191
|
+
docker build -t selfie-liveness:latest .
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
2. **Push to registry:**
|
|
195
|
+
```bash
|
|
196
|
+
docker tag selfie-liveness:latest your-registry/selfie-liveness:latest
|
|
197
|
+
docker push your-registry/selfie-liveness:latest
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
3. **Deploy using Docker Compose or Kubernetes**
|
|
201
|
+
|
|
202
|
+
## Security Considerations
|
|
203
|
+
|
|
204
|
+
- Container runs as non-root user (Nginx default)
|
|
205
|
+
- Security headers configured in nginx.conf
|
|
206
|
+
- No sensitive data in environment variables
|
|
207
|
+
- Dependencies installed from package-lock.json for reproducibility
|
|
208
|
+
|
|
209
|
+
## Performance Optimization
|
|
210
|
+
|
|
211
|
+
- Gzip compression enabled
|
|
212
|
+
- Static asset caching (1 year)
|
|
213
|
+
- Multi-stage build reduces final image size
|
|
214
|
+
- Alpine base images for minimal footprint
|
|
215
|
+
|
|
216
|
+
## Support
|
|
217
|
+
|
|
218
|
+
For issues or questions:
|
|
219
|
+
1. Check container logs: `docker-compose logs -f`
|
|
220
|
+
2. Verify Docker installation: `docker --version`
|
|
221
|
+
3. Ensure ports are not in use: `lsof -i :8080`
|
package/Dockerfile
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Multi-stage build for Ionic Angular app
|
|
2
|
+
# Stage 1: Build the application
|
|
3
|
+
FROM node:20-alpine AS build
|
|
4
|
+
|
|
5
|
+
# Set working directory
|
|
6
|
+
WORKDIR /app
|
|
7
|
+
|
|
8
|
+
# Copy package files
|
|
9
|
+
COPY package*.json ./
|
|
10
|
+
|
|
11
|
+
# Install dependencies
|
|
12
|
+
RUN npm ci
|
|
13
|
+
|
|
14
|
+
# Copy application files
|
|
15
|
+
COPY . .
|
|
16
|
+
|
|
17
|
+
# Build the application for production
|
|
18
|
+
RUN npm run build --prod
|
|
19
|
+
|
|
20
|
+
# Stage 2: Serve the application with Nginx
|
|
21
|
+
FROM nginx:alpine
|
|
22
|
+
|
|
23
|
+
# Copy custom nginx configuration
|
|
24
|
+
COPY nginx.conf /etc/nginx/nginx.conf
|
|
25
|
+
|
|
26
|
+
# Copy built application from build stage
|
|
27
|
+
COPY --from=build /app/www /usr/share/nginx/html
|
|
28
|
+
|
|
29
|
+
# Expose port 80
|
|
30
|
+
EXPOSE 80
|
|
31
|
+
|
|
32
|
+
# Start Nginx
|
|
33
|
+
CMD ["nginx", "-g", "daemon off;"]
|
package/README.md
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# FaceCog Liveness Verification
|
|
2
|
+
|
|
3
|
+
An Angular workspace containing a liveness verification library and a showcase demo application.
|
|
4
|
+
|
|
5
|
+
## Project Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
facecog-ionic-front/
|
|
9
|
+
├── projects/
|
|
10
|
+
│ ├── facecog-liveness-verification/ # @naniteninja/liveness-verification
|
|
11
|
+
│ │ ├── src/lib/
|
|
12
|
+
│ │ │ ├── models/
|
|
13
|
+
│ │ │ │ ├── types/ # Type definitions (one per file)
|
|
14
|
+
│ │ │ │ │ ├── liveness-backend.type.ts
|
|
15
|
+
│ │ │ │ │ ├── verification-flow-step.type.ts
|
|
16
|
+
│ │ │ │ │ ├── liveness-action.type.ts
|
|
17
|
+
│ │ │ │ │ ├── pose-category.type.ts
|
|
18
|
+
│ │ │ │ │ ├── pose-difficulty.type.ts
|
|
19
|
+
│ │ │ │ │ ├── detection-strategy.type.ts
|
|
20
|
+
│ │ │ │ │ └── index.ts
|
|
21
|
+
│ │ │ │ │
|
|
22
|
+
│ │ │ │ ├── interfaces/ # Interface definitions (one per file)
|
|
23
|
+
│ │ │ │ │ ├── liveness-verification-config.interface.ts
|
|
24
|
+
│ │ │ │ │ ├── liveness-result.interface.ts
|
|
25
|
+
│ │ │ │ │ ├── pose-definition.interface.ts
|
|
26
|
+
│ │ │ │ │ ├── ... (13 more interfaces)
|
|
27
|
+
│ │ │ │ │ └── index.ts
|
|
28
|
+
│ │ │ │ │
|
|
29
|
+
│ │ │ │ ├── constants/ # Constant values
|
|
30
|
+
│ │ │ │ │ ├── default-liveness-config.constant.ts
|
|
31
|
+
│ │ │ │ │ ├── pose-definitions.constant.ts
|
|
32
|
+
│ │ │ │ │ └── index.ts
|
|
33
|
+
│ │ │ │ │
|
|
34
|
+
│ │ │ │ ├── utils/ # Utility functions
|
|
35
|
+
│ │ │ │ │ ├── pose.utils.ts
|
|
36
|
+
│ │ │ │ │ └── index.ts
|
|
37
|
+
│ │ │ │ │
|
|
38
|
+
│ │ │ │ └── index.ts
|
|
39
|
+
│ │ │ │
|
|
40
|
+
│ │ │ ├── services/ # Core services
|
|
41
|
+
│ │ │ │ ├── backends/
|
|
42
|
+
│ │ │ │ │ ├── backend-adapter.interface.ts
|
|
43
|
+
│ │ │ │ │ └── mock-backend.service.ts
|
|
44
|
+
│ │ │ │ ├── camera.service.ts
|
|
45
|
+
│ │ │ │ ├── liveness-config.service.ts
|
|
46
|
+
│ │ │ │ ├── pose-selection.service.ts
|
|
47
|
+
│ │ │ │ └── video-recorder.service.ts
|
|
48
|
+
│ │ │ │
|
|
49
|
+
│ │ │ ├── liveness-verification.component.ts
|
|
50
|
+
│ │ │ └── liveness-verification.module.ts
|
|
51
|
+
│ │ │
|
|
52
|
+
│ │ ├── src/public-api.ts
|
|
53
|
+
│ │ ├── package.json
|
|
54
|
+
│ │ ├── ng-package.json
|
|
55
|
+
│ │ └── README.md
|
|
56
|
+
│ │
|
|
57
|
+
│ └── facecog-liveness-verification-test/ # Showcase Demo App
|
|
58
|
+
│ └── src/
|
|
59
|
+
│ ├── app/
|
|
60
|
+
│ │ ├── liveness-verification/ # Full implementation
|
|
61
|
+
│ │ ├── verification-demo/ # FaceTec demo
|
|
62
|
+
│ │ └── home/ # Home page
|
|
63
|
+
│ ├── assets/
|
|
64
|
+
│ ├── environments/
|
|
65
|
+
│ └── theme/
|
|
66
|
+
│
|
|
67
|
+
├── dist/
|
|
68
|
+
│ └── naniteninjas-liveness-verification/ # Built library
|
|
69
|
+
│
|
|
70
|
+
├── angular.json
|
|
71
|
+
├── tsconfig.json
|
|
72
|
+
└── package.json
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Quick Start
|
|
76
|
+
|
|
77
|
+
### Install Dependencies
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npm install
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Development Server
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npm start
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Starts `facecog-liveness-verification-test` on `http://localhost:4200`.
|
|
90
|
+
|
|
91
|
+
### Build Library
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm run build:lib
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Outputs to `dist/naniteninjas-liveness-verification/`.
|
|
98
|
+
|
|
99
|
+
### Build Demo App
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npm run build:prod
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Outputs to `www/`.
|
|
106
|
+
|
|
107
|
+
## Library Usage
|
|
108
|
+
|
|
109
|
+
### Local Development (No Build Required)
|
|
110
|
+
|
|
111
|
+
The workspace is configured with TypeScript path mapping:
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
// tsconfig.json
|
|
115
|
+
{
|
|
116
|
+
"paths": {
|
|
117
|
+
"@naniteninja/liveness-verification": [
|
|
118
|
+
"projects/facecog-liveness-verification/src/public-api.ts"
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Import Examples
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
// Types (single export per file)
|
|
128
|
+
import { LivenessBackend } from '@naniteninja/liveness-verification';
|
|
129
|
+
import { VerificationFlowStep } from '@naniteninja/liveness-verification';
|
|
130
|
+
import { PoseCategory } from '@naniteninja/liveness-verification';
|
|
131
|
+
|
|
132
|
+
// Interfaces (single export per file)
|
|
133
|
+
import { LivenessVerificationConfig } from '@naniteninja/liveness-verification';
|
|
134
|
+
import { LivenessResult } from '@naniteninja/liveness-verification';
|
|
135
|
+
import { PoseDefinition } from '@naniteninja/liveness-verification';
|
|
136
|
+
|
|
137
|
+
// Constants
|
|
138
|
+
import { DEFAULT_LIVENESS_CONFIG } from '@naniteninja/liveness-verification';
|
|
139
|
+
import { POSE_DEFINITIONS } from '@naniteninja/liveness-verification';
|
|
140
|
+
|
|
141
|
+
// Utils
|
|
142
|
+
import { getPoseById, getPosesByCategory } from '@naniteninja/liveness-verification';
|
|
143
|
+
|
|
144
|
+
// Services
|
|
145
|
+
import { LivenessConfigService, PoseSelectionService } from '@naniteninja/liveness-verification';
|
|
146
|
+
|
|
147
|
+
// Module/Component
|
|
148
|
+
import { LivenessVerificationModule, provideLivenessVerification } from '@naniteninja/liveness-verification';
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Module-based Usage
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
import { LivenessVerificationModule } from '@naniteninja/liveness-verification';
|
|
155
|
+
|
|
156
|
+
@NgModule({
|
|
157
|
+
imports: [
|
|
158
|
+
LivenessVerificationModule.forRoot({
|
|
159
|
+
apiUrl: 'https://api.example.com',
|
|
160
|
+
backends: ['amazon', 'facetec']
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
})
|
|
164
|
+
export class AppModule {}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Standalone Usage
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
import { provideLivenessVerification } from '@naniteninja/liveness-verification';
|
|
171
|
+
|
|
172
|
+
bootstrapApplication(AppComponent, {
|
|
173
|
+
providers: [
|
|
174
|
+
provideLivenessVerification({ backends: ['mock'] })
|
|
175
|
+
]
|
|
176
|
+
});
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Template
|
|
180
|
+
|
|
181
|
+
```html
|
|
182
|
+
<facecog-liveness-verification
|
|
183
|
+
[pose]="5"
|
|
184
|
+
(verificationComplete)="onComplete($event)"
|
|
185
|
+
(verificationError)="onError($event)">
|
|
186
|
+
</facecog-liveness-verification>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Available Scripts
|
|
190
|
+
|
|
191
|
+
| Script | Description |
|
|
192
|
+
|--------|-------------|
|
|
193
|
+
| `npm start` | Start the showcase demo app |
|
|
194
|
+
| `npm run build` | Build the demo app |
|
|
195
|
+
| `npm run build:prod` | Build demo app for production |
|
|
196
|
+
| `npm run build:lib` | Build the library |
|
|
197
|
+
| `npm run package` | Build and pack the library |
|
|
198
|
+
| `npm run npm:pub` | Publish library to npm |
|
|
199
|
+
| `npm run bump:lib` | Bump library version |
|
|
200
|
+
| `npm run lint` | Lint the demo app |
|
|
201
|
+
|
|
202
|
+
## Publishing
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Update version
|
|
206
|
+
npm run bump:lib
|
|
207
|
+
|
|
208
|
+
# Build and pack
|
|
209
|
+
npm run package
|
|
210
|
+
|
|
211
|
+
# Publish
|
|
212
|
+
npm run npm:pub
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Code Organization Principles
|
|
216
|
+
|
|
217
|
+
### Single Export Per File
|
|
218
|
+
|
|
219
|
+
All types, interfaces, and enums follow the single-export-per-file pattern:
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
// ✅ Good: types/liveness-backend.type.ts
|
|
223
|
+
export type LivenessBackend = 'amazon' | 'openpose' | 'facetec' | 'azure' | 'mock';
|
|
224
|
+
|
|
225
|
+
// ✅ Good: interfaces/liveness-result.interface.ts
|
|
226
|
+
export interface LivenessResult {
|
|
227
|
+
success: boolean;
|
|
228
|
+
confidence: number;
|
|
229
|
+
// ...
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Barrel Exports (index.ts)
|
|
234
|
+
|
|
235
|
+
Each folder has an `index.ts` that re-exports its contents:
|
|
236
|
+
|
|
237
|
+
```typescript
|
|
238
|
+
// types/index.ts
|
|
239
|
+
export { LivenessBackend } from './liveness-backend.type';
|
|
240
|
+
export { VerificationFlowStep } from './verification-flow-step.type';
|
|
241
|
+
// ...
|
|
242
|
+
|
|
243
|
+
// models/index.ts
|
|
244
|
+
export * from './types';
|
|
245
|
+
export * from './interfaces';
|
|
246
|
+
export * from './constants';
|
|
247
|
+
export * from './utils';
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Features
|
|
251
|
+
|
|
252
|
+
- **40+ Poses**: Face, head, hand, gesture, and combined poses
|
|
253
|
+
- **Multi-Backend**: Amazon, FaceTec, OpenPose, Azure, Mock
|
|
254
|
+
- **TensorFlow.js**: MoveNet for pose detection
|
|
255
|
+
- **MediaPipe**: Face & Hand Landmarker
|
|
256
|
+
- **Configurable**: Thresholds, retries, video recording
|
|
257
|
+
|
|
258
|
+
## Tech Stack
|
|
259
|
+
|
|
260
|
+
- Angular 20
|
|
261
|
+
- Ionic 8
|
|
262
|
+
- TensorFlow.js
|
|
263
|
+
- MediaPipe
|
|
264
|
+
- RxJS
|
|
265
|
+
|
|
266
|
+
## License
|
|
267
|
+
|
|
268
|
+
MIT
|