Pular para o conteúdo principal

Routes

The template includes a Route Registry — a centralised system that maps every page URL in the application. Brands can fully customise URL paths without touching component code or the route tree.

How it works

All page routes are defined in app/config/routes/paths.ts. Each key maps to a URL pattern:

// app/config/routes/paths.ts (defaults)
export const routePaths: RoutePathMap = {
home: "/",
search: "/search",
casino: "/games",
"casino.play": "/games/:provider/:game",
sports: "/sports",
gamification: "/vip",
"user.data": "/user/data",
// ...
};

The route tree (routes.config.ts) reads these paths via routePattern(), and all links use routeHref() / gameHref() — so changing the path map automatically updates both routing and navigation.

Customising routes for your brand

  1. Create overrides/<brand-key>/app/config/routes/paths.ts
  2. Export a complete routePaths object (all keys must be present)
  3. Only change the static segments — param placeholders (:slug, :provider, :game, :id, :type, :token) must stay the same

Example — state77.com

// overrides/state77-com/app/config/routes/paths.ts
import type { RoutePathMap } from "~/types/routes";

export const routePaths: RoutePathMap = {
home: "/",
search: "/buscar",
debug: "/debug",

casino: "/casino",
"casino.live": "/casino/ao-vivo",
"casino.category": "/casino/categoria/:slug",
"casino.providers": "/casino/provedores",
"casino.provider": "/casino/provedores/:slug",
"casino.play": "/casino/jogo/:provider/:game",

sports: "/esportes",
"sports.catchAll": "/esportes/*",
"sports.test": "/esportes-teste",

gamification: "/gamificacao",
"gamification.missions": "/gamificacao/missoes",
"gamification.tournaments": "/gamificacao/torneios",
"gamification.tournament": "/gamificacao/torneios/:id",
"gamification.store": "/gamificacao/loja",
"gamification.miniGames": "/gamificacao/mini-jogos",
"gamification.levels": "/gamificacao/niveis",
"gamification.badges": "/gamificacao/conquistas",
"gamification.bonuses": "/gamificacao/bonus",

"user.data": "/jogador/dados",
"user.wallet": "/jogador/carteira",
"user.history": "/jogador/historico",
"user.config": "/jogador/configuracoes",
"user.protection": "/jogador/protecao",
"user.notifications": "/jogador/notificacoes",
"user.validate": "/jogador/validar/:type/:token",
"user.refers": "/jogador/indicacoes",

"legal.page": "/legal/:slug",
helpCenter: "/ajuda",
};

Available route keys

Home & Misc

KeyDefault pathDescription
home/Homepage
search/searchSearch page
debug/debugDebug page (dev)

Casino

KeyDefault pathDescription
casino/gamesCasino lobby
casino.live/games/liveLive casino
casino.category/games/category/:slugGames by category
casino.providers/games/providersProviders grid
casino.provider/games/providers/:slugGames by provider
casino.play/games/:provider/:gameGame detail/play

Sports

KeyDefault pathDescription
sports/sportsSportsbook index
sports.catchAll/sports/*Sportsbook deep links
sports.test/sports-testTest sportsbook

Gamification

KeyDefault pathDescription
gamification/vipGamification hub
gamification.missions/vip/missionsMissions
gamification.tournaments/vip/tournamentsTournaments
gamification.tournament/vip/tournaments/:idTournament detail
gamification.store/vip/storeStore
gamification.miniGames/vip/mini-gamesMini-games
gamification.levels/vip/levelsLevels
gamification.badges/vip/badgesBadges
gamification.bonuses/vip/bonusesBonuses

User

KeyDefault pathDescription
user.data/user/dataPersonal data
user.wallet/user/walletWallet & transactions
user.history/user/historyLogin & activity history
user.config/user/configSettings (password, 2FA, preferences)
user.protection/user/protectionResponsible gaming
user.notifications/user/notificationsNotifications
user.validate/user/validate/:type/:tokenLink validation
user.refers/user/refersReferrals
KeyDefault pathDescription
legal.page/legal/:slugDynamic legal page
helpCenter/helpHelp center

Rules

  1. All paths must start with /
  2. Param placeholders are fixed:slug, :provider, :game, :id, :type, :token must not be renamed (components use useParams() with these exact names)
  3. sports.catchAll must end with /*
  4. The override must be a complete map — TypeScript will error if any key is missing
  5. API routes are excluded — they are internal server endpoints and are not part of the Route Registry

Using routes in code

import { routeHref, gameHref, sportPath } from "~/utils/routes";

// Static route
routeHref("casino") // → '/games' or '/casino' (brand override)

// Dynamic route
routeHref("casino.category", { slug: "slots" })

// Game link from "provider/game" slug
gameHref("pgsoft/fortune-tiger")

// Sportsbook deep link
sportPath("/futebol/brasil")

Adding or removing pages

To add or remove pages entirely, edit app/config/routes.config.ts. The Route Registry only controls URL paths — the route tree structure is defined in routes.config.ts.

  • All routes should be nested inside layout('routes/_layout.tsx', [...]) for brand/env providers to work
  • Use index() for the default page of a group
  • Use route(routePattern('key'), file) for named pages
  • You can create any components, pages, or hooks you need — the fork is fully yours to customize