Initial commit: Meshkee dashboards monorepo.

Includes business, customer, and super-admin apps with shared packages and production deploy scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-07-22 13:48:53 +03:30
co-authored by Cursor
commit f566387c61
509 changed files with 62690 additions and 0 deletions
@@ -0,0 +1,54 @@
export interface DashboardDocumentTitleParts {
businessName: string
dashboardName: string
pageLabels?: string[]
}
/** Pattern: `{businessName} - {dashboardName} · {page}` */
export function formatDashboardDocumentTitle({
businessName,
dashboardName,
pageLabels = [],
}: DashboardDocumentTitleParts): string {
const business = businessName.trim() || 'Store'
const dashboard = dashboardName.trim()
const pages = pageLabels.map((label) => label.trim()).filter(Boolean)
if (pages.length === 0) {
return `${business} - ${dashboard}`
}
return `${business} - ${dashboard} · ${pages.join(' · ')}`
}
export interface RouteTitleRule {
match: string | RegExp
labels: string[]
}
export function normalizeRoutePath(pathname: string): string {
const path = pathname.split('?')[0]?.split('#')[0] ?? '/'
if (path === '/') return '/'
return path.replace(/\/+$/, '') || '/'
}
export function resolveRoutePageLabels(pathname: string, rules: RouteTitleRule[]): string[] {
const path = normalizeRoutePath(pathname)
const sorted = [...rules].sort((a, b) => {
const lenA = typeof a.match === 'string' ? a.match.length : 0
const lenB = typeof b.match === 'string' ? b.match.length : 0
return lenB - lenA
})
for (const rule of sorted) {
if (typeof rule.match === 'string' && rule.match === path) {
return rule.labels
}
if (rule.match instanceof RegExp && rule.match.test(path)) {
return rule.labels
}
}
return []
}