Skip to content

Commit e289acb

Browse files
authored
Merge pull request #731 from dahlia/docs/tutorial/content-sharing
“Creating an image sharing service” tutorial
2 parents 7002f73 + 1e1bb86 commit e289acb

48 files changed

Lines changed: 7451 additions & 165 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/add-vocab/SKILL.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ fediverse. Specifically, verify:
3333
async/sync interface contract
3434
- The `functional` flag is correct — marking a multi-valued property as
3535
functional silently drops values
36-
- Every property `range` entry is accurate — wrong range types produce incorrect
37-
TypeScript types
36+
- Every property `range` entry is accurate — wrong range types produce
37+
incorrect TypeScript types
3838
- The spec document (FEP or W3C spec) has been read in full, not just skimmed
3939

4040
Do not rely solely on automated checks (`mise run check`)—they verify only
@@ -86,8 +86,8 @@ $schema: ../../vocab-tools/schema.yaml
8686
**Entity vs. value type (`entity` flag):**
8787

8888
- `entity: true` — property accessors are `async` and can fetch remote objects
89-
- `entity: false` — property accessors are synchronous; used for embedded value
90-
objects (e.g. `Endpoints`, `Source`, `Hashtag`)
89+
- `entity: false` — property accessors are synchronous; used for embedded
90+
value objects (e.g. `Endpoints`, `Source`, `Hashtag`)
9191

9292
### `defaultContext` format
9393

@@ -117,8 +117,8 @@ defaultContext:
117117
Embedded context entries are YAML mappings where:
118118

119119
- String value `"prefix:term"` or `"https://..."` defines a simple term alias
120-
- Object value with `"@id"` and optionally `"@type": "@id"` defines a term that
121-
should be treated as an IRI (linked resource)
120+
- Object value with `"@id"` and optionally `"@type": "@id"` defines a term
121+
that should be treated as an IRI (linked resource)
122122
123123
### Ensuring complete compaction coverage
124124
@@ -128,9 +128,9 @@ document produced by `toJsonLd()`**, including:
128128
1. **The type's own `compactName`** — if the type has a `compactName`, the
129129
context must map that name to the type's URI.
130130

131-
2. **All own property `compactName`s** — every property defined directly on this
132-
type must have its `compactName` (or full URI fallback) resolvable via the
133-
context.
131+
2. **All own property `compactName`s** — every property defined directly on
132+
this type must have its `compactName` (or full URI fallback) resolvable via
133+
the context.
134134

135135
3. **Inherited properties** — properties from parent types are usually covered
136136
by the parent's context URL (e.g., `https://www.w3.org/ns/activitystreams`

