@naniteninja/profile-comparison-lib 1.0.0 → 1.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/README.md
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Angular library that renders a side-by-side profile comparison (two profile images, a central draggable shape, and aligned interest lists). It is a **thin client**: you provide a backend URL; the library sends user config to your backend and displays the payload it returns. No API keys or key-entry modals in the library.
|
|
4
4
|
|
|
5
|
-
**You need a backend** that implements the profile comparison API (e.g. the
|
|
5
|
+
**You need a backend** that implements the profile comparison API (e.g. the reference server in this repo). Provide its base URL via `PROFILE_COMPARISON_API_BASE_URL`. If not provided, the component shows **"Configure backend"**.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## Quickstart
|
|
10
10
|
|
|
11
|
-
1. **Install the package**
|
|
11
|
+
1. **Install the package and peer dependencies** (including TensorFlow; required for Vite and other bundlers):
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install profile-comparison-lib
|
|
14
|
+
npm install @naniteninja/profile-comparison-lib @angular/core@^20 @angular/common@^20 @tensorflow/tfjs @tensorflow-models/universal-sentence-encoder
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
2. **Provide the backend URL**
|
|
@@ -19,7 +19,7 @@ Angular library that renders a side-by-side profile comparison (two profile imag
|
|
|
19
19
|
In `app.config.ts` (or `AppModule`):
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
|
-
import { PROFILE_COMPARISON_API_BASE_URL } from 'profile-comparison-lib';
|
|
22
|
+
import { PROFILE_COMPARISON_API_BASE_URL } from '@naniteninja/profile-comparison-lib';
|
|
23
23
|
|
|
24
24
|
providers: [
|
|
25
25
|
{ provide: PROFILE_COMPARISON_API_BASE_URL, useValue: 'https://your-backend.com/api' },
|
|
@@ -41,7 +41,7 @@ Angular library that renders a side-by-side profile comparison (two profile imag
|
|
|
41
41
|
Import the module and add the component to a template:
|
|
42
42
|
|
|
43
43
|
```typescript
|
|
44
|
-
import { ProfileComparisonLibModule } from 'profile-comparison-lib';
|
|
44
|
+
import { ProfileComparisonLibModule } from '@naniteninja/profile-comparison-lib';
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
```html
|
|
@@ -66,10 +66,10 @@ No key-entry modals or API key inputs appear in the library; all keys and third-
|
|
|
66
66
|
|
|
67
67
|
1. Create or open an Angular app (Angular ^20.0.0).
|
|
68
68
|
|
|
69
|
-
2. Install the library and peer dependencies:
|
|
69
|
+
2. Install the library and peer dependencies (TensorFlow is required for dependency optimization in Vite etc.):
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
|
-
npm install profile-comparison-lib @angular/core@^20 @angular/common@^20
|
|
72
|
+
npm install @naniteninja/profile-comparison-lib @angular/core@^20 @angular/common@^20 @tensorflow/tfjs @tensorflow-models/universal-sentence-encoder
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
3. Add the backend URL provider in `app.config.ts`:
|
|
@@ -77,7 +77,7 @@ No key-entry modals or API key inputs appear in the library; all keys and third-
|
|
|
77
77
|
```typescript
|
|
78
78
|
import { ApplicationConfig } from '@angular/core';
|
|
79
79
|
import { provideHttpClient } from '@angular/common/http';
|
|
80
|
-
import { PROFILE_COMPARISON_API_BASE_URL } from 'profile-comparison-lib';
|
|
80
|
+
import { PROFILE_COMPARISON_API_BASE_URL } from '@naniteninja/profile-comparison-lib';
|
|
81
81
|
|
|
82
82
|
export const appConfig: ApplicationConfig = {
|
|
83
83
|
providers: [
|
|
@@ -90,7 +90,7 @@ No key-entry modals or API key inputs appear in the library; all keys and third-
|
|
|
90
90
|
Or in `AppModule`:
|
|
91
91
|
|
|
92
92
|
```typescript
|
|
93
|
-
import { PROFILE_COMPARISON_API_BASE_URL } from 'profile-comparison-lib';
|
|
93
|
+
import { PROFILE_COMPARISON_API_BASE_URL } from '@naniteninja/profile-comparison-lib';
|
|
94
94
|
|
|
95
95
|
@NgModule({
|
|
96
96
|
providers: [
|
|
@@ -103,7 +103,7 @@ No key-entry modals or API key inputs appear in the library; all keys and third-
|
|
|
103
103
|
4. Import the module where you use the component:
|
|
104
104
|
|
|
105
105
|
```typescript
|
|
106
|
-
import { ProfileComparisonLibModule } from 'profile-comparison-lib';
|
|
106
|
+
import { ProfileComparisonLibModule } from '@naniteninja/profile-comparison-lib';
|
|
107
107
|
|
|
108
108
|
@NgModule({
|
|
109
109
|
imports: [ProfileComparisonLibModule, ...],
|
|
@@ -180,7 +180,7 @@ No key-entry modals or API key inputs appear in the library; all keys and third-
|
|
|
180
180
|
|
|
181
181
|
## Backend API contract
|
|
182
182
|
|
|
183
|
-
The library calls your backend at `POST {baseUrl}/profile/compare-full` with body `{ config: IProfileConfig }`. The backend should return a display payload (face results, aligned lists, center item, matrix data, raw LLM output). See the
|
|
183
|
+
The library calls your backend at `POST {baseUrl}/profile/compare-full` with body `{ config: IProfileConfig }`. The backend should return a display payload (face results, aligned lists, center item, matrix data, raw LLM output). See the reference server in this repo (`server/`) and the lib interface `IComparisonPayload` for the response shape.
|
|
184
184
|
|
|
185
185
|
---
|
|
186
186
|
|
|
@@ -190,4 +190,4 @@ The library calls your backend at `POST {baseUrl}/profile/compare-full` with bod
|
|
|
190
190
|
ng build profile-comparison-lib
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
-
Output is in `dist/profile-comparison-lib/` (FESM, typings, package.json). Peer dependencies: Angular `^20.0.0`
|
|
193
|
+
Output is in `dist/profile-comparison-lib/` (FESM, typings, package.json). Peer dependencies: Angular `^20.0.0` and TensorFlow (`@tensorflow/tfjs`, `@tensorflow-models/universal-sentence-encoder`).
|