Setting your paths configuration
Learn how to setup the paths configuration of your React Router Supabase application
The paths configuration is set at apps/web/config/paths.config.ts
. This configuration stores all the paths that you'll be using in your application. It is a convenient way to store them in a central place rather than scatter them in the codebase using magic strings.
The configuration is validated using the Zod schema PathsSchema
, so if something is off, you'll see the errors.
It is unlikely you'll need to change this unless you're heavily editing the codebase.
import { z } from 'zod';const PathsSchema = z.object({ auth: z.object({ signIn: z.string().min(1), signUp: z.string().min(1), verifyMfa: z.string().min(1), callback: z.string().min(1), passwordReset: z.string().min(1), passwordUpdate: z.string().min(1), }), app: z.object({ home: z.string().min(1), personalAccountSettings: z.string().min(1), personalAccountBilling: z.string().min(1), personalAccountBillingReturn: z.string().min(1), accountHome: z.string().min(1), accountSettings: z.string().min(1), accountBilling: z.string().min(1), accountMembers: z.string().min(1), accountBillingReturn: z.string().min(1), joinTeam: z.string().min(1), }),});const pathsConfig = PathsSchema.parse({ auth: { signIn: '/auth/sign-in', signUp: '/auth/sign-up', verifyMfa: '/auth/verify', callback: '/auth/callback', passwordReset: '/auth/password-reset', passwordUpdate: '/update-password', }, app: { home: '/home', personalAccountSettings: '/home/settings', personalAccountBilling: '/home/billing', personalAccountBillingReturn: '/home/billing/return', accountHome: '/home/[account]', accountSettings: `/home/[account]/settings`, accountBilling: `/home/[account]/billing`, accountMembers: `/home/[account]/members`, accountBillingReturn: `/home/[account]/billing/return`, joinTeam: '/join', },} satisfies z.infer<typeof PathsSchema>);export default pathsConfig;