feat(db): mesh data model — meshes, members, invites, audit log
- pgSchema "mesh" with 4 tables isolating the peer mesh domain - Enums: visibility, transport, tier, role - audit_log is metadata-only (E2E encryption enforced at broker/client) - Cascade on mesh delete, soft-delete via archivedAt/revokedAt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
11
apps/web/src/config/app.ts
Normal file
11
apps/web/src/config/app.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import env from "env.config";
|
||||
|
||||
export const appConfig = {
|
||||
name: env.NEXT_PUBLIC_PRODUCT_NAME,
|
||||
url: env.NEXT_PUBLIC_URL,
|
||||
locale: env.NEXT_PUBLIC_DEFAULT_LOCALE,
|
||||
theme: {
|
||||
mode: env.NEXT_PUBLIC_THEME_MODE,
|
||||
color: env.NEXT_PUBLIC_THEME_COLOR,
|
||||
},
|
||||
} as const;
|
||||
23
apps/web/src/config/auth.ts
Normal file
23
apps/web/src/config/auth.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import env from "env.config";
|
||||
|
||||
import { SocialProvider, authConfigSchema } from "@turbostarter/auth";
|
||||
|
||||
import type { AuthConfig } from "@turbostarter/auth";
|
||||
|
||||
/** Coerce env value to boolean (handles both parsed booleans and raw strings) */
|
||||
const toBool = (val: unknown, fallback: boolean): boolean => {
|
||||
if (typeof val === "boolean") return val;
|
||||
if (val === "true" || val === "1") return true;
|
||||
if (val === "false" || val === "0") return false;
|
||||
return fallback;
|
||||
};
|
||||
|
||||
export const authConfig = authConfigSchema.parse({
|
||||
providers: {
|
||||
password: toBool(env.NEXT_PUBLIC_AUTH_PASSWORD, true),
|
||||
magicLink: toBool(env.NEXT_PUBLIC_AUTH_MAGIC_LINK, false),
|
||||
passkey: toBool(env.NEXT_PUBLIC_AUTH_PASSKEY, true),
|
||||
anonymous: toBool(env.NEXT_PUBLIC_AUTH_ANONYMOUS, true),
|
||||
oAuth: [SocialProvider.APPLE, SocialProvider.GOOGLE, SocialProvider.GITHUB],
|
||||
},
|
||||
}) satisfies AuthConfig;
|
||||
104
apps/web/src/config/paths.ts
Normal file
104
apps/web/src/config/paths.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
const ADMIN_PREFIX = "/admin";
|
||||
const AUTH_PREFIX = "/auth";
|
||||
const BLOG_PREFIX = "/blog";
|
||||
const DASHBOARD_PREFIX = "/dashboard";
|
||||
const LEGAL_PREFIX = "/legal";
|
||||
|
||||
const API_PREFIX = "/api";
|
||||
|
||||
// AI apps routes (no prefix - top-level routes)
|
||||
const APPS_CHAT = "/chat";
|
||||
const APPS_IMAGE = "/image";
|
||||
const APPS_TTS = "/tts";
|
||||
const APPS_PDF = "/pdf";
|
||||
const APPS_AGENT = "/agent";
|
||||
|
||||
const DEMO_PREFIX = "/demo";
|
||||
|
||||
const pathsConfig = {
|
||||
index: "/",
|
||||
demo: {
|
||||
index: DEMO_PREFIX,
|
||||
scrollTest: `${DEMO_PREFIX}/scroll-test`,
|
||||
},
|
||||
apps: {
|
||||
chat: {
|
||||
index: APPS_CHAT,
|
||||
chat: (id: string) => `${APPS_CHAT}/${id}`,
|
||||
},
|
||||
image: {
|
||||
index: APPS_IMAGE,
|
||||
history: `${APPS_IMAGE}/history`,
|
||||
detail: (id: string) => `${APPS_IMAGE}/${id}`,
|
||||
generation: (id: string) => `${APPS_IMAGE}/generation/${id}`,
|
||||
},
|
||||
tts: APPS_TTS,
|
||||
pdf: {
|
||||
index: APPS_PDF,
|
||||
detail: (id: string) => `${APPS_PDF}/${id}`,
|
||||
chat: (id: string) => `${APPS_PDF}/${id}`,
|
||||
},
|
||||
agent: APPS_AGENT,
|
||||
},
|
||||
admin: {
|
||||
index: ADMIN_PREFIX,
|
||||
users: {
|
||||
index: `${ADMIN_PREFIX}/users`,
|
||||
user: (id: string) => `${ADMIN_PREFIX}/users/${id}`,
|
||||
},
|
||||
organizations: {
|
||||
index: `${ADMIN_PREFIX}/organizations`,
|
||||
organization: (slug: string) => `${ADMIN_PREFIX}/organizations/${slug}`,
|
||||
},
|
||||
customers: {
|
||||
index: `${ADMIN_PREFIX}/customers`,
|
||||
customer: (id: string) => `${ADMIN_PREFIX}/customers/${id}`,
|
||||
},
|
||||
},
|
||||
marketing: {
|
||||
pricing: "/pricing",
|
||||
contact: "/contact",
|
||||
blog: {
|
||||
index: BLOG_PREFIX,
|
||||
post: (slug: string) => `${BLOG_PREFIX}/${slug}`,
|
||||
},
|
||||
legal: (slug: string) => `${LEGAL_PREFIX}/${slug}`,
|
||||
},
|
||||
auth: {
|
||||
login: `${AUTH_PREFIX}/login`,
|
||||
register: `${AUTH_PREFIX}/register`,
|
||||
join: `${AUTH_PREFIX}/join`,
|
||||
forgotPassword: `${AUTH_PREFIX}/password/forgot`,
|
||||
updatePassword: `${AUTH_PREFIX}/password/update`,
|
||||
error: `${AUTH_PREFIX}/error`,
|
||||
},
|
||||
dashboard: {
|
||||
user: {
|
||||
index: DASHBOARD_PREFIX,
|
||||
ai: `${DASHBOARD_PREFIX}/ai`,
|
||||
vocabulary: `${DASHBOARD_PREFIX}/vocabulary`,
|
||||
settings: {
|
||||
index: `${DASHBOARD_PREFIX}/settings`,
|
||||
security: `${DASHBOARD_PREFIX}/settings/security`,
|
||||
billing: `${DASHBOARD_PREFIX}/settings/billing`,
|
||||
},
|
||||
},
|
||||
organization: (slug: string) => ({
|
||||
index: `${DASHBOARD_PREFIX}/${slug}`,
|
||||
settings: {
|
||||
index: `${DASHBOARD_PREFIX}/${slug}/settings`,
|
||||
},
|
||||
members: `${DASHBOARD_PREFIX}/${slug}/members`,
|
||||
}),
|
||||
},
|
||||
} as const;
|
||||
|
||||
export {
|
||||
pathsConfig,
|
||||
DASHBOARD_PREFIX,
|
||||
ADMIN_PREFIX,
|
||||
BLOG_PREFIX,
|
||||
AUTH_PREFIX,
|
||||
API_PREFIX,
|
||||
LEGAL_PREFIX,
|
||||
};
|
||||
Reference in New Issue
Block a user