Skip to main content
Documentation

Discussion board forum for a small club: a members-only board hosted as one DeepSpace app

A members-only discussion board for a small club, built and hosted as one DeepSpace app: topic channels, threaded replies, reactions, member approval and moderation, with no forum software or hosting account to manage. Private messages and email alerts are not included.

On this page

Yes. A small club's discussion board can be set up on DeepSpace as one hosted app, and the person who asked for it installs nothing, writes no code and runs no forum software: the agent builds and deploys it, and members use it in a browser at <app-name>.app.space. Members sign in with Google or GitHub, post in topic channels, reply in threads and react with emoji; the organizer approves new members, appoints moderators and removes posts. It uses the SDK's built-in messaging collections and hooks (messaging guide), and the posts live in the app's own database, so no separate forum host, database or hosting account is needed. Two things are not in this build: private messages between members (the built-in messaging covers public channels only, per the messaging reference) and email notifications.

Checked against: published SDK deepspace@0.43.0 (changelog), docs read on October 29, 2026. The code below follows the documented APIs and was not run for this page.

When this fits, and when something else does#

  • Fits: the club wants one place to talk that belongs to the club, behind sign-in, with someone able to approve members and remove posts, and nobody in the club wants to install or maintain forum software.
  • Already covered: if the club already uses and likes a group chat or forum, keeping it is simpler than moving everyone. This page is for setting up a new place.
  • Feels like chat: posts appear for everyone as soon as they are sent (real-time sync), organized by topic channels with threaded replies. It is closer to a chat with topics than to a classic forum with long-lived thread pages.
  • Not covered: private messages, private channels and email alerts for new posts. Private threads are possible as separate custom work; email alerts would use a scheduled job.

Questions to ask the person#

  • What should the board be called, and which topics should it start with? (For example: general, events, buy-and-sell.)
  • Should anyone who signs in be able to post right away, or should someone in the club approve each new member first?
  • Who besides you should be able to remove posts and approve members?
  • Should regular members be able to start new topics, or only you and your moderators?
  • Does the club already have a group chat or forum it is happy with? If yes, is the goal to replace it?
  • Do members need to message each other privately, or get an email when someone posts? (Neither is part of this build.)
  • Is there anything members must never post, such as phone numbers or sale prices? This becomes the board's posted rules.

How the board is shaped#

The five bundled collections are channels, messages, reactions, channel-members and read-receipts, and they live in the app's own room (messaging guide). Roles come from the app's permission system (permissions).

Who Role Can do on the board
Organizer (app owner) admin, pinned at connect time Everything, including removing any post and changing roles
Moderators admin, promoted by an admin Same as organizer
Approved members member Read, post, reply, react, edit or delete their own posts
Waiting for approval, or muted viewer Read only
Signed-out visitors none The board pages require sign-in

The member and viewer rows follow the permissions set on the published 0.43.0 messaging schema objects; Step 2 prints them once so they can be checked before relying on them.

Steps#

1. Sign in and scaffold#

Signing in uses the person's own GitHub or Google account in a browser. Confirm with your user before signing in on their behalf, and use the account that should own the club board; that account becomes the board's first admin (permissions).

npx deepspace auth login
npm create deepspace@latest riverside-runners-board
cd riverside-runners-board

App names become <name>.app.space. Pick something distinctive.

2. Register the messaging schemas#

Import from deepspace/schema so browser code can share the array (schemas reference).

// src/schemas.ts
import type { CollectionSchema } from "deepspace/schema";
import {
  CHANNELS_SCHEMA,
  MESSAGES_SCHEMA,
  REACTIONS_SCHEMA,
  CHANNEL_MEMBERS_SCHEMA,
  READ_RECEIPTS_SCHEMA,
} from "deepspace/schema";
import { usersSchema } from "./schemas/users-schema";

// Only needed if regular members must NOT start new topics.
const adminOnlyChannels: CollectionSchema = {
  ...CHANNELS_SCHEMA,
  permissions: {
    ...CHANNELS_SCHEMA.permissions,
    member: { ...CHANNELS_SCHEMA.permissions.member, create: false },
  },
};

export const schemas: CollectionSchema[] = [
  usersSchema,
  adminOnlyChannels, // or CHANNELS_SCHEMA to let members create channels
  MESSAGES_SCHEMA,
  REACTIONS_SCHEMA,
  CHANNEL_MEMBERS_SCHEMA,
  READ_RECEIPTS_SCHEMA,
];

