Shipflash logoDocs

Branding

Branding controls public logo, favicon, appearance mode, and brand values shown across public and dashboard surfaces.

On this page

Where to look

AreaPaths
Routesrc/app/(dashboard)/admin/branding/page.tsx
Actions and queriessrc/features/branding/server/actions.ts, queries.ts
Repositorysrc/features/branding/server/repository.ts
Sharedsrc/features/branding/shared/settings.ts
UIsrc/features/branding/ui/form.tsx
Uploadssrc/components/uploads, src/lib/uploads

Code-backed branding map

Admin branding surface

The admin route loads current branding values and delegates the editable form to feature UI.

  • src/app/(dashboard)/admin/branding/page.tsx
  • src/features/branding/ui/form.tsx

Branding reads and writes

Queries, actions, and repository helpers keep public reads separate from admin mutations.

  • src/features/branding/server/queries.ts
  • src/features/branding/server/actions.ts
  • src/features/branding/server/repository.ts

Upload validation

Logo and favicon upload UI uses shared media helpers and server-safe file type rules.

  • src/components/uploads/media-uploader.tsx
  • src/components/uploads/media-upload-helpers.ts
  • src/lib/uploads/media-types.ts

Branding update flow

  1. 1

    Load the shared branding record

    Branding settings are loaded through feature queries before the admin form renders.

    • src/features/branding/server/queries.ts
  2. 2

    Validate form and media inputs

    Form and upload helpers constrain appearance values and accepted media before writes.

    • src/features/branding/shared/settings.ts
    • src/lib/uploads/media-types.ts
  3. 3

    Write through the repository

    Brand updates are centralized in the branding repository so public and admin behavior stay aligned.

    • src/features/branding/server/actions.ts
    • src/features/branding/server/repository.ts
  4. 4

    Re-check public surfaces

    Marketing header, auth surfaces, dashboard shell, metadata, logo, and favicon should reflect the updated values.

    • src/features/branding/ui/form.tsx

Branding access guard

Source: src/features/branding/server/actions.ts

Branding writes require an authenticated profile, non-read-only access, and branding permission.

ts
export async function updateBrandingSettings(formData: FormData) {
  const supabase = await getServerSupabase();
  const profile = await getActiveProfile();
  if (!profile) {
    return { success: false, message: "User not authenticated" };
  }

  if (hasReadOnlyAccess(profile)) {
    return { success: false, message: "This account has read-only access and cannot make changes." };
  }

  const hasAccess = await canAccessAsync(profile.role, "branding");
  if (!hasAccess) {
    return { success: false, message: "Unauthorized: Super Admin access required" };
  }

Branding rules

  • Validate uploaded asset type and size before storing it.
  • Keep public branding reads separate from admin mutation paths.
  • Check marketing nav, auth pages, dashboard header, metadata, and icons after changing brand values.