Routing
Honeycomb uses SvelteKit’s file-based routing system. Every folder inside src/routes/ maps directly to a URL path, and special files like +page.svelte, +layout.svelte, and +page.server.ts control what renders and what data loads.
Route groups
Section titled “Route groups”SvelteKit route groups (folders wrapped in parentheses) share a layout without affecting the URL path. Honeycomb organizes routes into five groups:
| Group | Folder | Purpose |
|---|---|---|
| App | (app)/ | All authenticated application pages — feed, settings, business, admin, etc. |
| Auth | (auth)/ | Sign-in, sign-up, forgot/reset password, email verification. |
| Marketing | (marketing)/ | The public landing page at /. |
| Onboarding | (onboarding)/ | Post-signup onboarding flow at /onboarding. |
| Site Builder | (sitebuilder)/ | The drag-and-drop site builder editor and published sites. |
Additionally, top-level routes outside groups handle API endpoints (/api/) and short-link redirects (/l/[slug]).
Layout hierarchy
Section titled “Layout hierarchy”Layouts nest from the root downward. A child layout inherits its parent and can add its own chrome (navigation, sidebars, etc.).
+layout.svelte ← Root: Supabase session provider├── (app)/+layout.svelte ← App shell: sidebar, top nav, notification badge│ ├── admin/+layout.svelte ← Admin sidebar│ ├── settings/+layout.svelte ← Settings sidebar│ └── honeycomb/+layout.server.ts ← Honeycomb community data├── (auth)/+layout.svelte ← Centered auth card layout├── (onboarding)/+layout.svelte ← Onboarding wizard layout└── (sitebuilder)/+layout.svelte ← Full-screen editor layoutRoot layout (+layout.server.ts)
Section titled “Root layout (+layout.server.ts)”The root server layout calls safeGetSession() and returns session, user, and cookies to every page. This data is available via $page.data or export let data in any +page.svelte.
App layout ((app)/+layout.server.ts)
Section titled “App layout ((app)/+layout.server.ts)”Fetches the authenticated user’s profile, unread notification count, and installed business apps for the sidebar. All (app) pages receive profile, unreadNotifications, and installedApps in their load data.
Route guard logic
Section titled “Route guard logic”The guard system runs as SvelteKit middleware via sequence(supabase, guard) in hooks.server.ts. It executes two handles in order:
1. Supabase handle
Section titled “1. Supabase handle”Creates the Supabase server client on event.locals.supabase and exposes event.locals.safeGetSession() for downstream use.
2. Guard handle
Section titled “2. Guard handle”Checks every request against the route protection rules defined in $lib/server/guards.ts:
Request arrives│├─ PUBLIC_ROUTES match? → Allow through (no auth check)│ Examples: /auth/callback, /auth/confirm, /api/stripe/webhook│├─ No session?│ ├─ isProtectedRoute()? → Redirect to /sign-in│ └─ Otherwise → Allow through (landing page, auth pages)│└─ Has session? ├─ PUBLIC_AUTH_ROUTES match? → Redirect to /feed │ Examples: /sign-in, /sign-up, /forgot-password, /reset-password │ ├─ isLandingPage()? → Redirect to /feed │ ├─ isAdminRoute()? │ └─ profile.role !== "admin"? → Redirect to /feed │ └─ requiresOnboarding()? └─ No onboard record? → Redirect to /onboardingProtection categories
Section titled “Protection categories”Fully public — no auth check, no redirect:
| Route | Purpose |
|---|---|
/auth/callback | Supabase OAuth callback |
/auth/confirm | Email confirmation handler |
/auth/error | Auth error display |
/auth/forgot-password | Server-side password reset action |
/auth/reset-password | Server-side password reset action |
/auth/resend-verification | Resend email verification |
/verify-email | Email verification page |
/api/stripe/webhook | Stripe webhook endpoint |
Auth pages — unauthenticated only (authenticated users redirect to /feed):
| Route | Purpose |
|---|---|
/sign-in | Login form |
/sign-up | Registration form |
/forgot-password | Request password reset |
/reset-password | Set new password |
Protected — authenticated + onboarding complete:
| Route prefix | Purpose |
|---|---|
/feed | Social feed |
/post/[id] | Single post view |
/explore | Discover content |
/bookmarks | Saved posts |
/drafts | Unpublished drafts |
/profile | User profiles |
/messages | Direct messages |
/notifications | Activity notifications |
/settings | User settings |
/wallet | Wallet and transactions |
/marketplace | Product marketplace |
/jobs | Job listings |
/business | Business dashboard and apps |
/store/[id] | Storefront view |
/onboarding | Onboarding flow (exempt from onboarding check itself) |
Admin — authenticated + role === "admin":
| Route prefix | Purpose |
|---|---|
/admin | Admin dashboard |
/admin/users | User management |
/admin/posts | Post moderation |
/admin/products | Product moderation |
/admin/jobs | Job moderation |
/admin/ads | Ad management |
/admin/categories | Category management |
/admin/blacklist | Blacklisted terms |
/admin/reports | Report review |
Complete route map
Section titled “Complete route map”Below is every major route in the application grouped by section.
Social / Feed
Section titled “Social / Feed”| Route | File path | Description |
|---|---|---|
/feed | (app)/feed/ | Main social feed |
/explore | (app)/explore/ | Discover content and users |
/post/[id] | (app)/post/[id]/ | View a single post |
/bookmarks | (app)/bookmarks/ | Bookmarked posts |
/drafts | (app)/drafts/ | Draft posts |
/stories | (app)/stories/ | Stories feed |
/stories/[userId] | (app)/stories/[userId]/ | User’s stories |
/notifications | (app)/notifications/ | Activity notifications |
Honeycomb (Community Hub)
Section titled “Honeycomb (Community Hub)”| Route | File path |
|---|---|
/honeycomb | (app)/honeycomb/ |
/honeycomb/rooms | (app)/honeycomb/rooms/ |
/honeycomb/rooms/create | (app)/honeycomb/rooms/create/ |
/honeycomb/rooms/[slug] | (app)/honeycomb/rooms/[slug]/ |
/honeycomb/rooms/[slug]/members | (app)/honeycomb/rooms/[slug]/members/ |
/honeycomb/rooms/[slug]/settings | (app)/honeycomb/rooms/[slug]/settings/ |
/honeycomb/messages | (app)/honeycomb/messages/ |
/honeycomb/messages/[conversationId] | (app)/honeycomb/messages/[conversationId]/ |
/honeycomb/calls | (app)/honeycomb/calls/ |
/honeycomb/calls/[callId] | (app)/honeycomb/calls/[callId]/ |
/honeycomb/broadcast | (app)/honeycomb/broadcast/ |
/honeycomb/polls | (app)/honeycomb/polls/ |
/honeycomb/games | (app)/honeycomb/games/ |
/honeycomb/badges | (app)/honeycomb/badges/ |
/honeycomb/stickers | (app)/honeycomb/stickers/ |
/honeycomb/ads | (app)/honeycomb/ads/ |
/honeycomb/memberships | (app)/honeycomb/memberships/ |
/honeycomb/moderation | (app)/honeycomb/moderation/ |
/honeycomb/moderation/bans | (app)/honeycomb/moderation/bans/ |
/honeycomb/moderation/filters | (app)/honeycomb/moderation/filters/ |
/honeycomb/settings | (app)/honeycomb/settings/ |
Messages, Forums, Learning
Section titled “Messages, Forums, Learning”| Route | File path |
|---|---|
/messages | (app)/messages/ |
/messages/[chatId] | (app)/messages/[chatId]/ |
/forums | (app)/forums/ |
/forums/[forumSlug] | (app)/forums/[forumSlug]/ |
/forums/[forumSlug]/[topicSlug] | (app)/forums/[forumSlug]/[topicSlug]/ |
/forums/[forumSlug]/new | (app)/forums/[forumSlug]/new/ |
/learn/[slug] | (app)/learn/[slug]/ |
/learn/[slug]/[itemId] | (app)/learn/[slug]/[itemId]/ |
/learn/[slug]/quiz/[quizId] | (app)/learn/[slug]/quiz/[quizId]/ |
/learn/[slug]/assignment/[assignmentId] | (app)/learn/[slug]/assignment/[assignmentId]/ |
Business
Section titled “Business”| Route | File path |
|---|---|
/business | (app)/business/ |
/business/ads/new | (app)/business/ads/new/ |
/business/products | (app)/business/products/ |
/business/products/new | (app)/business/products/new/ |
/business/products/[id] | (app)/business/products/[id]/ |
/business/products/[id]/edit | (app)/business/products/[id]/edit/ |
/business/jobs | (app)/business/jobs/ |
/business/jobs/new | (app)/business/jobs/new/ |
/business/store | (app)/business/store/ |
/business/upgrade | (app)/business/upgrade/ |
/business/apps | (app)/business/apps/ |
/business/apps/* | 25+ installable business apps (see Business pages) |
Marketplace
Section titled “Marketplace”| Route | File path |
|---|---|
/marketplace | (app)/marketplace/ |
/marketplace/product/[id] | (app)/marketplace/product/[id]/ |
/jobs | (app)/jobs/ |
/jobs/[id] | (app)/jobs/[id]/ |
/store/[id] | (app)/store/[id]/ |
Settings
Section titled “Settings”| Route | File path |
|---|---|
/settings | (app)/settings/ |
/settings/profile | (app)/settings/profile/ |
/settings/account | (app)/settings/account/ |
/settings/security | (app)/settings/security/ |
/settings/privacy | (app)/settings/privacy/ |
/settings/notifications | (app)/settings/notifications/ |
/settings/social | (app)/settings/social/ |
Profile
Section titled “Profile”| Route | File path |
|---|---|
/profile | (app)/profile/ (redirects to own profile) |
/profile/[username] | (app)/profile/[username]/ |
/profile/[username]/blog | (app)/profile/[username]/blog/ |
/profile/[username]/blog/[slug] | (app)/profile/[username]/blog/[slug]/ |
/profile/[username]/store | (app)/profile/[username]/store/ |
/profile/[username]/store/[slug] | (app)/profile/[username]/store/[slug]/ |
/profile/[username]/plans | (app)/profile/[username]/plans/ |
/profile/[username]/plans/[slug] | (app)/profile/[username]/plans/[slug]/ |
/profile/[username]/followers | (app)/profile/[username]/followers/ |
/profile/[username]/following | (app)/profile/[username]/following/ |
/profile/[username]/links | (app)/profile/[username]/links/ |
/profile/[username]/book | (app)/profile/[username]/book/ |
Wallet
Section titled “Wallet”| Route | File path |
|---|---|
/wallet | (app)/wallet/ |
/affiliates | (app)/affiliates/ |
/affiliates/referrals | (app)/affiliates/referrals/ |
| Route | File path | Description |
|---|---|---|
/verify/[code] | (app)/verify/[code]/ | Verification code handler |
/sign/[id] | (app)/sign/[id]/ | E-signature signing page |
/document/[code] | (app)/document/[code]/ | Shared document viewer |
/file-request/[id] | (app)/file-request/[id]/ | File request submission |
/bundles/[slug] | (app)/bundles/[slug]/ | Product bundle view |
/certificates | (app)/certificates/ | Certificate viewer |
/courses | (app)/courses/ | Browse courses |
/courses/[slug] | (app)/courses/[slug]/ | Course detail |
/events | (app)/events/ | Browse events |
/events/[slug] | (app)/events/[slug]/ | Event detail |
/support | (app)/support/ | Support tickets |
/support/new | (app)/support/new/ | Create support ticket |
/support/[ticketId] | (app)/support/[ticketId]/ | View ticket |
/dashboard | (app)/dashboard/ | Dashboard |
/sign-out | (app)/sign-out/ | Session logout |
/l/[slug] | l/[slug]/ | Short-link redirect |
How to add a new route
Section titled “How to add a new route”1. Create the route folder
Section titled “1. Create the route folder”Add a new folder under the correct route group. For a protected page, put it inside (app)/:
src/routes/(app)/my-new-page/ +page.svelte ← The page component +page.server.ts ← Server load function (optional)2. Register protection (if needed)
Section titled “2. Register protection (if needed)”If the route prefix is not already covered by isProtectedRoute() in $lib/server/guards.ts, add a new if statement:
if (path.startsWith("/my-new-page")) return true;3. Add a layout (optional)
Section titled “3. Add a layout (optional)”If the page needs its own sidebar or sub-navigation, add +layout.svelte in the route folder. It will nest inside the (app) layout automatically.
4. Access shared data
Section titled “4. Access shared data”Your page can access the app layout data (profile, installed apps, etc.) through the standard SvelteKit load chain:
<script lang="ts"> export let data; // data.profile, data.user, data.installedApps are available</script>