Renders the whole app, its providers around its routes. main.tsx mounts it. Its paths follow one rule (shared/paths.ts): @name is a user, any other word under the root a category or an app page, a view of a page one more segment, and a default view the bare path, with no redirect.

  • / is the feed of every dump on the viewer's default tab, and /hot, /new, /journal and /follow its tabs (Index), /follow/playlists the dumps of the playlists followed. /?share_url= opens the create form on a shared link.
  • /search and /search/:searchTab are the search results (Search).
  • /register and /login sign up and sign in (UserRegister, UserLogin), signed out only, /login?next= coming back to a page.
  • /authorize lets another gerbeur instance sign the user in with their account here (Authorize), and /federation/callback finishes a sign-in here with an account on another (FederationCallback).
  • /reset-password asks for a reset link by email, and sets a new password from it, ?token= (ResetPassword), and /unsubscribe turns off a digest from its emailed link (Unsubscribe).
  • /notifications (Notifications) and /settings (Settings), signed in only, and /manage, the site's tools, for category:manage or federation:manage (Manage).
  • /community and /community/monthly, the site's week and month (Community), signed in only.
  • /playlists is every public playlist, and /playlists/:categorySlug a playlist category's, in the order ?sort= names, or with ?mine=1 the signed-in user's own (Playlists).
  • /@:username/* is a user's (UserRoutes): their profile and its tabs, their dumps at dumps/:slug (Dump) and dumps/:slug/edit (DumpEdit, signed in only), and their playlists at playlists/:slug (PlaylistDetail), with its editor open at playlists/:slug/edit.
  • /:categorySlug and /:categorySlug/:feedTab are a dump category's feed (Index), with its /follow/playlists too.
  • Any other path is NotFound.

The pages not marked are open to anyone. Every page is loaded with its route. Since category slugs share the root with the app's pages and the feed tabs, the server reserves those words as slugs; no slug has an @.

Functions

f
App(): React.JSX.Element

Renders the app. The theme, player, socket, follow and chat providers read the session, and ChatProvider reads the URL, so it sits inside the router. GlobalPlayer sits outside the routes, so playback survives navigation.

f
AppRoutes(): React.JSX.Element

Renders the route table, and the floating buttons over every page. Exported for the tests, which reach a page through it as a visit does.