mirror of
https://github.com/dergigi/boris.git
synced 2025-12-29 20:44:37 +01:00
- Add project structure with TypeScript, React, and Vite - Implement nostr authentication using browser extension (NIP-07) - Add NIP-51 compliant bookmark fetching and display - Create minimal UI with login and bookmark components - Integrate applesauce-core and applesauce-react libraries - Add responsive styling with dark/light mode support - Include comprehensive README with setup instructions This is a minimal MVP for a nostr bookmark client that allows users to view their bookmarks according to NIP-51 specification.
43 lines
1.3 KiB
Markdown
43 lines
1.3 KiB
Markdown
# Applesauce Actions
|
|
|
|
A collection of pre-built actions nostr clients can use. Built on top of `applesauce-core` and `applesauce-factory`.
|
|
|
|
[Documentation](https://hzrd149.github.io/applesauce/typedoc/modules/applesauce-actions.html)
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
npm install applesauce-actions
|
|
```
|
|
|
|
## Overview
|
|
|
|
Actions are common pre-built async operations that apps can perform. They use:
|
|
|
|
- `EventStore` for access to known nostr events
|
|
- `EventFactory` to build and sign new nostr events
|
|
- A `publish` method to publish or save the resulting events
|
|
|
|
The package provides an `ActionHub` class that combines these components into a single manager for easier action execution.
|
|
|
|
## Basic Usage
|
|
|
|
```typescript
|
|
import { ActionHub } from "applesauce-actions";
|
|
import { FollowUser } from "applesauce-actions/actions";
|
|
|
|
async function publishEvent(event: NostrEvent) {
|
|
await relayPool.publish(event, ["wss://relay.example.com"]);
|
|
}
|
|
|
|
// Create an action hub with your event store, factory and publish method
|
|
const hub = new ActionHub(eventStore, eventFactory, publishEvent);
|
|
|
|
// Example: Follow a user
|
|
await hub
|
|
.exec(FollowUser, "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d")
|
|
.forEach((event) => publishEvent(event));
|
|
```
|
|
|
|
For more detailed documentation and examples, visit the [full documentation](https://hzrd149.github.io/applesauce/overview/actions.html).
|