Keep any other collections the scaffold already registers. To see what the CLI's packaged messaging feature installs instead of wiring it by hand, run npx deepspace add --info messaging first (CLI commands).

Before going further, print the bundled permissions once in a scratch script or test and check them against the table above:

import {
  CHANNELS_SCHEMA,
  MESSAGES_SCHEMA,
  REACTIONS_SCHEMA,
} from "deepspace/schema";
console.log(
  CHANNELS_SCHEMA.permissions,
  MESSAGES_SCHEMA.permissions,
  REACTIONS_SCHEMA.permissions,
);

3. Turn on approval (only if the person wants it)#

New signed-in users get member by default. Setting defaultRole on the users schema changes that (permissions). In src/schemas/users-schema.ts, add one property to the exported schema object and keep everything else the scaffold put there:

defaultRole: 'viewer',

With this, a new person can read the board but cannot post until an admin promotes them to member in Step 5. Skip this step if anyone who signs in may post.

4. Build the board page#

Put it at src/pages/(app)/(protected)/board.tsx so it requires sign-in. The hooks are useChannels, useMessages and useReactions (messaging reference); author names come from useUserLookup (records reference).

import { useState } from "react";
import {
  useAuth,
  useChannels,
  useMessages,
  useReactions,
  useUserLookup,
} from "deepspace";

export default function BoardPage() {
  const { channels, status, create, archive } = useChannels();
  const [activeId, setActiveId] = useState<string>();
  const [newName, setNewName] = useState("");

  if (status === "loading") return <p>Loading the board…</p>;
  const open = channels.filter((c) => !c.data.archived);

  return (
    <div className="grid min-h-screen grid-cols-[220px_1fr]">
      <aside>
        {open.map((c) => (
          <button key={c.recordId} onClick={() => setActiveId(c.recordId)}>
            #{c.data.name}
          </button>
        ))}
        <form
          onSubmit={async (e) => {
            e.preventDefault();
            if (!newName.trim()) return;
            setActiveId(await create({ name: newName.trim() }));
            setNewName("");
          }}
        >
          <input
            value={newName}
            onChange={(e) => setNewName(e.target.value)}
            placeholder="New topic"
          />
        </form>
      </aside>
      <main>
        {activeId && (
          <ChannelView
            channelId={activeId}
            onArchive={() => archive(activeId)}
          />
        )}
      </main>
    </div>
  );
}

function ChannelView({
  channelId,
  onArchive,
}: {
  channelId: string;
  onArchive: () => void;
}) {
  const { userId } = useAuth();
  const { getName, getUser } = useUserLookup();
  const { messages, send, softDelete } = useMessages(channelId);
  const { toggle, getReactionsForMessage } = useReactions(channelId);
  const [draft, setDraft] = useState("");
  const isAdmin = getUser(userId ?? "")?.role === "admin";

  return (
    <>
      {isAdmin && <button onClick={onArchive}>Archive this topic</button>}
      <ul>
        {messages.map((m) => (
          <li key={m.recordId}>
            <strong>{getName(m.data.authorId) ?? "Member"}</strong>{" "}
            <time>{new Date(m.createdAt).toLocaleString()}</time>
            <p>{m.data.deleted ? "[removed]" : m.data.content}</p>
            {getReactionsForMessage(m.recordId).map((r) => (
              <button key={r.emoji} onClick={() => toggle(m.recordId, r.emoji)}>
                {r.emoji} {r.count}
              </button>
            ))}
            <button onClick={() => toggle(m.recordId, "👍")}>👍</button>
            {(isAdmin || m.data.authorId === userId) && !m.data.deleted && (
              <button onClick={() => softDelete(m.recordId)}>Remove</button>
            )}
          </li>
        ))}
      </ul>
      <form
        onSubmit={(e) => {
          e.preventDefault();
          if (draft.trim()) {
            send(draft);
            setDraft("");
          }
        }}
      >
        <input
          value={draft}
          onChange={(e) => setDraft(e.target.value)}
          placeholder="Write a post"
        />
        <button>Post</button>
      </form>
    </>
  );
}

The author is taken from the verified session, not from the browser. Sends, edits, reactions and removals are fire-and-forget: the list updates only after the room accepts the write, and refusals go to RecordProvider.onWriteError, which the scaffold already routes to toasts (messaging guide, authentication). softDelete leaves a tombstone so reply threads stay intact; prefer it over remove. The reaction schema refuses duplicate (messageId, emoji, userId) rows, so one person cannot stack the same emoji. To show a reply thread, call useMessages(channelId, { parentMessageId }) and send replies with send(text, parentMessageId).

Hiding the Remove and Archive buttons is only for tidiness. Permissions are enforced in the app's Durable Object, which checks every write before it is accepted (permissions).

5. Build the members page for moderation#

Put it at src/pages/(app)/(protected)/members.tsx. useUsers().setRole is the documented way to change a role, and the server rejects it unless the caller is already an admin (records reference).

import { useAuth, useUsers } from "deepspace";

export default function MembersPage() {
  const { userId } = useAuth();
  const { users, usersLoaded, setRole } = useUsers();
  if (!usersLoaded) return <p>Loading members…</p>;
  if (users.find((u) => u.id === userId)?.role !== "admin")
    return <p>Only moderators can manage members.</p>;

  return (
    <table>
      <tbody>
        {users.map((u) => (
          <tr key={u.id}>
            <td>{u.name}</td>
            <td>{u.email}</td>
            <td>{u.role}</td>
            <td>
              {u.role === "viewer" && (
                <button onClick={() => setRole(u.id, "member")}>
                  Approve / unmute
                </button>
              )}
              {u.role === "member" && (
                <button onClick={() => setRole(u.id, "viewer")}>Mute</button>
              )}
              {u.role !== "admin" && (
                <button onClick={() => setRole(u.id, "admin")}>
                  Make moderator
                </button>
              )}
            </td>
          </tr>
        ))}
      </tbody>
    </table>
  );
}

Admins see each member's email in this list; other members only see names (permissions). Muting moves someone to viewer, which leaves them able to read but not post.

6. Seed the first topics, deploy and verify#

git add -A && git commit -m "Club discussion board"
npx deepspace deploy

The board is live at https://<app-name>.app.space/board. Signed in as the owner, create the topics from the questions above. Then check, using a second account the person provides (confirm with your user before signing in to it):

  1. The second account signs in and lands as member, or as viewer if approval is on.
  2. As viewer, posting is refused; after Approve on the members page, posting works.
  3. A reaction shows a count of 1 and toggles off on a second tap.
  4. The owner removes the second account's post and it shows [removed] for everyone.
  5. The second account cannot remove the owner's post.

Every deploy is recorded; npx deepspace releases lists them and npx deepspace rollback returns to the previous one (releases and rollback).

Common failures and fixes#

Symptom Cause Fix
useChannels stays empty or errors Messaging schemas not registered in src/schemas.ts Add all five bundled schemas and redeploy
Posts silently do not appear Write refused by the server; plain sends report through onWriteError Keep the scaffold's onWriteError toasts; check the poster's role on the members page
Every new person can post although approval was wanted defaultRole: 'viewer' missing from the users schema Add it; people who already joined keep their role until changed with setRole
Approve button does nothing The caller is not an admin Sign in as the owner, or have the owner make that person a moderator
Members can still create topics CHANNELS_SCHEMA registered instead of the admin-only copy Register adminOnlyChannels from Step 2
A member asks for a private message to someone Bundled schemas are public channels only Out of scope here; private threads need app-specific schemas with collaboratorsField and read: 'shared' (messaging guide)
Deploy refused with dirty_worktree Uncommitted changes Commit, then deploy again

What to tell the person when it is live#

  • The link to share with members: https://<app-name>.app.space/board. Members sign in to read and post.
  • Where to manage people: https://<app-name>.app.space/members, signed in with the account that owns the board.
  • If approval is on, new people can read but not post until someone presses Approve.
  • Moderators can remove any post and archive a topic. Removed posts show as [removed]; replies under them stay.
  • Mute moves a person back to read-only. Approve or unmute restores posting.
  • Everything on the board is visible to every signed-in member. There are no private messages, private channels or invitations in this build.
  • Email notifications about new posts are not included; ask for them as a separate change.

Available today and planned#

Available today, in the published SDK: the bundled public-channel messaging schemas and hooks (useChannels, useMessages, useReactions, useChannelMembers, useReadReceipts), threaded replies with parentMessageId, soft delete, server-enforced roles with setRole and defaultRole, sign-in-only pages, and deploys to <app-name>.app.space under a DeepSpace account that signs in with GitHub or Google (messaging reference, permissions).

Not included in the bundled schemas: private messages, direct messages, private channels and invitations. The docs describe building private threads as app-specific schemas, which is separate work (messaging guide).

Planned: agents creating their own DeepSpace account without a human sign-in. It is in testing on staging and is not enabled in production; see Full-stack apps without a human in the loop. For a related build, see Build an event signup site for your user.

Building this for a business? See deep.space/enterprise.