Skip to content

[BE-41] Hub settings & branding API — name, logo, colors, contact details #1397

Description

@yusuftomilola

Overview

The hub's identity (name, logo, brand color, support contacts) is hardcoded across the frontend and email templates (COMPANY_NAME/SUPPORT_EMAIL env vars in backend/.env.example). A settings API makes ManageHub deployable for any hub without code changes — the first step toward white-labeling.

Proposed Design

New module backend/src/hub-settings/:

  • Single-row HubSettings entity (enforce singleton in the service): hubName, logoUrl (Cloudinary — reuse backend/src/cloudinary/), faviconUrl (nullable), primaryColor (hex, validated), supportEmail, supportPhone, address, socialLinks (JSONB: twitter/instagram/linkedin), openingHours (JSONB per weekday, nullable).

Endpoints

Method Path Access
GET /hub-settings Public — everything above is public-safe
PATCH /hub-settings ADMIN/SUPER_ADMIN
POST /hub-settings/logo ADMIN — multipart upload via Cloudinary

Tasks

  • Module + singleton row (created with sensible defaults on first read if absent — seed from the existing env values for backward compatibility).
  • Email templates consume settings (hub name, support email, logo) instead of env constants where straightforward — at minimum the shared header/footer partials in backend/src/email/.
  • Hex color and email/phone validation in the DTO; Swagger docs.
  • Migration included.

Acceptance Criteria

  • GET /hub-settings works unauthenticated and returns defaults on a fresh install.
  • Updating the name/logo reflects in subsequently sent emails.
  • Invalid hex colors are rejected with 400.

Dependencies

Blocks [FE-29].

Notes for Contributors

Good first issue. Comment below to be assigned.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions