> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bbrands.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Navigation map

> Every route of the customer portal, how each one is reached, what controls access and how the screen is laid out.

This page is the blueprint of the portal: the parts of the screen, the routes that exist, which ones need a
session and what decides whether the customer can open each one.

![Navigation map: three entry points (sign in, invitation e-mail and contract e-mail), the access checks, the onboarding wizard and the digital contract, leading to the portal shell with the Home, My service, Payments, Rewards and My account groups. Each section is marked available, preview or coming soon.](https://mintcdn.com/bbrands/w6DX1nTsRjzB7VQp/images/portal-customer-manual/portal-navigation-map.svg?fit=max\&auto=format\&n=w6DX1nTsRjzB7VQp\&q=85\&s=25038c8da58c5915bc77c3457a3f8b5e)

Navigation map of the customer portal

## The screen layout

Every private section is shown inside the same structure (the portal *shell*):

> [tab] Desktop
>
> ![Portal on desktop with the sidebar on the left, the top bar with Act as, language, theme and user menu, and the Account section in the middle. Seven numbered areas.](https://mintcdn.com/bbrands/Gtthq4FwpUS-9kET/images/portal-customer-screens/shell/layout.en.desktop.webp?fit=max\&auto=format\&n=Gtthq4FwpUS-9kET\&q=85\&s=82fa529bf32b632f0753d44875e12bf1)
>
> Screen layout on desktop, with the Account section open

> [tab] Mobile
>
> ![Portal on mobile: the sidebar is hidden and the top bar shows the menu button, the Act as icon, the language flag, the theme button and the avatar.](https://mintcdn.com/bbrands/RmQmo8S4AibSINhm/images/portal-customer-screens/shell/layout.en.mobile.webp?fit=max\&auto=format\&n=RmQmo8S4AibSINhm\&q=85\&s=acf8171741e9eee632a5c9531d861724)
>
> The same screen on mobile
>
> ![Sidebar opened on mobile with the My service, Payments, Rewards and My account groups.](https://mintcdn.com/bbrands/RmQmo8S4AibSINhm/images/portal-customer-screens/shell/mobile-menu.en.mobile.webp?fit=max\&auto=format\&n=RmQmo8S4AibSINhm\&q=85\&s=ae486d4a676756882a8c23263f0721f5)
>
> Menu open on mobile

| # | Area | What it holds |
| - | - | - |
| 1 | **Sidebar** | The groups **My service**, **Payments**, **Rewards** and **My account**, plus **Home** at the top without a title. Only switched-on sections are shown |
| 2 | **Act as** | Switches between **My personal account** and each company the person belongs to. Hidden when the person belongs to no company |
| 3 | **Language** | Changes the portal language (Spanish, English, French, Italian, Portuguese) |
| 4 | **Theme** | **Light**, **Dark** or **System** |
| 5 | **User menu** | **My account** (goes to Account), **Help center** and **Send feedback** (both marked **Coming soon**) and **Sign out** |
| 6 | **Version** | At the foot of the sidebar, the portal version (useful when reporting a problem) |
| 7 | **Content** | The open section |

On mobile the sidebar is hidden and opens with the **Open navigation menu** button. To fit the bar, **Act as** shows only the person or building icon, and the theme is a single button with the current theme's icon that opens **Light**, **Dark** and **System**.

## Every route

Addresses always start with the language: `/es/home`, `/en/home`, and so on. The root address `/` leads to
`/es/home`.

### Private routes (need a session)

| Route | Section | Menu group | Feature flag |
| - | - | - | - |
| `/{locale}/home` | Home | — | `portal-customer-home` |
| `/{locale}/products` | My products | My service | `portal-customer-products` |
| `/{locale}/scheduling` | Schedule maintenance | My service | `portal-customer-scheduling` |
| `/{locale}/documents` | Documents | My service | `portal-customer-documents` |
| `/{locale}/subscriptions` | Subscriptions | Payments | `portal-customer-subscriptions` |
| `/{locale}/payment-methods` | Payment methods | Payments | `portal-customer-payment-methods` |
| `/{locale}/history` | History | Payments | `portal-customer-history` |
| `/{locale}/benefits` | Benefits (Club catalog) | Rewards | `portal-customer-benefits` |
| `/{locale}/benefits/{id}` | Benefit detail | Rewards | `portal-customer-benefits` |
| `/{locale}/coupons` | Coupons (My coupons) | Rewards | `portal-customer-coupons` |
| `/{locale}/invite` | Invite a friend | Rewards | `portal-customer-invite` |
| `/{locale}/account` | Account | My account | `portal-customer-account` |
| `/{locale}/support` | Support | My account | `portal-customer-support` |
| `/{locale}/onboarding` | Activation wizard (onboarding) | Outside the menu | `portal-customer-onboarding` |

### Public routes (open without a session)

| Route | Purpose |
| - | - |
| `/{locale}/contract/{id}` | Digital contract, from the e-mail link |
| `/{locale}/onboarding/activate` | Landing page of the invitation; turns the e-mail link into a session |
| `/gateway/*` and `/redirect` | Gateways opened by the MaihueGO app; out of scope for this manual |

## What decides whether the customer can enter

Every time the customer opens a private route, the portal checks four things in order:

| Order | Check | When it fails |
| - | - | - |
| 1 | **Is there a session?** The portal looks for the session cookie | Sends them to sign in at `horizon-authenticate` and, once done, back to the same address |
| 2 | **Is the session valid?** The portal asks the server for the session | Shows "We could not open your session" with the **Sign in again** button |
| 3 | **Is the section switched on?** Reads the feature flags of the `portal-customer` category | Takes them to **Home**; the section is also missing from the menu and the shortcuts |
| 4 | **Is an onboarding pending?** (only with `portal-customer-onboarding` on) | Takes them to the activation wizard. While it is pending only **Account**, **Payment methods** and **Support** open |

> [!NOTE]
>
> **Home is always on** (its flag is locked). It is the safe place the customer is sent to when another
> section is switched off.

## Technical detail

| Aspect | Where |
| - | - |
| Menu groups and order | `frontend/portal-customer/app/lib/shell/navigation.ts` (`PORTAL_NAV_GROUPS`) |
| Flag of each page and its default | `frontend/portal-customer/app/lib/portal/page-flags.ts` |
| Public routes and session | `frontend/portal-customer/proxy.ts` (`PUBLIC_PATH`); the `?bbx=` exchange and `/logout` go through `horizon-authenticate` |
| Session check in the browser | `app/lib/providers/portal-sso-guard.tsx` (`GET /api/auth/session`) |
| Section off → Home | `app/lib/portal/portal-feature-gate.tsx` |
| Pending onboarding | `app/lib/portal/portal-onboarding-gate.tsx` and `onboarding-routes.ts` (`ONBOARDING_OPEN_SECTIONS`) |
| Flag evaluation | `GET /api/v3/feature-flag/evaluate?category=portal-customer` (`app/lib/flags.ts`) |
| Menu texts | `messages/{es,en}.json` › `navigation`, `userMenu`, `organizationSwitcher` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.