What the whole site did, told two ways. Over a period, one of the digests'
cadences: its most upvoted dumps, who joined, the new public playlists and
the totals, which the /community page shows as they were at the server's
last refresh and the digests gather for each reader's own period. And as it
happens: the community feed, the latest things its members did in public,
which the GeoCities style's marquee scrolls.
Returned by GET /api/community/feed to CommunityFeedProvider, which
asks again as the socket tells of changes, and rendered by the
CommunityFeed component with who is online, which the client knows from
its socket. community-service.ts gathers it. Everything in it is public:
every reader gets the same feed.
-
events: CommunityEvent[]
The latest events, newest first, 12 at most.
-
week: Pick<CommunityStats, "totals" | "chatMessages">
& { top?: CommunityItem; }The last week's figures, as
/communityshows them: as of the server's last refresh.
Names a dump or a playlist in a CommunityEvent: its title, and what
dumpPath or playlistPath builds its page's path from.
Returned by GET /api/community?period= to the Community page, and
gathered by community-service.ts, which the digests read too.
- chatMessages: number
-
from: Date
The period covered, from
fromtoto. -
members: PublicUser[]
In sign-up order, each with
invitedByUsernamewhen someone invited them. -
playlists: Playlist[]
The public playlists created in it, the fullest first, with
dumpCount. - to: Date
-
top: Dump[]
The most upvoted public dumps posted in it, 10 at most.
-
totals: { dumps: number; upvotes: number; comments: number; }
Public dumps posted, upvotes cast and comments written in it.
A public dump got a comment. However many it got, the feed tells of its latest alone.
-
commentId: string
For the
#comment-<id>anchor on the dump's page. - dump: CommunityItem
- type: "dump_commented"
A public dump was posted. A dump made public later keeps its date.
A public dump got an upvote, told as DumpCommentedEvent is.
Someone joined the site: username is theirs.
| PlaylistCreatedEvent
| DumpCommentedEvent
| DumpUpvotedEvent
| UserJoinedEvent
One line of the community feed, told apart by type.
Usage
import * as mod from "shared/community.ts";