feat(www): introduce monorepo

This change brings Turborepo monorepo to independently handle the marketing website, the docs website and any other future use cases for mutli-platform support. They are using internal @katanemo package handlers for the design system and logic.
This commit is contained in:
Musa 2025-11-23 13:23:51 -08:00
parent 151cefd528
commit 0d9147456f
102 changed files with 3876 additions and 52 deletions

View file

@ -0,0 +1,59 @@
import { createFlowDiagram, FlowStep } from "@/utils/asciiBuilder";
/**
* Easy-to-use diagram templates that automatically handle spacing
* Perfect for non-coders who just want to define their flow
*/
// Example: Simple 3-step process
export const createSimpleProcess = (steps: string[]) => {
return createFlowDiagram({
title: "Process Flow",
width: 60,
steps: steps.map((label) => ({
label,
type: "regular" as const,
shadow: true,
})),
});
};
// Example: Create a nested container diagram
export const createNestedDiagram = (
title: string,
innerContent: FlowStep[],
width: number = 70,
) => {
return createFlowDiagram({
title,
width,
steps: innerContent,
});
};
// Pre-built templates
export const templates = {
simpleFlow: createSimpleProcess(["Start", "Process", "End"]),
apiFlow: createFlowDiagram({
title: "API Request Flow",
width: 65,
steps: [
{ label: "Client Request", type: "regular", shadow: true },
{ label: "API Gateway", type: "container", shadow: true },
{ label: "Process", type: "inner", shadow: true },
{ label: "Response", type: "regular", shadow: true },
],
}),
dataPipeline: createFlowDiagram({
title: "Data Pipeline",
width: 70,
steps: [
{ label: "Input Data", type: "regular", shadow: true },
{ label: "Transform", type: "inner", shadow: true },
{ label: "Validate", type: "regular", shadow: true },
{ label: "Store", type: "regular", shadow: true },
],
}),
};

View file

@ -0,0 +1,82 @@
/**
* Programmatic ASCII Diagram Builder
*
* For non-coders: Define your diagram structure with simple objects,
* and the system will automatically generate the ASCII art.
*/
interface DiagramStep {
id: string;
label: string;
type: "input" | "inner" | "regular";
position: { x: number; y: number };
}
interface DiagramFlow {
from: string;
to: string;
arrow: "right" | "down" | "left" | "up";
label?: string;
}
interface DiagramConfig {
title: string;
steps: DiagramStep[];
flows: DiagramFlow[];
}
// Example: Define diagram using simple objects
export const myFlow: DiagramConfig = {
title: "User Registration Flow",
steps: [
{ id: "start", label: "User", type: "input", position: { x: 0, y: 0 } },
{
id: "step1",
label: "Validate Email",
type: "inner",
position: { x: 2, y: 0 },
},
{
id: "step2",
label: "Create Account",
type: "regular",
position: { x: 2, y: 1 },
},
{
id: "step3",
label: "Send Welcome",
type: "regular",
position: { x: 2, y: 2 },
},
],
flows: [
{ from: "start", to: "step1", arrow: "right" },
{ from: "step1", to: "step2", arrow: "down" },
{ from: "step2", to: "step3", arrow: "down" },
],
};
/**
* Convert diagram config to ASCII string
*
* Usage:
* import { buildDiagram } from './ascii-builder';
* const ascii = buildDiagram(myFlow);
*/
export const buildDiagram = (config: DiagramConfig): string => {
// This function would programmatically build the ASCII
// For now, return a placeholder
let result = "";
result += `╔═ ${config.title} ══╗\n`;
result += `║ Placeholder for programmatic generation ║\n`;
result += `╚════════════════════════════════════╝\n`;
// TODO: Implement automatic ASCII generation from config
// This would:
// 1. Layout boxes based on positions
// 2. Add arrows based on flows
// 3. Add shadows automatically
// 4. Handle different box types
return result;
};

View file

@ -0,0 +1,84 @@
export const diagrams = {
intentDetection: ` ╔═ Intent Detection ═════════════════════════════╗
agent Cognition
Action
Confirm action?
Execute Action
`,
dataFlow: ` ╔═ Data Pipeline ═════════════════════════════╗
Input Process Transform
Store (DB)
`,
microservices: ` ╔═ Microservices Architecture ════════════════════╗
Client API API Gateway
Service A Service B
Database
`,
simpleFlow: `╔════════════╗ ╔════════════╗ ╔════════════╗
Step 1 Step 2 Step 3
`,
infrastructureLayer: ` ╔═ plano ════════════════════════════════════════╗
client Safety Guardrails
Multi-Agent Workflows
Unified LLM Access
`,
};
export type DiagramKey = keyof typeof diagrams;