.agents/skills/create-example-app-with-integration/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ Follow the specifications in [ARCHITECTURE.md](./ARCHITECTURE.md) and
136136
- Implement all routes listed in the “Routing” section of
137137
[ARCHITECTURE.md](./ARCHITECTURE.md), using `RequestContext` as described
138138
in the “Server-side data access” section.
139-
- Render HTML pages according to [DESIGN.md](./DESIGN.md). Serve static assets
140-
from the `public/` directory (copy from
139+
- Render HTML pages according to [DESIGN.md](./DESIGN.md). Serve static
140+
assets from the `public/` directory (copy from
141141
[example/public/](./example/public/)).
142142
- Implement the SSE endpoint per the “Server-sent events” section of
143143
[ARCHITECTURE.md](./ARCHITECTURE.md).

AGENTS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ A detailed step-by-step guide is available across three skills:
170170

171171
### Creating database adapters
172172

173-
1. For core KV/MQ interfaces: implement in *packages/fedify/src/federation/kv.ts*
174-
and *packages/fedify/src/federation/mq.ts*
173+
1. For core KV/MQ interfaces: implement in
174+
*packages/fedify/src/federation/kv.ts* and
175+
*packages/fedify/src/federation/mq.ts*
175176
2. For specific database adapters: create dedicated packages
176177
(*packages/sqlite/*, *packages/postgres/*, *packages/mysql/*,
177178
*packages/redis/*, *packages/amqp/*)

CHANGES.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,17 @@ To be released.
243243
redistribution that threadiverse software (Lemmy, Mbin, NodeBB) uses to fan
244244
activity out to every subscriber. [[#704], [#710]]
245245

246+
- Added [*Creating an image sharing service* tutorial], a Pixelfed-style
247+
image-sharing companion to the microblog walk-through. Built on Nuxt 4
248+
and the new `@fedify/nuxt` integration, the tutorial covers actor
249+
dispatchers, key pairs, follow/unfollow flows, image-bearing
250+
`Create(Note)` fan-out and reception, an outbound `Like`/`Undo(Like)`
251+
heart toggle, and threaded comments through `inReplyTo`. The
252+
[companion example repository] keeps one commit per chapter at the
253+
bottom of its log, with a few rehearsal-driven follow-ups landed on top,
254+
and the federation flows are demonstrated against both Mastodon and
255+
Pixelfed. [[#693]]
256+
246257
- Added a custom collections cookbook example for bookmark-like data,
247258
demonstrating cursor pagination, URI-template filtering, collection
248259
counters, actor stream links, and requester-aware collections using
@@ -253,7 +264,10 @@ To be released.
253264
[Bun]: https://bun.sh/
254265
[*Building a threadiverse community platform*]: https://fedify.dev/tutorial/threadiverse
255266
[*Creating your own federated microblog*]: https://fedify.dev/tutorial/microblog
267+
[*Creating an image sharing service* tutorial]: https://fedify.dev/tutorial/content-sharing
268+
[companion example repository]: https://github.com/fedify-dev/content-sharing
256269
[#691]: https://github.com/fedify-dev/fedify/issues/691
270+
[#693]: https://github.com/fedify-dev/fedify/issues/693
257271
[#694]: https://github.com/fedify-dev/fedify/issues/694
258272
[#695]: https://github.com/fedify-dev/fedify/pull/695
259273
[#704]: https://github.com/fedify-dev/fedify/issues/704
@@ -1061,8 +1075,8 @@ Released on February 22, 2026.
10611075
to the standardized `Intl.Locale` class for representing language tags.
10621076
[[#280], [#392] by Jang Hanarae]
10631077

1064-
- The `LanguageString.language` property is now `LanguageString.locale` and
1065-
is of type `Intl.Locale` instead of `LanguageTag`.
1078+
- The `LanguageString.language` property is now `LanguageString.locale`
1079+
and is of type `Intl.Locale` instead of `LanguageTag`.
10661080
- The `LanguageString` constructor now accepts either an `Intl.Locale`
10671081
object or a string for the language parameter.
10681082
- The `Link.language` property is now of type `Intl.Locale` instead
@@ -1782,8 +1796,8 @@ Released on December 24, 2025.
17821796

17831797
### @fedify/nestjs
17841798

1785-
- Allowed Express 5 in the `express` peer dependency range to support NestJS 11.
1786-
[[#492], [#493] by Cho Hasang]
1799+
- Allowed Express 5 in the `express` peer dependency range to support NestJS
1800+
11. [[#492], [#493] by Cho Hasang]
17871801

17881802
[#492]: https://github.com/fedify-dev/fedify/issues/492
17891803
[#493]: https://github.com/fedify-dev/fedify/pull/493
@@ -4083,8 +4097,9 @@ Released on November 30, 2024.
40834097

40844098
- The `Router` now provide the matched route's URI template besides the name.
40854099

4086-
- The return type of `Router.route()` method became `RouterRouteResult | null`
4087-
(was `{ name: string; values: Record<string, string> } | null`).
4100+
- The return type of `Router.route()` method became
4101+
`RouterRouteResult | null` (was
4102+
`{ name: string; values: Record<string, string> } | null`).
40884103
- Added `RouterRouteResult` interface.
40894104

40904105
- Added `getTypeId()` function.
@@ -5733,8 +5748,8 @@ Released on September 26, 2024.
57335748

57345749
- Added options for PostgreSQL drivers to `fedify init` command.
57355750

5736-
- Added `postgres` value to the `-k`/`--kv-store` option of the `fedify init`
5737-
command.
5751+
- Added `postgres` value to the `-k`/`--kv-store` option of the
5752+
`fedify init` command.
57385753
- Added `postgres` value to the `-q`/`--message-queue` option of
57395754
the `fedify init` command.
57405755

CONTRIBUTING.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ Because this project supports both Deno and Node.js/Bun, dependencies must
244244
be added to *both* configuration files:
245245

246246
- *deno.json*: Add to the `imports` field (for Deno).
247-
- *package.json*: Add to `dependencies` or `devDependencies` (for Node.js/Bun).
247+
- *package.json*: Add to `dependencies` or `devDependencies` (for
248+
Node.js/Bun).
248249

249250
For workspace packages, use the pnpm catalog (*pnpm-workspace.yaml*) to manage
250251
versions centrally. In *package.json*, reference catalog versions with
@@ -371,10 +372,10 @@ The repository is organized as a monorepo with the following packages:
371372
creating new Fedify projects. Wraps @fedify/init.
372373
- *packages/amqp/*: AMQP/RabbitMQ driver (@fedify/amqp) for Fedify.
373374
- *packages/astro/*: Astro integration (@fedify/astro) for Fedify.
374-
- *packages/cfworkers/*: Cloudflare Workers integration (@fedify/cfworkers) for
375-
Fedify.
376-
- *packages/debugger/*: Embedded ActivityPub debug dashboard (@fedify/debugger)
375+
- *packages/cfworkers/*: Cloudflare Workers integration (@fedify/cfworkers)
377376
for Fedify.
377+
- *packages/debugger/*: Embedded ActivityPub debug dashboard
378+
(@fedify/debugger) for Fedify.
378379
- *packages/denokv/*: Deno KV integration (@fedify/denokv) for Fedify.
379380
- *packages/elysia/*: Elysia integration (@fedify/elysia) for Fedify.
380381
- *packages/express/*: Express integration (@fedify/express) for Fedify.

docs/.vitepress/config.mts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ const TUTORIAL = {
112112
},
113113
{ text: "Learning the basics", link: "/tutorial/basics.md" },
114114
{ text: "Creating a microblog", link: "/tutorial/microblog.md" },
115+
{
116+
text: "Creating an image sharing service",
117+
link: "/tutorial/content-sharing.md",
118+
},
115119
{ text: "Building a federated blog", link: "/tutorial/astro-blog.md" },
116120
{
117121
text: "Building a threadiverse community",

docs/manual/collections.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,8 @@ Custom collections support the same callback methods as built-in collections:
15671567

15681568
- **`.setCounter()`**: Sets a callback that returns the total number of items
15691569
in the collection
1570-
- **`.setFirstCursor()`**: Sets the cursor for the first page of the collection
1570+
- **`.setFirstCursor()`**: Sets the cursor for the first page of the
1571+
collection
15711572
- **`.setLastCursor()`**: Sets the cursor for the last page of the collection
15721573
- **`.authorize()`**: Sets an authorization predicate to control access to
15731574
the collection

docs/manual/deploy.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -740,10 +740,10 @@ systemd
740740
(`systemctl start fedify@web.service fedify@worker.service`).
741741

742742
Kubernetes
743-
: Two `Deployment`s. Only the web `Deployment` gets a `Service` and `Ingress`.
744-
Scale workers on queue depth (via a custom metric adapter reading from
745-
your MQ backend) rather than CPU—a queue that's falling behind is not
746-
necessarily CPU-bound.
743+
: Two `Deployment`s. Only the web `Deployment` gets a `Service` and
744+
`Ingress`. Scale workers on queue depth (via a custom metric adapter
745+
reading from your MQ backend) rather than CPU—a queue that's falling behind
746+
is not necessarily CPU-bound.
747747

748748
> [!WARNING]
749749
> Do not place worker nodes behind a load balancer or expose them on a
@@ -1214,10 +1214,10 @@ Block abusive instances early
12141214
your own rather than importing them wholesale.
12151215

12161216
Keep the system clock in sync
1217-
: HTTP signatures are valid only within `~FederationOptions.signatureTimeWindow`
1218-
(one hour by default). Run NTP on every web and worker node. Clock
1219-
drift is the second-most-common “it worked in staging” production
1220-
issue after reverse-proxy misconfiguration.
1217+
: HTTP signatures are valid only within
1218+
`~FederationOptions.signatureTimeWindow` (one hour by default). Run NTP on
1219+
every web and worker node. Clock drift is the second-most-common “it
1220+
worked in staging” production issue after reverse-proxy misconfiguration.
12211221

12221222
[Pelago]: https://pelago.1sland.social/blocklist
12231223
[FIRES]: https://fires.fedimod.org/

docs/manual/mq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,8 @@ Best for
538538
: Production use in Cloudflare Workers environments.
539539

540540
Pros
541-
: Persistent, reliable, scalable, easy to set up, native retry with exponential
542-
backoff and dead-letter queues.
541+
: Persistent, reliable, scalable, easy to set up, native retry with
542+
exponential backoff and dead-letter queues.
543543

544544
Cons
545545
: Only available in Cloudflare Workers runtime.

docs/manual/relay.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ Configuration options
132132
keys.
133133

134134
`origin` (required)
135-
: The origin URL where the relay is hosted (e.g., `"https://relay.example.com"`).
135+
: The origin URL where the relay is hosted (e.g.,
136+
`"https://relay.example.com"`).
136137

137138
`name`
138139
: Display name for the relay actor. Defaults to `"ActivityPub Relay"`.

0 commit comments

Comments
 (0)