You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An Open Educational Resources (OER) discovery system built on Nostr and built on [AMB](https://dini-ag-kim.github.io/amb/draft/), providing:
6
+
An Open Educational Resources (OER) discovery system built on Nostr and built on [AMB](https://dini-ag-kim.github.io/amb/latest/), providing:
7
7
8
8
1.**Proxy Service**: Forwards search queries to configurable source adapters and returns unified OER results via a public API. Supports searching an AMB Nostr relay, Openverse, ARASAAC, RPI-Virtuell, and more through an **extendable adapter system** - add your own adapters to integrate any external API.
9
9
2.**Source Adapters**: Pluggable adapters for OER sources (e.g., AMB relay, ARASAAC, Openverse) that integrate seamlessly with search results. The adapter plugin system makes it easy to add new sources.
Copy file name to clipboardExpand all lines: docs/client-packages-angular.md
+74-25Lines changed: 74 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Using OER Finder Plugin in Angular
2
2
3
-
This guide covers Angular-specific integration. For component propertiesand events, see [Client Packages](./client-packages.md).
3
+
This guide covers Angular-specific integration. For component properties, events, available adapters, key types, and operating modes, see [Client Packages](./client-packages.md).
4
4
5
5
## Installation
6
6
@@ -14,7 +14,23 @@ For additional installation details (pnpm overrides, etc.), see [Client Packages
14
14
15
15
## Angular Configuration
16
16
17
-
Angular requires `CUSTOM_ELEMENTS_SCHEMA` to recognize web component tags:
17
+
Angular requires `CUSTOM_ELEMENTS_SCHEMA` to recognize web component tags.
The recommended pattern is to slot `<oer-list>` and `<oer-load-more>` inside `<oer-search>`.
47
+
The recommended pattern is to slot `<oer-list>` and `<oer-load-more>` inside `<oer-search>`. Use `@ViewChild` with `ElementRef` to access the underlying web component elements. For the full list of component properties and events, see [Component Properties](./client-packages.md#component-properties).
32
48
33
49
### Component
34
50
@@ -51,11 +67,13 @@ export class OerFinderComponent implements AfterViewInit {
Angular uses `(event-name)="handler($event)"` syntax for web component events:
139
+
110
140
```html
111
141
<oer-search
112
142
#searchElement
113
143
api-url="https://your-api-url.com"
114
-
language="de"
144
+
language="en"
115
145
page-size="20"
146
+
(search-loading)="onSearchLoading()"
116
147
(search-results)="onSearchResults($event)"
117
148
(search-error)="onSearchError($event)"
118
149
(search-cleared)="onSearchCleared()"
119
150
>
120
151
<oer-list
121
152
#listElement
122
-
language="de"
153
+
language="en"
123
154
(card-click)="onCardClick($event)"
124
155
></oer-list>
125
156
<oer-load-more
126
157
#loadMoreElement
127
-
language="de"
158
+
language="en"
128
159
></oer-load-more>
129
160
</oer-search>
130
161
```
131
162
132
-
## Configuring Sources
163
+
## Direct Client Mode Example
133
164
134
-
Sources are configured using the `SourceConfig` type and must be set as a JS property (not an HTML attribute).
135
-
Set the `sources` property in `ngAfterViewInit` as shown in the example above.
165
+
The component code is identical to the [server-proxy example above](#basic-usage-server-proxy-mode) with two differences: adapters must be registered at startup, and the `api-url` attribute is omitted. For adapter details, see [Available Adapters](./client-packages.md#available-adapters).
166
+
167
+
**1. Register adapters once at your app entry point (e.g., `main.ts`):**
@@ -14,63 +14,10 @@ The base plugin is a peer dependency of the React package. Both packages must be
14
14
15
15
## Operating Modes
16
16
17
-
The plugin supports two operating modes, determined by whether the `apiUrl` prop is provided:
17
+
The plugin supports **server-proxy mode** (with `apiUrl` prop) and **direct client mode** (without `apiUrl`). For full details on each mode, adapter registration, and available adapters, see [Client Packages — Routing Modes](./client-packages.md#routing-modes) and [Available Adapters](./client-packages.md#available-adapters).
18
18
19
-
### Server-Proxy Mode (with `apiUrl`)
20
-
21
-
When `apiUrl` is set, all search requests are routed through your backend proxy. The server handles adapter logic, so **no adapter code is bundled into your client application**.
22
-
23
-
**Use this mode when:**
24
-
- You have a deployed OER Proxy backend
25
-
- You want to keep client bundle size small
26
-
- You need server-side features like image proxying, rate limiting, or signed URLs
27
-
28
-
```tsx
29
-
<OerSearch
30
-
apiUrl="https://your-api-url.com"
31
-
sources={SOURCES}
32
-
// ...event handlers
33
-
>
34
-
```
35
-
36
-
No adapter registration is needed — just provide the `apiUrl` and configure your sources.
37
-
38
-
### Direct Client Mode (without `apiUrl`)
39
-
40
-
When `apiUrl` is **omitted**, adapters run directly in the browser. No backend server is required.
41
-
42
-
**Use this mode when:**
43
-
- You want a serverless setup with no backend dependency
44
-
- You are prototyping or building a static site
45
-
- You want full client-side control over adapter behavior
46
-
47
-
You **must register adapters** before the component renders. Call the registration function once at your app's entry point. Import adapter registration functions directly from `@edufeed-org/oer-finder-plugin`:
48
-
49
-
```typescript
50
-
// Register all built-in adapters
51
-
import {registerAllBuiltInAdapters} from '@edufeed-org/oer-finder-plugin/adapters';
52
-
registerAllBuiltInAdapters();
53
-
```
54
-
55
-
Or register only the adapters you need:
56
-
57
-
```typescript
58
-
import {registerOpenverseAdapter} from '@edufeed-org/oer-finder-plugin/adapter/openverse';
59
-
import {registerArasaacAdapter} from '@edufeed-org/oer-finder-plugin/adapter/arasaac';
60
-
registerOpenverseAdapter();
61
-
registerArasaacAdapter();
62
-
```
63
-
64
-
Then render `OerSearch` without `apiUrl`:
65
-
66
-
```tsx
67
-
<OerSearch
68
-
sources={SOURCES}
69
-
// ...event handlers (no apiUrl prop)
70
-
>
71
-
```
72
-
73
-
Only registered adapters will be available — unregistered source IDs in the `sources` config are silently skipped.
19
+
-**Server-proxy mode**: Set `apiUrl` — no adapter registration needed, no adapter code in your bundle.
20
+
-**Direct client mode**: Omit `apiUrl` — register adapters at your app's entry point before the component renders. Import adapter registration functions from `@edufeed-org/oer-finder-plugin`.
74
21
75
22
## Basic Usage
76
23
@@ -291,75 +238,35 @@ If you render `OerLoadMore` outside of `OerSearch`, the event will not bubble to
291
238
|------|-------------------|-------------|
292
239
|`onLoadMore`|`(event: CustomEvent<void>) => void`| Fired when the "Load more" button is clicked. When slotted inside `OerSearch`, this event bubbles up automatically to trigger the next page fetch — no manual handler needed. |
293
240
294
-
## Available Adapters
295
-
296
-
The following built-in adapters are available for direct client mode:
Register all at once or selectively — import adapter registration functions from `@edufeed-org/oer-finder-plugin`:
307
-
308
-
```typescript
309
-
// All adapters
310
-
import {registerAllBuiltInAdapters} from '@edufeed-org/oer-finder-plugin/adapters';
311
-
registerAllBuiltInAdapters();
312
-
313
-
// Or selectively (better for tree-shaking)
314
-
import {registerOpenverseAdapter} from '@edufeed-org/oer-finder-plugin/adapter/openverse';
315
-
import {registerWikimediaAdapter} from '@edufeed-org/oer-finder-plugin/adapter/wikimedia';
316
-
registerOpenverseAdapter();
317
-
registerWikimediaAdapter();
318
-
```
319
-
320
241
## Key Types
321
242
322
-
React components and UI-related types are importable from `@edufeed-org/oer-finder-plugin-react`:
243
+
The React package (`@edufeed-org/oer-finder-plugin-react`) re-exports all shared types from the base plugin, so you can import everything from a single package. For the full list of shared types, see [Key Types](./client-packages.md#key-types).
0 commit comments