Analysis
Business requirements
These goals explain why Gotion is being built instead of adopting an existing tool.
-
BR-01 — Keep data in-house: Company policies or regulatory obligations may restrict where meeting notes, specifications, and customer data can be stored. Gotion therefore runs on infrastructure controlled by the adopting organization and makes no calls to external services at runtime.
-
BR-02 — Keep costs independent of team size: Per-user pricing becomes expensive as a team grows, especially when many members only need read access. With Gotion, the organization pays for its infrastructure, not for each user it adds.
-
BR-03 — Avoid vendor lock-in: Gotion stores content as Markdown, an open plain-text format, so that the content stays readable without Gotion. Using a proprietary format would recreate the dependency the project is intended to remove.
-
BR-04 — Minimize administrative work: Gotion is intended for small companies and research groups without a dedicated system administrator. Installation, upgrades, and backups must be manageable by one part-time administrator.
-
BR-05 — Make migration familiar: Teams already using Notion should not have to learn an entirely new way of working. Gotion must support familiar features such as nested pages, collaborative editing, and comments.
-
BR-06 — Make the system auditable and adaptable: Gotion is released under the GNU General Public License v3. Organizations can inspect how it handles their data, modify it to meet their needs, and verify the privacy guarantees behind BR-01.
Use cases
These use cases describe how people work with Gotion, from the action that starts a task to its outcome. The story identifiers refer to the Functional requirements, where Gherkin scenarios give concrete acceptance examples for these flows. Actors and roles follow the Ubiquitous language; an Admin can also do everything an Editor can.
UC-01: Access Gotion
Actors: a registered User, or a visitor who needs an account.
Precondition: the person can reach the organization’s Gotion instance.
Trigger: the person wants to access their workspaces.
Related stories: US-01, US-02.
Main flow:
- The user provides their email address and password.
- Gotion checks the credentials and signs the user in.
- Gotion opens the user’s main workspace, the last one they opened. If they have none, because they never opened one or have lost access to it, Gotion opens the first workspace of their directory.
Alternative flows:
- A visitor registers with an unused email address and a valid password. Gotion creates the account and a first workspace and makes the user its Admin. The user can then sign in.
- A registered user with no workspaces can still sign in. Gotion shows an empty workspace directory, from which they can create a workspace or accept a pending invitation.
- If the email address is already registered, Gotion refuses the registration and keeps the existing account unchanged.
- If the credentials are incorrect, Gotion refuses the sign-in. Repeated failed attempts are throttled as specified in QA-07.
Outcome: the user is signed in and can access their workspaces. A failed attempt grants no access.
UC-02: Organize work in a workspace
Actor: a User; renaming or deleting an existing workspace requires its Admin role.
Precondition: the user is signed in.
Trigger: the user needs a separate space for a project or team.
Related stories: US-02, US-03, US-04.
Main flow:
- The user creates a workspace and gives it a name.
- Gotion adds the workspace to their directory, makes them its first Admin, and creates its root page.
- The user opens the workspace and starts working in it.
- Gotion saves it as their main workspace and reopens it at the next login. Every workspace they open later takes its place.
Alternative flows:
- The user opens an existing workspace from their directory. Each successful opening changes the active workspace and updates the saved main workspace.
- Gotion refuses access to a workspace the user does not belong to, without changing the saved main workspace.
- An Admin renames a workspace. Its members see the new name, while its pages and memberships stay unchanged.
- An Admin deletes a workspace. Gotion makes it unavailable to its members and removes its membership, pages, content and discussions. Members who had it as their main workspace are left with none.
- Gotion refuses a blank workspace name, or a rename or deletion requested by an Editor or Viewer.
Outcome: the user can organize and navigate their workspaces, and at the next login finds the last one they opened, or the first of their directory if they lost it.
UC-03: Invite someone to a workspace
Actors: the workspace Admin and the Invitee.
Preconditions: the Admin is signed in, and the invitee has a registered Gotion account.
Trigger: the Admin wants another person to join the workspace.
Related stories: US-03, US-10.
Main flow:
- The Admin enters the invitee’s email address and chooses the Admin, Editor or Viewer role.
- Gotion checks that the user is registered and is neither a member nor already invited to that workspace.
- Gotion records the pending invitation and sends the invitee an in-app notification.
- The invitee opens the invitation and accepts it.
- Gotion adds them to the workspace with the chosen role and ends the invitation.
Alternative flows:
- The invitee declines. Gotion ends the invitation without adding a member.
- The invitee leaves the invitation unanswered. It stays pending and does not expire.
- If the address is not registered, or the user already belongs to the workspace or has a pending invitation, Gotion refuses the invitation.
- Gotion refuses an invitation sent by an Editor or Viewer.
- Only the invitee can accept or decline their invitation.
Outcome: the invitee becomes a member only after accepting, with the role chosen by the Admin.
UC-04: Change workspace membership
Actors: the workspace Admin and the member whose access changes.
Preconditions: the Admin is signed in, and the person whose access changes is a member of that workspace.
Trigger: the Admin needs to change a member’s role or remove their access.
Related stories: US-02, US-03.
Main flow:
- The Admin selects a member and requests their removal.
- Gotion checks that the workspace will keep at least one Admin.
- Gotion removes the member. They can no longer read or change the workspace’s pages or take part in its discussions.
- If this was the removed member’s main workspace, Gotion clears it, and their next login opens the first workspace of their directory. Otherwise, their main workspace stays unchanged.
Alternative flows:
- The Admin changes the member’s role instead. Gotion applies the new role, provided the workspace keeps at least one Admin.
- Removal from a user’s only workspace is allowed. Their account remains usable, with an empty workspace directory.
- A member leaves voluntarily. Gotion applies the same last-Admin check as for removal and clears the main workspace in the same way.
- Gotion refuses removal or demotion of the last Admin. Another member must first become an Admin.
- Gotion refuses membership administration requested by an Editor or Viewer.
Outcome: the member’s access reflects the accepted change. They may have no workspaces afterward, and the original workspace keeps an Admin.
UC-05: Write and organize a page
Actor: an Editor or Admin of the workspace.
Preconditions: the actor is signed in and has opened a page in the workspace.
Trigger: the actor wants to record or reorganize information.
Related stories: US-04, US-05, US-06, US-07.
Main flow:
- The Editor creates a sub-page inside the open page.
- Gotion adds its page block to the parent page and makes the sub-page available to workspace members.
- The Editor sets the page’s title and, if needed, an icon and a cover image link.
- The Editor writes content using text, headings, bulleted, numbered or to-do lists, and code blocks.
- The Editor updates, reorders or nests blocks to structure the content. Gotion saves the accepted changes, which the Editor sees when opening the page again.
Alternative flows:
- The Editor works on an existing page, including the root page, instead of creating a sub-page.
- The Editor changes a content block’s type. The block keeps its position and attached discussions; a page block cannot change into another type or be created by converting a content block.
- The Editor deletes a sub-page. Gotion permanently removes its content and sub-pages, closes its editing session, and removes its discussions. Deleting a block also removes its nested blocks and their attached discussions; any sub-pages represented by deleted page blocks are removed too.
- Gotion refuses a move that would nest a block under itself or one of its descendants, and refuses deletion of the root page while the workspace exists.
- A Viewer opens the page to read it. Gotion refuses their attempts to change content or metadata, and refuses all page access by non-members.
Outcome: workspace members can read the saved page and its place in the hierarchy. Deleted content cannot be restored.
UC-06: Work on a page together
Actors: workspace members as Collaborators. Editors and Admins can submit edits; Viewers can follow them.
Preconditions: the page exists, and the collaborators are signed in and connected to Gotion.
Trigger: a member opens a page that another member is working on.
Related stories: US-04, US-08.
Main flow:
- The member opens the page and joins its editing session.
- Gotion shows the avatars of the connected collaborators to everyone in that session.
- Editors submit changes to the page. Gotion merges concurrent edits and applies the result to its content.
- The collaborators see the same merged content, without Gotion silently discarding acknowledged edits.
Alternative flows:
- A Viewer joins, sees the connected collaborators and follows their edits. Gotion refuses edits submitted by the Viewer.
- A collaborator leaves the page. Their avatar disappears from its presence list.
- An Editor deletes the page. Gotion closes the session, tells its participants that the page was deleted, and accepts no further edits to it.
- A collaborator loses their connection. Editing requires a connection to the server; offline editing is outside the current scope.
Outcome: the connected collaborators share the same page content. The timing and convergence measures are specified in Quality Attributes.
UC-07: Discuss content and mention a member
Actors: workspace members as Collaborators, including Viewers, and any member mentioned in a comment.
Preconditions: the author is signed in, belongs to the workspace, and can access the page or block being discussed.
Trigger: a member has a question or feedback about the content.
Related stories: US-09, US-10.
Main flow:
- The member chooses the page or a block as the discussion’s anchor and posts a comment.
- Gotion opens a thread at that anchor with the first comment.
- Other workspace members reply in the thread. A member mentions another workspace member in a comment.
- Gotion raises an in-app notification for the mentioned member.
- When the discussion is over, a workspace member resolves the thread.
Alternative flows:
- A member replies to an existing unresolved thread instead of opening one.
- The members discuss without mentioning anyone. Gotion creates no mention notification.
- A comment mentions its own author. Gotion creates no notification for that mention.
- Gotion refuses comments or resolution by non-members, and refuses mentions of users outside the workspace.
- Gotion refuses further comments in a resolved thread.
- The anchored page or block is deleted. Gotion removes its threads and their comments.
Outcome: the discussion stays attached to the content until its anchor is deleted. Posting or resolving comments does not change the page’s content.
UC-08: Read an in-app notification
Actor: the notification’s Recipient.
Preconditions: the recipient is signed in, and Gotion has delivered an invitation or mention notification to them.
Trigger: the recipient checks their notifications.
Related story: US-10.
Main flow:
- The recipient opens their in-app notifications.
- Gotion shows the notification and whether it concerns a workspace invitation or a mention.
- The recipient reads it and marks it as read.
- Gotion keeps the read status when the recipient opens their notifications again.
Alternative flows:
- Someone other than the recipient tries to mark the notification as read. Gotion refuses the change.
Outcome: the recipient has read the notification and Gotion records that status. Reading an invitation notification does not itself accept the invitation.
Subdomains
Subdomains are discovered, bounded contexts are designed. The subdomains exist in the business before any design: they are the areas of activity that the business requirements and the interviews behind the Scenario describe, and the user stories are grouped by them. The Event Storming later confirmed them: each one is opened by a pivotal event of the timeline.
| Subdomain | What it covers | User stories | Type |
|---|---|---|---|
| Identity | Registering and signing in | US-01 | Generic |
| Workspace organisation | The workspaces a user creates, renames, deletes and switches between, and the main one, the last they opened | US-02 | Supporting |
| Membership and roles | Who belongs to a workspace, invitations, and the Admin, Editor and Viewer roles | US-03 | Supporting |
| Page content | Nested pages made of Markdown blocks | US-04, US-05, US-06, US-07 | Core |
| Real-time collaboration | Editing a page together, and seeing who else is on it | US-08 | Core |
| Discussion | Comment threads on pages and blocks, and mentions | US-09 | Supporting |
| Notification | In-app notifications about invitations and mentions | US-10 | Generic |
A core subdomain is complex and is what sets the product apart, a supporting one is specific to the product but simple and gives no advantage, a generic one is complex or not but solved the same way by everyone.
- Core: page content and real-time collaboration. They are why a team would move to Gotion
instead of shared
.docxfiles or a wiki (Scenario, BR-05): nested pages made of Markdown blocks (BR-03), edited together and live. They are also the hardest part: QA-01, QA-02 and QA-05 all constrain them, and the Event Storming leaves PP-01 open here. They get the most care in the model and in the code. - Supporting: workspace organisation, membership and roles, discussion. They follow rules of our own (one root page per workspace, the last Admin, threads anchored to blocks), but the logic is mostly creating and updating records, and no team picks Gotion for them.
- Generic: identity and notification. Signing in with an email address and a password, and an in-app inbox, work the same everywhere. So it opens the possibility to adopt an existing solution rather than build one, but BR-01 narrows that choice: Gotion makes no calls to external services at runtime, so a generic subdomain can be covered by a library or a self-hosted component, not by a hosted service.
Functional requirements
Expressed as user stories and grouped by the subdomains of the business they belong to. Non-functional constraints on these behaviours are specified separately as Quality Attributes. Stories outside the current scope are kept aside, without an identifier, in Out of scope.
Each story has a Gherkin feature below it. The scenarios describe what a user can do and what they should observe, including the cases where Gotion must refuse an action.
Identity
- US-01 — Sign up and sign in: As a user, I want to register and authenticate with my email address and password so that I can access Gotion.
Feature: US-01 Sign up and sign in
Scenario: Register with an unused email address
Given no user has registered with "alice@example.com"
When Alice registers with that email address and a valid password
Then Gotion creates her account
And she gets a first workspace as its Admin
Scenario: Refuse an email address already in use
Given Alice has registered with "alice@example.com"
When someone tries to register with the same email address
Then Gotion refuses the registration
And Alice's account stays unchanged
Scenario: Sign in with the correct password
Given Alice has a registered account
When she signs in with her email address and the correct password
Then she can access her workspaces
Scenario: Sign in without any workspace
Given Alice has a registered account
And she belongs to no workspace
When she signs in with her email address and the correct password
Then Gotion shows an empty workspace directory
And she can create a workspace or accept a pending invitation
And no workspace is opened automatically
Scenario: Refuse an incorrect password
Given Alice has a registered account
When she tries to sign in with an incorrect password
Then Gotion refuses the sign-in
And she cannot access her workspaces through that attempt
Workspace organisation
- US-02 — Manage workspaces: As a user, I want to create, rename, delete, and switch between multiple workspaces, and return to the last one I visited at login, so that I can keep different projects or teams separate and resume my work. Each workspace the user opens becomes their main workspace, and Gotion reopens it at the next login. When the user loses access to it, Gotion clears the main workspace, and with none set, login opens the first workspace of the directory. A user may belong to no workspace: login then shows an empty directory, from which they can create a workspace or accept an invitation.
Feature: US-02 Manage workspaces
Scenario: Create a workspace
Given Alice is signed in
And she belongs to no workspace
When she creates a workspace named "Research"
Then "Research" appears in her workspace directory
And she is its first Admin
And it has exactly one root page
Scenario: Rename a workspace
Given Alice is an Admin of "Research"
When she renames it to "Lab notes"
Then its members see the name "Lab notes"
And its pages and memberships stay unchanged
Scenario: Update the main workspace when switching
Given Alice belongs to "Research" and "Teaching"
And her main workspace is "Research"
When she switches to "Teaching"
Then "Teaching" becomes her active workspace
And Gotion remembers "Teaching" as her main workspace
Scenario: Return to the last opened workspace at login
Given Alice belongs to "Research" and "Teaching"
And her main workspace is "Teaching"
When she signs in again
Then Gotion opens "Teaching"
Scenario: Clear the main workspace after losing it
Given Alice and Bob are Admins of "Research"
And Bob's main workspace is "Research"
And Bob also belongs to "Archive" and "Teaching"
When Alice removes Bob from "Research"
Then Bob no longer belongs to "Research"
And Alice remains its Admin
And Gotion clears Bob's main workspace
Scenario: Move to the first workspace when the open one is lost
Given Alice and Bob are Admins of "Research"
And Bob is working in "Research"
And his workspace directory lists "Archive" and "Teaching" in that order
When Alice removes Bob from "Research"
Then Gotion opens "Archive" for Bob
And "Archive" becomes his main workspace
Scenario: Open the first workspace of the directory when no main one is set
Given Bob has no main workspace
And his workspace directory lists "Archive" and "Teaching" in that order
When Bob signs in
Then Gotion opens "Archive"
And "Archive" becomes his main workspace
Scenario: Remove a member from their only workspace
Given Alice and Bob are Admins of "Research"
And Bob's main workspace is "Research"
And Bob belongs to no other workspace
When Alice removes Bob from "Research"
Then Bob belongs to no workspace
And Gotion clears his main workspace
And he can no longer read or change its pages or take part in its discussions
And Alice remains its Admin
Scenario: Refuse opening a workspace the user does not belong to
Given Alice does not belong to "Research"
And her main workspace is "Teaching"
When she tries to open "Research"
Then Gotion refuses access
And her main workspace is still "Teaching"
Scenario: Delete a workspace
Given Alice is an Admin of "Research"
And it is her only workspace
And it is her main workspace
And the workspace contains pages, discussions and other members
When she deletes "Research"
Then the workspace is no longer available to its members
And Gotion removes its root page, sub-pages, content and discussions
And Gotion removes its workspace membership
And Alice belongs to no workspace
And Gotion clears her main workspace
Scenario Outline: Refuse workspace administration by other roles
Given Alice has the <role> role in "Research"
When she tries to <action> the workspace
Then Gotion refuses the action
And the workspace stays unchanged
Examples:
| role | action |
| Editor | rename |
| Editor | delete |
| Viewer | rename |
| Viewer | delete |
Membership and roles
- US-03 — Manage workspace members: As a workspace Admin, I want to invite people to the workspace, remove members, and assign them the Admin, Editor, or Viewer role so that I can control who can read and who can change its content. A workspace always keeps at least one Admin. An invitee can accept or decline the invitation, which does not expire. A member can be removed or leave even if they belong to no other workspace, provided the workspace keeps an Admin.
Feature: US-03 Manage workspace members
Scenario Outline: Invite a registered user with a role
Given Alice is an Admin of "Research"
And Bob is registered with "bob@example.com"
And Bob is neither a member nor already invited to "Research"
When Alice invites "bob@example.com" with the <role> role
Then Bob has a pending invitation to "Research" with that role
And he does not become a member until he accepts
When Bob accepts the invitation
Then he belongs to "Research" with the <role> role
And the invitation is no longer pending
Examples:
| role |
| Admin |
| Editor |
| Viewer |
Scenario: Decline an invitation
Given Bob has a pending invitation to "Research"
When he declines it
Then the invitation is no longer pending
And he does not become a member of "Research"
Scenario: Accept an invitation with no workspace
Given Bob belongs to no workspace
And he has a pending invitation to "Research" as a Viewer
When he accepts it
Then he belongs to "Research" as a Viewer
And the invitation is no longer pending
Scenario: Change a member's role
Given Alice is an Admin of "Research"
And Bob is a Viewer in that workspace
When Alice changes Bob's role to Editor
Then Bob can edit the workspace's pages and blocks
Scenario: Remove a member
Given Alice is an Admin of "Research"
And Bob is an Editor in that workspace
And Bob's main workspace is "Teaching"
When Alice removes Bob
Then Bob no longer belongs to "Research"
And he can no longer read or change its pages or take part in its discussions
And "Teaching" remains his main workspace
Scenario: Leave the only workspace as a Viewer
Given Alice is an Admin of "Research"
And Bob is a Viewer in that workspace
And "Research" is Bob's only workspace and his main workspace
When Bob leaves "Research"
Then Bob belongs to no workspace
And Gotion clears his main workspace
And he can no longer read its pages or take part in its discussions
And Alice remains its Admin
Scenario Outline: Keep at least one Admin
Given Alice is the only Admin of "Research"
When she tries to <action>
Then Gotion refuses the action
And Alice remains an Admin of "Research"
Examples:
| action |
| change her own role to Editor |
| change her own role to Viewer |
| remove herself |
| leave the workspace |
Scenario Outline: Refuse membership administration by other roles
Given Alice has the <role> role in "Research"
When she tries to <action>
Then Gotion refuses the action
And the workspace membership stays unchanged
Examples:
| role | action |
| Editor | invite a user |
| Editor | change a member's role |
| Editor | remove a member |
| Viewer | invite a user |
| Viewer | change a member's role |
| Viewer | remove a member |
Page content
- US-04 — Manage pages and blocks: As an Editor, I want to create, read, update, and delete pages and organize them and their blocks in a tree so that I can structure content hierarchically. Each workspace has exactly one root page, created with the workspace: it holds content like any other page, every new page is created inside it or inside one of its sub-pages, and it is deleted only together with the workspace.
Feature: US-04 Manage pages and blocks
Scenario: Create nested pages
Given Alice is an Editor in "Research"
And she has opened its root page
When she creates a sub-page named "Experiments" inside it
And creates a sub-page named "Trial 1" inside "Experiments"
Then she can open "Experiments" from the root page
And she can open "Trial 1" from "Experiments"
And both sub-pages belong to "Research"
Scenario: Read and update the root page's content
Given Alice is an Editor in "Research"
When she adds a text block to its root page
And opens that page again
Then she sees the text she added
Scenario: Delete a page and its descendants permanently
Given Alice is an Editor in "Research"
And "Experiments" is a sub-page with content and a sub-page named "Trial 1"
When she deletes "Experiments"
Then "Experiments", "Trial 1" and their content are permanently deleted
And "Experiments" no longer appears in its parent page
Scenario: Protect the root page
Given Alice is an Admin of "Research"
When she tries to delete its root page without deleting the workspace
Then Gotion refuses the deletion
And "Research" still has its root page
Scenario: A Viewer can read but cannot edit
Given Bob is a Viewer in "Research"
When he opens a page in that workspace
Then he can read its content
When he tries to change the page's content
Then Gotion refuses the change
And the content stays unchanged
Scenario: Refuse page access by a non-member
Given Bob does not belong to "Research"
When he requests one of its pages directly by its identifier
Then Gotion refuses access
And reveals no page title, metadata or content
- US-05 — Customize page metadata: As an Editor, I want to set a page title, icon, and cover so that pages are easy to recognize and personalize.
Feature: US-05 Customize page metadata
Scenario: Set a page's title, icon and cover
Given Alice is an Editor in "Research"
And "Experiments" is a sub-page in that workspace
When she changes its title to "Lab notebook"
And chooses an icon and a cover image link
Then the page shows that title, icon and cover
And its page block in the parent page shows the same metadata
And its content stays unchanged
Scenario: Remove optional metadata
Given Alice is an Editor in "Research"
And a page has an icon and a cover
When she removes the icon and cover
Then the page has neither an icon nor a cover
And its title and content stay unchanged
- US-06 — Edit Markdown blocks: As an Editor, I want to work with an ordered, nestable list of blocks so that content remains modular and structured.
Feature: US-06 Edit Markdown blocks
Background:
Given Alice is an Editor in "Research"
And she has opened a page in that workspace
Scenario: Insert and update a block
Given the page has no blocks
When Alice inserts a text block containing "First draft"
And changes its text to "Reviewed draft"
Then the page contains one text block with "Reviewed draft"
Scenario: Reorder blocks
Given the page has blocks "Question", "Method" and "Result" in that order
When Alice moves "Result" before "Method"
Then their order is "Question", "Result", "Method"
Scenario: Nest a block
Given the page has blocks "Method" and "Step 1"
When Alice nests "Step 1" under "Method"
Then "Step 1" is a child of "Method"
Scenario: Refuse a cycle in the block tree
Given "Step 1" is nested under "Method"
When Alice tries to nest "Method" under "Step 1"
Then Gotion refuses the move
And the block tree stays unchanged
Scenario: Delete a block and its children
Given "Step 1" and "Step 2" are nested under "Method"
When Alice deletes "Method"
Then "Method", "Step 1" and "Step 2" are removed from the page
- US-07 — Use native Markdown block types: As an Editor, I want to create formatted text, headings, bulleted, numbered, and to-do lists, and code blocks so that I can write rich content with Markdown.
Feature: US-07 Use native Markdown block types
Scenario Outline: Write content with a supported block type
Given Alice is an Editor with a page open
When she creates a <type> block with <content>
And opens the page again
Then the block displays <result>
Examples:
| type | content | result |
| text | **Important** | the word Important in bold |
| heading | level 2 and text Method | Method as a level 2 heading |
| bulleted list | text First item | First item with a bullet |
| numbered list | text First step | First step with a list number |
| to-do list | text Review, unchecked | Review with an empty checkbox |
| code | print("hello") | the literal code text |
Scenario: Check a to-do item
Given Alice is an Editor with a page open
And it contains an unchecked to-do item named "Review"
When she checks "Review"
And opens the page again
Then "Review" is still checked
Scenario: Change a block's type without losing its discussion
Given Alice is an Editor with a page open
And a text block has a comment thread
When she changes that block into a heading
Then it stays in the same position in the page
And its comment thread is still attached to it
Real-time collaboration
- US-08 — Collaborate in real time: As a collaborator, I want to see the avatars of the other connected users and co-edit the same page so that we can work together.
Feature: US-08 Collaborate in real time
Scenario: See who has the page open
Given Alice and Bob belong to "Research"
And Alice has a page open
When Bob opens the same page
Then Alice sees Bob's avatar among the connected collaborators
And Bob sees Alice's avatar
When Bob leaves the page
Then Alice no longer sees him among its connected collaborators
Scenario: Merge concurrent edits
Given Alice and Bob are Editors with the same page open
When they edit the same block at the same time
And Gotion acknowledges both edits
Then both collaborators see the same merged content
And Gotion does not silently discard either acknowledged edit
But an edit to a block that the other one deleted has no effect
And of two changes to the type or a property of that block, only one keeps its effect, the same for both collaborators
And a change to the type or the place of a block that the other one joined has no effect
Scenario Outline: Keep the edits made while blocks are divided or joined
Given Alice and Bob are Editors with the same page open
And the page holds <before>
When Alice <alice>
And at the same time Bob <bob>
And Gotion acknowledges both edits
Then both collaborators see <after>
Examples:
| before | alice | bob | after |
| the block "Hello world" | divides it before "world" | types "!" at its end | the blocks "Hello " and "world!" |
| the blocks "Hello" and "world" | joins "world" to the block before | types "!" at the end of "world" | the block "Helloworld!" |
| the block "one two three" | divides it before "two" | divides it before "three" | the blocks "one ", "two " and "three" |
Scenario: Follow edits as a Viewer
Given Alice is an Editor and Bob is a Viewer in "Research"
And they have the same page open
When Alice changes a block
Then Bob sees the updated content
When Bob tries to edit that block
Then Gotion refuses his edit
Scenario: Close collaboration when a page is deleted
Given Alice and Bob have a sub-page open
And Alice is an Editor in its workspace
When Alice deletes the sub-page
Then both collaborators learn that the page was deleted
And Gotion accepts no further edits to it
Discussion
- US-09 — Discuss content in context: As a collaborator, I want to add comment threads to pages or individual blocks, resolve them, and mention a member of the workspace in a comment so that conversations stay connected to the relevant content. Any member of the workspace can comment and resolve threads, whatever their role, Viewers included.
Feature: US-09 Discuss content in context
Scenario Outline: Open a discussion as a Viewer
Given Bob is a Viewer in "Research"
And he has a page open
When he posts "Can we check this?" on <anchor>
Then a thread opens on <anchor> with his comment
And the page's content stays unchanged
Examples:
| anchor |
| the page |
| a block of that page |
Scenario: Reply and mention another member
Given Alice and Bob belong to "Research"
And a page has an unresolved comment thread
When Alice replies in that thread and mentions Bob
Then the thread contains Alice's reply with a mention of Bob
Scenario: Resolve a thread as a Viewer
Given Bob is a Viewer in "Research"
And a page has an unresolved comment thread
When Bob resolves it
Then the thread is marked as resolved
And Gotion refuses further comments in that thread
Scenario Outline: Remove discussions when their anchor is deleted
Given a comment thread is attached to <anchor>
When an Editor deletes <anchor>
Then Gotion removes that thread and its comments
Examples:
| anchor |
| a sub-page |
| a block |
Notification
- US-10 — Receive in-app notifications: As a user, I want to receive in-app notifications about invitations and mentions so that I can stay informed.
Feature: US-10 Receive in-app notifications
Scenario: Receive a workspace invitation
Given Bob is registered and signed in
And Alice is an Admin of "Research"
And Bob is neither a member nor already invited to that workspace
When Alice invites Bob to "Research"
Then Bob receives an in-app notification about the invitation
Scenario: Receive a mention
Given Alice and Bob belong to "Research"
When Alice mentions Bob in a comment
Then Bob receives an in-app notification about the mention
Scenario: Mention oneself
Given Alice belongs to "Research"
When she mentions herself in a comment
Then Gotion creates no notification for that mention
Scenario: Mark a notification as read
Given Bob has received an unread notification
When he marks it as read
Then it appears as read when he opens his notifications again
Out of scope for now
Stories written before the Event Storming and left out of the current scope, kept here so that the history of the analysis stays traceable.
| Story | Reason |
|---|---|
| Restore deleted pages (trash area, restore, permanent delete) | Deleting a page is permanent: it removes the page content and its sub-pages at once. |
| Review page history (revisions and their authors) | Not needed by the prototype. |
| Reuse synchronized content (synced blocks) | Not needed by the prototype. |
| Apply granular permissions (per-page permissions inherited from the workspace) | Replaced by the workspace roles of US-03. |
| Search the workspace (full-text search) | Planned as a future extension: it can be added as a new service that listens to the events Editing already publishes. |
Quality Attributes
Non-functional requirements, expressed as six-part scenarios (source, stimulus, artifact, environment, response, response measure). Each scenario is testable: the response measure is the acceptance criterion.
The reference deployment for every scenario is a single self-hosted node with 4 vCPU and 8 GB RAM, serving a workspace of 50 members, 10 000 pages and 1 000 000 blocks, unless a scenario states otherwise.
Performance
QA-01 — Editor input latency (constrains US-06, US-07)
| Part | Value |
|---|---|
| Source | User typing in the editor |
| Stimulus | Inserts a character into a block |
| Artifact | Editor client and block persistence path |
| Environment | Normal operation, page containing 500 blocks |
| Response | Character is rendered locally and durably persisted |
| Response measure | Local render ≤ 50 ms (p95); server acknowledgement ≤ 500 ms (p95) |
QA-02 — Real-time propagation latency (constrains US-08)
| Part | Value |
|---|---|
| Source | Remote collaborator |
| Stimulus | Edits a block on a page open in other clients |
| Artifact | Synchronization channel |
| Environment | Normal operation, 5 concurrent editors on the same page |
| Response | Change is applied and rendered in every other connected client |
| Response measure | ≤ 300 ms (p95), ≤ 1 s (p99) from acknowledgement to remote render |
QA-03 — Page open time (constrains US-04)
| Part | Value |
|---|---|
| Source | User |
| Stimulus | Opens a page from the sidebar |
| Artifact | Page loading and rendering path |
| Environment | Cold client cache, page containing 500 blocks |
| Response | Page is rendered and accepts input |
| Response measure | Interactive within 1.5 s (p95) |
Availability
QA-04 — Editing crash without data loss (constrains US-04, US-06, US-08)
| Part | Value |
|---|---|
| Source | Infrastructure fault |
| Stimulus | An instance of the Editing service terminates abnormally while collaborators are editing a page |
| Artifact | Editing service and the store of acknowledged edits |
| Environment | Normal operation, edits in flight |
| Response | The instance is restarted; the clients reconnect and resynchronize the page; every acknowledged edit survives |
| Response measure | Zero loss of acknowledged edits; Editing accepts edits again within 60 s |
Data Consistency
QA-05 — Concurrent edit convergence (constrains US-08)
| Part | Value |
|---|---|
| Source | Multiple collaborators |
| Stimulus | 10 users edit the same block simultaneously, dividing it and joining it to the block before as well |
| Artifact | Synchronization engine |
| Environment | Normal operation, client-server round-trip up to 500 ms |
| Response | All replicas converge to an identical document state; no acknowledged edit is silently discarded: each one keeps its effect, unless a concurrent edit deleted or joined its block, or replaced the same block content, where the update with the greater identity wins (CRDT package) |
| Response measure | 100 % convergence within 2 s of the last edit and 100 % of the acknowledged edits kept, verified by an automated test over 1 000 randomized operation interleavings and by deterministic tests of edits concurrent with dividing and joining blocks |
Security
QA-06 — Unauthorized page access (constrains US-03)
| Part | Value |
|---|---|
| Source | Authenticated user who is not a member of the workspace, or a Viewer of it |
| Stimulus | Requests a page directly by identifier, or submits a change to it, bypassing the UI |
| Artifact | Authorization layer |
| Environment | Normal operation |
| Response | The request is denied |
| Response measure | 100 % of such requests denied; for a non-member, responses for “forbidden” and “non-existent” are indistinguishable, leaking no title or metadata; a member who is removed or made a Viewer is denied within 5 s (p99) of the change in Membership |
QA-07 — Brute-force login (constrains US-01)
| Part | Value |
|---|---|
| Source | Attacker |
| Stimulus | Attempts repeated logins against one account, guessing its password |
| Artifact | Authentication subsystem |
| Environment | Normal operation |
| Response | Repeated failed attempts are throttled |
| Response measure | More than 5 failed attempts per account per 15 minutes triggers rate limiting |
Deployability
QA-08 — Fresh self-hosted installation
| Part | Value |
|---|---|
| Source | System administrator |
| Stimulus | Deploys Gotion on a clean Linux host |
| Artifact | The whole system |
| Environment | No pre-existing dependencies beyond a container runtime |
| Response | A running instance with an initial administrator account |
| Response measure | Reachable within 10 minutes using one documented command; schema migrations run automatically, with no manual database step |
Modifiability
QA-09 — Adding a block type (constrains US-07)
| Part | Value |
|---|---|
| Source | Developer |
| Stimulus | Adds a new block type, for example a table |
| Artifact | Block model, editor, renderer |
| Environment | Development time |
| Response | The type is available end to end: creation, persistence, rendering |
| Response measure | Changes confined to the definition and the rendering of the new type; no change to real-time synchronization or to the persistence schema |
Accessibility
QA-10 — Keyboard-only and assistive-technology editing (constrains US-06, US-07)
| Part | Value |
|---|---|
| Source | User relying on a keyboard or a screen reader |
| Stimulus | Creates, reorders, nests, and deletes blocks without a pointing device |
| Artifact | Editor user interface |
| Environment | Normal operation, screen reader active |
| Response | Every block operation is reachable and announced |
| Response measure | 100 % of block operations keyboard-accessible; editor and navigation conform to WCAG 2.1 level AA |
Out of scope for now
| Scenario | Reason |
|---|---|
| Search response time | Search left the scope together with the search story. |
| Editing during network interruption (offline editing, reconciled on reconnect) | Not covered: editing a page requires a connection to the server. |
Event Storming
The domain was explored with an Event Storming session, in ten steps, after Alberto Brandolini and chapter 12 of Khononov. The process is iterative: the model is enriched one step at a time, and every step is shown below.
The board is on Miro: Gotion Event Storming. Each section below links to the frame holding the wall at that step.
The colour of a sticky is its meaning, not decoration. The legend is kept on the board.
The grammar reads read model → actor + command → aggregate → domain event for a human-driven slice, and domain event → policy → command → aggregate → domain event for an automated one. By the end of step 8 every command must be executed by an actor, triggered by a policy, or called by an external system. Actor and aggregate are both yellow and are told apart by size: the actor is the small sticky on its command, the aggregate the large one. Pain points are pink diamonds, and pivotal events are vertical bars rather than stickies.
Steps
1. Unstructured Exploration
Each team member wrote the domain events that can happen in the system on orange stickies, in the past tense, and put them on the board without any order and without worrying about duplicates.
2. Timeline
The domain events were organised in the order in which they occur in the business domain, starting from the happy path and branching out from there.
3. Pain Points
We went back over the timeline to spot the points that need attention: bottlenecks, manual steps, missing domain knowledge. They are pink diamonds placed on the event they concern, so that a debate never stalls the session.
4. Pivotal Points
The events where the context or the phase changes are marked with a vertical bar dividing the events before and after. They are the first indicator of bounded context boundaries.
Each pivotal event opens one of the subdomains found from the requirements, which the board thus confirms: User Registered (Identity), Workspace Created (Workspace organisation), Member Invited (Membership and roles), Page Created and Block Inserted (Page content), Session Joined (Real-time collaboration), Comment Posted (Discussion), Notification Raised (Notification).
5. Commands
The command that triggers each event or flow of events: light blue, written in the imperative, and placed before the event it produces. Where a person in a role issues it, a small yellow actor sits on the command.
6. Policies
The commands left without an actor are executed by an automation policy: an event triggers the command. Purple, worded when X then Y, between the event and the command it fires.
7. Read Models
The view over the data that an actor reads before deciding to execute a command: a screen, a report, a notification. Green, placed before the command.
8. External Systems
Pink: anything that is not part of the domain being explored, and that either issues a command in or is notified of an event out through a policy. No external system is in scope for Gotion. This step is also the completeness check of the method: by the end of it every command is executed by an actor or triggered by a policy.
9. Aggregates
Commands and events were regrouped into transactional consistency boundaries. Each aggregate is a large yellow sticky that receives commands on its left and produces events on its right. Eight emerged: User, Workspace, Workspace Membership, Page, Page Block Tree, Real-time Editing Session, Notification, Comment Thread.
10. Bounded Contexts
Finally the aggregates that belong together functionally were grouped, and a boundary was drawn around each group. Those groups are the candidate bounded contexts, and the candidate microservices.
The identified bounded contexts are:
Account: who the user is, and the workspaces they work in (User,Workspace).Membership: who belongs to each workspace and with which role (Workspace Membership).Editing: the pages, their content and the real-time editing of a page (Page,Page Block Tree,Real-time Editing Session).Notification: what reaches the user (Notification).Discussion: the conversation attached to the content (Comment Thread).
They are candidates: the design weighs them against the subdomains and settles the bounded contexts in Strategic Design.
Open pain points
The pain points still open at the end of the session, each traced to the user story or quality attribute scenario it puts at risk. The architectural ones are settled in an Architecture Decision Record, the others in the domain model; the last column says where each one was settled. The session also fed back into the requirements: the answers to PP-02 and PP-03 refined US-03, and the domain model implements them.
| Pain point | Context | Traces to | Settled in |
|---|---|---|---|
| PP-01 — Where concurrent edits are ordered and merged: a central sequencer in the Editing service, or replicas that merge on their own | Editing | US-08, QA-01, QA-02, QA-05 | ADR-01 (accepted): replicas merge on their own, with a CRDT of ours, and Editing checks, stores and relays the operations |
| PP-02 — Whether an invitation expires, and what happens when it is refused | Membership | US-03 | US-03: an invitation does not expire, and the invitee can decline it; modelled in Workspace Membership |
| PP-03 — How a member leaves a workspace, given that the last Admin cannot | Membership | US-03 | US-03: any member can leave, except the last Admin; modelled in Workspace Membership as Leave workspace |
| PP-04 — How Account, Editing and Discussion enforce what Membership holds, the roles for Account and Editing and the membership itself for Discussion: no policy on the board carries them out of Membership | Membership, Account, Editing, Discussion | US-02, US-03, QA-01, QA-06 | What they receive: Context Map; how it reaches them: ADR-03 (proposed): Editing keeps a local copy fed by the events, Account and Discussion ask Membership. Notification checks no role, so it is not part of it |
| PP-05 — What happens to the comment threads of a deleted page, block or workspace, and to the Workspace Membership of a deleted workspace: no policy removes them | Discussion, Membership | US-02, US-04, US-09 | Rules across aggregates: deletion policies |
Ubiquitous language
Each word below has exactly one meaning, in this report, in the code, and in the API: a block is a Block in the source, never a Node or an Item.
This glossary records the ubiquitous language of Gotion. Following DDD, the language is split by bounded context: a term is precise only inside the context where it is defined, and the same person or thing can take a different name in each context. The terms come from the Event Storming board, where the sticky wording is the language, and from the user stories.
Account
| Term | Definition | Not to be confused with |
|---|---|---|
| User | A person registered in Gotion with an email address and a password (US-01). The identity that signs in. | Member, which is a user seen inside one workspace. |
| Workspace | A separate space that contains pages, used to keep different projects or teams apart (US-02). A user’s first workspace is created when the user registers. | Workspace Membership, which holds who belongs to the workspace. |
| Main workspace | The workspace Gotion opens at login: the last one the user opened. It is cleared when the user loses access to it, and while it is unset, login opens the first workspace of the directory. A user with no workspaces has none and sees an empty directory (US-02, US-03). | Active workspace, which belongs to the current client session. |
| Active workspace | The workspace the user is currently working in. Opening another one changes it and saves that one as the main workspace. | Main workspace, which is saved across sessions. |
Membership
| Term | Definition | Not to be confused with |
|---|---|---|
| Workspace Membership | The set of members of one workspace, each with a role. A workspace always keeps at least one Admin, so the last Admin cannot leave it. | Workspace, which lives in the Account context. |
| Member | A user who belongs to a workspace. Every member has exactly one role: Admin, Editor or Viewer. | User, the identity in the Account context. |
| Role | What a member may do in the workspace: Admin, Editor or Viewer (US-03). | — |
| Admin | The role that can do everything an Editor can, and also invite members, remove them and change their role (US-03). The creator of a workspace becomes its first Admin. | — |
| Editor | The role that can create, change and delete the pages and blocks of the workspace. | — |
| Viewer | The role that can read the pages of the workspace and take part in their discussions, but cannot change their content. | — |
| Invitation | The request an Admin sends to a person to join a workspace. Accepting it turns the invitee into a member; declining it ends it. It does not expire. | Notification, which only delivers the invitation. |
| Invitee | The person an invitation is addressed to, until they accept or decline it. | Member. |
Editing
| Term | Definition | Not to be confused with |
|---|---|---|
| Page | A document of a workspace, with its metadata and its place in the page tree (US-04). A page is either the root page or a sub-page, which is also a block of its parent page. | Page Block Tree, the content of the page. |
| Root page | The only page of a workspace that has no parent, created together with the workspace. It holds content like any other page, and it is where new pages start: every other page is created inside it or inside one of its sub-pages, so every page of the workspace descends from it. A workspace has exactly one root page: no other can be created, and it is deleted only together with its workspace. | Workspace, which contains pages. |
| Sub-page | Any page other than the root page: a page whose page block lives inside another page, its parent. | — |
| Page tree | The hierarchy of the pages of a workspace, rooted at the root page and given by the parent of each page. | Page Block Tree. |
| Page metadata | The title, icon and cover of a page (US-05). | Page content. |
| Block | The unit of content of a page: formatted text, heading, bulleted, numbered or to-do list, code (US-06, US-07). Blocks are ordered and can be nested. The type of a block comes from its block content. | — |
| Block content | What a block holds besides its text, in the shape its type needs: a level for a heading, a checkbox for a to-do, the language for a code block, only the sub-page for a page block, nothing more for formatted text and list items. Replacing the block content turns the block into another type, and the block stays the same block. | Page Block Tree, the content of the whole page; the text of the block, which is in the sequence. |
| Sequence | The characters of all the text of a page, in order, with a marker for each block. A character belongs to the block of the nearest marker before it, and Editing writes the text of each block out as Markdown (BR-03). | Page Block Tree, which says where each block is. |
| Marker | The element of the sequence that stands for a block and owns the characters after it. Moving a block never moves its marker; deleting a block keeps it; joining a block removes it. | Block, whose place is given by the tree. |
| Position key | What orders the siblings of a block, or of the page: a fractional index set by each insertion and move. Siblings with the same key follow the order of their markers. | Marker. |
| Divide a block | Split a block in two at a character (Enter): the marker of a new block goes after that character, and the characters after it belong to the new block. | A line break (Shift+Enter), which is a character inside the block. |
| Join a block | Merge a block into the one before it (Backspace at its start): its marker is removed, and its characters belong to the block of the marker before. | Delete block, which deletes the characters and keeps the marker. |
| Replica | The copy of a page that one open tab holds, or that Editing holds. Editing numbers each replica of a client when it joins the session. | Collaborator, who may have several replicas open. |
| Session log | The operations Editing accepted for a page, in order, each with its sequence number; Editing acknowledges an operation once it is in the log (ADR-02). | A snapshot, a state of the page built from the log. |
| Page block | The block that stands for a sub-page. Inserting, moving or deleting it creates, moves or deletes that sub-page. It holds nothing but its sub-page, so it is never updated: the metadata is set on the page itself. A page block never turns into another type, and no other block turns into one. | Page, which the page block points to. |
| Page Block Tree | The ordered, nestable tree of the blocks of one page: the page content. There is one per page, and it is deleted as a whole when its page is deleted. | Page tree, which is made of pages. |
| Real-time Editing Session | The shared editing of one page by the collaborators who have it open (US-08). Each replica merges their edits on its own, and Editing checks each one and applies it to the Page Block Tree. The session is closed when its page is deleted. | Workspace: a session belongs to a single page. |
| Collaborator | A user who has joined the editing session of a page, or who takes part in a discussion. | Member, which is about belonging to the workspace. |
| Presence | The collaborators currently in the editing session of a page (US-08). | — |
| Edit | A change to the content of a page submitted by a collaborator during a session: an operation of the CRDT that every replica runs. | Block: an edit is applied to blocks. |
| Merge | The combination of concurrent edits into one consistent result, done by every replica on its own with the CRDT. | — |
Notification
| Term | Definition | Not to be confused with |
|---|---|---|
| Notification | A message that informs a user of something relevant to them, such as an invitation or a mention, shown in-app (US-10). It is raised, delivered on a best-effort basis, and marked as read by the user. | Comment. |
| Recipient | The user a notification is addressed to. | — |
Discussion
| Term | Definition | Not to be confused with |
|---|---|---|
| Comment Thread | A conversation attached to a page or to a single block (US-09). It can be resolved when the discussion is over. | Notification. |
| Anchor | Where a comment thread is attached: the whole page (page anchor) or one block of it (block anchor). It is set when the thread opens and never changes. | Mention, which points at a member, not at content. |
| Comment | A message posted in a comment thread by any member of the workspace. Posting it does not change the content of the page. | Edit, which changes the content. |
| Mention | A reference to a member of the workspace written in a comment (US-09). It makes that member receive a notification. | — |
One person, many names
The same person takes a different name in each context, and each name carries only what that context needs.
| Context | Name | What the context knows about them |
|---|---|---|
| Account | User | Email address, credentials, workspaces |
| Membership | Member (Admin, Editor or Viewer), Invitee | Role in one workspace |
| Editing | Collaborator | Presence in the editing session of one page |
| Notification | Recipient | Where and how to reach them |
| Discussion | Collaborator, mentioned user | The comments they write and the mentions they receive |