Overview
Compact overview of constants and helpers. Use this page to find the right enum, map, route, or utility quickly. Keep enums and maps in sync.
Enums
- ArticleCategory - blog/doc categories
- AwardKey - award identifiers (used by
AwardIconMap
) - BillingCycle - billing periods (used by
BillingCycleMap
) - ChangelogTag - changelog labels
- CompanyKey - company logos (used by
CompanyLogoMap
) - ComponentAlignment - layout alignment options
- ComponentVariant - section/header visual variants
- DatabaseFunction - Postgres function names for voting
- DatabaseTable - Supabase table names
- FeatureTabKey - feature tabs for docs/landing
- LinkType - external/internal link classification
- ListItemType - list item variants
- LucideIcon - whitelisted Lucide icons (used by
LucideIconMap
) - OAuthProvider - auth providers (used by
SocialProvidersMap
) - RoadmapCategory - roadmap grouping
- RoadmapStatus - roadmap status values
- SidebarId - sidebar groups/ids (e.g., dashboard, docs)
- StorageBucket - Supabase storage bucket names
- SubscriptionPlanName - plan ids (used by
PlanNameMap/PlanIconMap
) - TabIcon - tech stack tab icons (used by
TabIconMap
) - TechStackLibrary - libraries registry (used by
LibraryMap
) - TestimonialsPlatform - testimonial sources (used by
TestimonialsSourceIconMap
)
Routes
- AppRoute - public site routes and external links (constants only, avoid hardcoded strings)
- DashboardRoute - authenticated app routes (Overview, Projects, Settings, etc.)
- AppRouteKey/AppRouteValue - inferred types from
AppRoute
- DashboardRouteKey/DashboardRouteValue - inferred types from
DashboardRoute
Utilities
Strings & classes
capitalizeFirst
- uppercase first charactercn
- merge Tailwind class strings safely
Navigation & redirects
encodedRedirect
- redirect with encoded status messageisActive
- mark link active for current pathname
React children
extractComponent
- pull a specific child component out of childrengetSlot
- get a single slot component from children
Content helpers
extractContentPreview
- short text preview from rich text or stringextractSearchSnippets
- snippets around a query with<mark>
getSectionLabel
- human label for CMS section with preview
Tina & data
fetchAllFromTinaConnection
- paginate Tina connections to full edge listnormalizeValueFromTina
- convertnull
toundefined
Dates & locale
formatDateShort
-dd MMM yyyy
localized dateformatTimeAgo
- relative time (e.g., “3 days ago”), localizedgetDefaultDate
- today at 00:00 UTC ISO string
SEO
generateSeoMetadata
- build Next.js Metadata from Tina SEO fields
Colors
hexToRgb
-#rrggbb
→"r g b"
rgbToHex
-"r g b"
→#rrggbb
sortPalette
- stable order for color tokens
Tokens & security
generateSecureToken
- raw, hashed, and masked API token trio
Icons & plans
getPlanIcon
- plan name → icon component (fallback safe)
Errors & env
normalizeError
- standardize unknown errors toError
isServer
- runtime check for server vs client
Object shape
convertToCamelCase
- snake_case keys → camelCase (single object)mapToCamelCase
- snake_case keys → camelCase (array)
Conventions
- Update the enum and its related map(s) together to avoid runtime gaps
- Keep persisted identifiers lowercase/snake where applicable; use human labels only for UI
- Do not change enum values without a migration (they propagate to content and DB)
- For Lucide icons, enum key must match the imported component name - then add to LucideIconMap
- Use route constants (AppRoute/DashboardRoute) rather than string literals
- Client-exposed env vars must be prefixed with
NEXT_PUBLIC_
- keep secrets server-only
Tips
- When adding a library, register it in TechStackLibrary and LibraryMap with an official URL
- For new plans or cycles, extend SubscriptionPlanName/BillingCycle and update PlanNameMap/PlanIconMap/BillingCycleMap
- If a new provider is added, update OAuthProvider and SocialProvidersMap
- Keep LocaleMap aligned with supported UI languages
- Review this page before refactoring to avoid breaking cross-file contracts