Skip to content

Community: a demo members app built from OCS systems - #2086

Closed
svaka2000 wants to merge 3 commits into
Open-Coding-Society:mainfrom
svaka2000:feat/community-demo
Closed

svaka2000 wants to merge 3 commits into
Open-Coding-Society:mainfrom
svaka2000:feat/community-demo

Conversation

@svaka2000

Copy link
Copy Markdown
Contributor

I made this demo for the messaging request you sent me on Nov 10. It's a members app for an organization: one new system, Community, put together from Messages, Courses' calendar, the microblog's polls and the theme engine. The organization, its people, its messages and its rules are all made up. It's "Demo Org", an investment group whose limited partners (LPs) put money into one deal at a time, called a series, and the rules are my picks to show what the systems can check. It runs at /community/demo/ on fake data in the browser, so nothing you post is saved or sent anywhere, and a reload starts it over.

  • The group chats and direct messages are Messages' own chat pane (createThread) on a fake backend that answers the same calls Messages makes to Spring. So sending, editing, deleting, replies, pins and Add to calendar work like they do in /dm. Add to calendar puts the event on the demo's own calendar.
  • Updates are posts from staff to all members or to one series. Members read them in Messages' message list and can't post there. The Reply in your group button posts your reply in your series' group chat with the update quoted, not to everyone.
  • An event in an update shows on the Calendar tab, which is Courses' week view. Polls are the microblog's surveys, and the choices are the picker cards Profile uses for personas (ocs__hub-card).
  • A member can report a message, and message staff and moderators but not each other. A moderator gets a Review tab and can hide the message, mute the person for 24 hours or 7 days, or remove them from the group. Staff can do all of that, write updates that another staff member has to approve, and download a CSV of every message, edit and moderator action, for one person or everyone, between two dates.
  • The rules about who can do what are checked in one class, DemoStore, not in the page, including who can follow a group's live chat. That's where a real server would check them.
  • Demo controls at the top switch who you're viewing as and the look (the demo's colors or the site's themes). The colors go through the theme engine's preview, so they only show on this page and a student's own theme doesn't change.
  • The page has no Sass of its own. Its markup uses only the ocs__ grammar, and the chats keep Messages' styles. The main tabs use ocs__tabs--fit from Add ocs__tabs--fit to the tabs grammar, so a page's main tabs fit one row on a phone #2085 to stay on one row on a phone. Without Add ocs__tabs--fit to the tabs grammar, so a page's main tabs fit one row on a phone #2085 they wrap onto two rows, so it's better to merge Add ocs__tabs--fit to the tabs grammar, so a page's main tabs fit one row on a phone #2085 first.
  • The words are in data/texts.yml and the demo organization is in data/demo.yml. The rules are classes with static methods, like Math.max, and the store, backend and views are classes you make with new.
  • It's big because it's a whole system, but everything is in its own folder except one line each in _projects/.makeprojects, AGENTS.md and AGENTS_MD_DOCUMENTATION.md. It's registered without :dev, so make dev leaves it out. Once merged the page is live, but nothing links to it.

An LP's Updates tab at 1440px:

Demo Org's Updates tab at 1440px wide, viewing as Demo LP 1

A series chat on a 390px phone, with a reply that quotes an update:

The Demo Series 1 chat on a phone, with a reply quoting a staff update

The moderator's Review tab on a phone:

The moderator's Review tab on a phone, with a report and the hide, mute and remove buttons

A second staff member approving an update:

Demo Staff 2 approving an update Demo Staff 1 wrote, with the phone notification it would send

Other notes:

  • node --test _projects/systems/community/tests/*.test.mjs runs 60 tests. They read the fake backend's answers with Messages' own message models, so a change to those shapes fails them. A change to the chat pane itself would only show in the browser.
  • I clicked through it in Chrome and in WebKit (the engine Safari uses) at 1440, 390 and 360 px, as each person and in four looks, and checked that Community makes no requests. The page still makes the site's usual calls (who's signed in, the unread count and the activity tracker), and opening a direct message asks for the unread count again, as it does on /dm.

How to try it:

  1. Check out feat/community-demo from svaka2000/Pages-JJ and run make.
  2. Open http://localhost:4500/community/demo/. You start as Demo LP 1. Hover over an update and click Reply in your group. On the Groups tab, send a message in Demo Series 1, then use Report a message (next to the group's name) on Demo LP 9's message about a side deal.
  3. In Demo controls, switch to Demo Moderator, open Review, and click Hide and mute 24 hours. Switch to Demo LP 9: their Demo Series 1 chat is read-only, with a note saying until when.
  4. Switch to Demo Staff 1 and send an update for approval. Switch to Demo Staff 2 and approve it in Review. Under Export records, pick Demo LP 9 and download the CSV.

A members app for an organization, put together from OCS systems. This commit holds its words, a made-up demo organization's setup, the static rule classes (roles, the DM rule, channels, moderation, records, plain calendar weeks, the brand), and DemoStore and DemoBackend, which answer Messages' createMessagesApi calls in Spring's shapes and make every check a server would make.
The page at /community/demo/ hands the other systems' modules to CommunityApp: Messages' thread pane for group chats and direct messages, its message log for updates, Courses' week view for the calendar, the microblog's surveys for polls, and the theme engine for the organization's colors. Downloads go through Messages' saveBlob.
@svaka2000

Copy link
Copy Markdown
Contributor Author

Combined into #2090 with the same commits.

@svaka2000 svaka2000 closed this Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant