Next App Routing
Note that this article does not address the proxy-based routing that the Marketing Site implements, nor the routes for the Docs site or Visa service. This article specifically describes file-based routing in the Next app, which is mirrored in the Expo app.
/ (root)
Reroute to /dashboard
Note that the root route will be proxied by the marketing site to the Next app
only if the browser as an x-pivot-existing-user cookie. If it does not, it
will be routed to the marketing site. However, the Next app doesn't actually
need to know about this logic.
/dashboard
/dashboard/upcoming
/dashboard/spaces
dashboard/explore
dashboard/assigned
/inbox
Users and Organizations
/admin/[orgId]
Organization admin page.
/@[username]
Assume it is a user — try to find a user with that urlUsername and load their
profile. If not a user, see if it is a organization and load that org's profile.
/rooms
Should default to most recently accessed room if no room id is passed in route.
(meaning that if a user navigates to /rooms, that should actually be rewritten
client side to /rooms/[roomId] where roomId is the most recently accessed
room by the user.
/rooms/[roomId]
Displays a room in the context of the Rooms screen. Rooms can also be displayed without routing using the mini rooms sidebar and, for space rooms, in the context of a space as a full screen block.
/rooms/[roomId]?m=[messageId]
Scroll to a specific message in a room.
/rooms/join/[roomId]?s=[joinSecret]
Allows creating a room membership based on knowledge of a secret rather than being invited. The secret could be invalid by the time the link is used if a room host changed it.
/space or /block
Reroute to /dashboard if no blockId or spaceId is included in the path.
/s/[spaceId]
💡 Space and block URLs include the first 50 char of the space or block title. Data fetching code uses the UUID and just ignores this info.
Space URL example: https://pivot.app/s/student-handbook-pfh0haxfpzowht3oi213cqos (opens in a new tab)
Space URL example (scroll to specific block): https://pivot.app/s/student-handbook-pfh0haxfpzowht3oi213cqos#tz4a98xxat96iws9zmbrgj3a (opens in a new tab)
Block URL example: https://pivot.app/b/welcome-to-meridian-tz4a98xxat96iws9zmbrgj3a (opens in a new tab)
Block URL example, scroll to specific block: https://pivot.app/b/welcome-to-meridian-tz4a98xxat96iws9zmbrgj3a#pfh0haxfpzowht3oi213cqos (opens in a new tab)
Public block URL example: https://1239423.pivot.site/b/welcome-to-meridian-tz4a98xxat96iws9zmbrgj3a (opens in a new tab)
Iff the route is /block, the client app knows that the id provided is for a block and therefore it also knows that said block is not a top level block. If the route is space, the client app knows that the id provided is for a space.
If the route includes an anchor tag, then the client app knows that once it loads the space or block in the URL route, it should scroll to a block on the page that matches the anchor value. This would be a child block of the route block, or a child of n children of the route block.
/s/[spaceID]#[blockID]
Load the top-page of the space, and scroll to the anchor block.
/s/[spaceID]/members
/s/[spaceID]/analytics
/s/[spaceID]/analytics/engagement
/s/[spaceID]/analytics/blocks
/s/[spaceID]/analytics/progress
/s/[spaceID]/analytics/attendance
/s/[spaceID]/workflows
/b/[blockID]
Go to the path blockId. If the block is not full screen-able (for example a text block) then the client should adapt and redirect to the nearest renderable parent.
/b/[blockID]#[blockID]
Go to the path blockid and scroll to the anchor block id.
/b/[blockID]?m=[messageId]
Go to the path blockid and scroll to the anchor message id, which is presumably related to the path block or some other block that will be rendered.
/@username/s/* and /@username/b/*
If an organization enabled the OrganizationPolicy "Include username in space
URLs", the URL of all of the /s/ and /b/ routes in that organizations space
is prefixed with the username of the organization. However, this is almost
entirely ignored for the purposes of routing; it is the UUID that determines
which Space or Block to load. However, the frontend does need to know how to
generate these URLs, does need to have logic to do so, and does need to strip or
correct the value if a user loads the app with @wrongusername/s/validBlockId
(that is, a loadable block id where the provided username is for the wrong
organization or the organization has not disabled the OrganizationPolicy).
/search?q=[query]
Search results page. If the user has customized sorting and filtering, that can
be pushed to the URL parameters as well: &s=[sort]&f=[filter]
/view/[customWebViewId]
Presumably, the user is part of a Facebox group that has this custom web view configured. If not, fallback to dashboard and show an error toast.
If failed in any way, just say: ‘We couldn’t seem to load that page. Ask your organization’s Pivot admin to check the settings for this group. Back to Dashboard →’
Authentication
/login
The login route handles the initial login screen as well as subsequent screens in the login flow such as errors and the 'check your email for a link' screen. These subsequent screens don't have their own route, as there is no intention of sharing links or refreshing to return to a partially complete login flow.
/join and welcome
The initial sign up screen and subsequent subsequent screens in that flow are
all located at /join, however once the user reaches the point of being logged
in and filling in their profile information, /welcome becomes the active
route.
/onboarding
New organization flow
/invite
This route is used to host the invite acceptanc screen.
Handling inbox and room sidebars
We do not change the url when a user opens the inbox or the rooms slide-over sidebars, as those do not need to persist. If a user copy and pastes a link to a given block, they probably do not intend to also copy the room that they were looking at on top of that block.
Modals
Modals like the user profile and user settings are not included in routes, as copy and pasting such links could cause more confusion than value.
Sometimes a modal is included in a route using a url parameter like
https://pivot.app/s/nc6bzmkmd014706rfda898to?om=settings. In this space
example, om stands for 'open modal' and could have the value settings,
edit, deleted, share, grading-settings, etc.