@eryv/federation-server 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/README.md +73 -0
- package/package.json +25 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# @eryv/federation-server
|
|
2
|
+
|
|
3
|
+
Federation server for the [eryv](https://github.com/eryv-ai/eryv) agentic AI conversation platform. Handles content hosting, the peering protocol, user accounts, and community features. This is the only component that requires hosting infrastructure — the core product (engine + frontend) works without it.
|
|
4
|
+
|
|
5
|
+
> **Status:** Early development (0.0.1). The server skeleton is in place but API routes are not yet implemented. See the [roadmap](https://github.com/eryv-ai/eryv/blob/main/docs/concept/08-roadmap.md) for timeline.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
The federation server exposes two API surfaces:
|
|
10
|
+
|
|
11
|
+
### Client-Server (C-S) API
|
|
12
|
+
|
|
13
|
+
How the frontend talks to a federation instance:
|
|
14
|
+
|
|
15
|
+
- Content CRUD (publish, browse, search, install)
|
|
16
|
+
- User authentication and profiles
|
|
17
|
+
- Social features (ratings, comments, collections)
|
|
18
|
+
- Instance info and rules
|
|
19
|
+
|
|
20
|
+
### Server-Server (S-S) API
|
|
21
|
+
|
|
22
|
+
How federation instances talk to each other:
|
|
23
|
+
|
|
24
|
+
- Peering (request, accept, reject)
|
|
25
|
+
- Content synchronization (push, pull, since-timestamp)
|
|
26
|
+
- Identity verification (vouch for users across instances)
|
|
27
|
+
- Moderation signals (reports, blocks)
|
|
28
|
+
|
|
29
|
+
## Design Principles
|
|
30
|
+
|
|
31
|
+
- **Separate from the core product.** The engine and frontend never depend on federation being available.
|
|
32
|
+
- **Every instance is equal.** No instance has protocol-level privileges. The main site's advantage is network effects, not protocol advantage.
|
|
33
|
+
- **Moderation is local.** Each instance sets its own policy (NSFW rules, blocked tags, peering approval, rate limits).
|
|
34
|
+
- **Content is signed at origin.** Published content is cryptographically signed by the origin instance.
|
|
35
|
+
- **Identity is per-instance.** Users authenticate with their home instance (`@username@instance.domain`).
|
|
36
|
+
|
|
37
|
+
## Running
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Development
|
|
41
|
+
pnpm dev
|
|
42
|
+
|
|
43
|
+
# Production
|
|
44
|
+
pnpm build && pnpm start
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Docker
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Full stack (federation + postgres)
|
|
51
|
+
docker compose up federation-server
|
|
52
|
+
|
|
53
|
+
# Or build directly
|
|
54
|
+
docker build -f packages/federation-server/Dockerfile -t eryv-federation .
|
|
55
|
+
docker run -p 3000:3000 \
|
|
56
|
+
-e DATABASE_URL=postgres://user:pass@host:5432/eryv \
|
|
57
|
+
-e JWT_SECRET=change-me \
|
|
58
|
+
eryv-federation
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Environment Variables
|
|
62
|
+
|
|
63
|
+
| Variable | Required | Default | Description |
|
|
64
|
+
|---|---|---|---|
|
|
65
|
+
| `DATABASE_URL` | Yes | — | Postgres connection string |
|
|
66
|
+
| `PORT` | No | `3000` | Server port |
|
|
67
|
+
| `NODE_ENV` | No | — | Set to `production` for deployed instances |
|
|
68
|
+
| `INSTANCE_DOMAIN` | No | — | Public domain for federation identity |
|
|
69
|
+
| `JWT_SECRET` | Yes (prod) | — | Secret for auth tokens |
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
[AGPL-3.0-only](https://github.com/eryv-ai/eryv/blob/main/LICENSE)
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@eryv/federation-server",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Federation server — content hosting, peering protocol, community features",
|
|
5
|
+
"license": "AGPL-3.0-only",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsup",
|
|
17
|
+
"dev": "tsup --watch",
|
|
18
|
+
"start": "node dist/index.js",
|
|
19
|
+
"test": "vitest run --passWithNoTests",
|
|
20
|
+
"test:watch": "vitest",
|
|
21
|
+
"typecheck": "tsc --noEmit",
|
|
22
|
+
"lint": "eslint src/",
|
|
23
|
+
"clean": "rm -rf dist"
|
|
24
|
+
}
|
|
25
|
+
}
|