diff --git a/docs/components.json b/docs/components.json new file mode 100644 index 0000000..e5541ce --- /dev/null +++ b/docs/components.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "", + "css": "src/app/global.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "iconLibrary": "lucide", + "rtl": false, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "registries": {} +} diff --git a/docs/package.json b/docs/package.json index 8a79308..cfff83a 100644 --- a/docs/package.json +++ b/docs/package.json @@ -11,14 +11,22 @@ "postinstall": "fumadocs-mdx" }, "dependencies": { + "@radix-ui/react-slot": "^1.2.4", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "framer-motion": "^12.33.0", "fumadocs-core": "16.4.11", "fumadocs-mdx": "14.2.6", "fumadocs-twoslash": "^3.1.12", "fumadocs-ui": "16.4.11", "lucide-react": "^0.544.0", + "motion": "^12.33.0", "next": "16.1.6", + "radix-ui": "^1.4.3", "react": "^19.2.1", "react-dom": "^19.2.1", + "react-use-measure": "^2.1.7", + "tailwind-merge": "^3.4.0", "twoslash": "^0.3.6" }, "devDependencies": { @@ -29,7 +37,9 @@ "@types/react": "^19.2.7", "@types/react-dom": "^19.2.3", "postcss": "^8.5.6", + "shadcn": "^3.8.4", "tailwindcss": "^4.1.14", + "tw-animate-css": "^1.4.0", "typescript": "^5.9.3" } } diff --git a/docs/public/create-api-v1.svg b/docs/public/create-api-v1.svg new file mode 100644 index 0000000..986755d --- /dev/null +++ b/docs/public/create-api-v1.svg @@ -0,0 +1,94 @@ +
import { z } from "zod";
+import { db } from "./db";
+import {
+  createClient,
+  createEndpoint,
+  createEndpointConfig,
+  createRouter,
+} from "@aura-stack/router";
+
+const config = createEndpointConfig({
+  schemas: {
+    body: z.object({
+      firstname: z.string(),
+      lastname: z.string(),
+      age: z.number(),
+    }),
+  },
+});
+
+export const createUser = createEndpoint(
+  "POST",
+  "/users",
+  async (ctx) => {
+    const { firstname, lastname, age } = ctx.body;
+    const createdUser = await db.user.insert({ firstname, lastname, age });
+    return Response.json({ data: createdUser });
+  },
+  config,
+);
+
+export const router = createRouter([createUser]);
\ No newline at end of file diff --git a/docs/public/create-api-v2.svg b/docs/public/create-api-v2.svg new file mode 100644 index 0000000..34e1fea --- /dev/null +++ b/docs/public/create-api-v2.svg @@ -0,0 +1,87 @@ +
import { z } from "zod";
+import { db } from "./db";
+import {
+  createClient,
+  createEndpoint,
+  createEndpointConfig,
+  createRouter,
+} from "@aura-stack/router";
+
+const config = createEndpointConfig({
+  schemas: {
+    body: z.object({
+      firstname: z.string(),
+      lastname: z.string(),
+      age: z.number(),
+    }),
+  },
+});
+
+export const createUser = createEndpoint("POST", "/users", async (ctx) => {
+    const { firstname, lastname, age } = ctx.body;
+    const createdUser = await db.user.insert({ firstname, lastname, age });
+    return Response.json({ data: createdUser });
+}, config);
\ No newline at end of file diff --git a/docs/public/create-api-v3.svg b/docs/public/create-api-v3.svg new file mode 100644 index 0000000..a9f848a --- /dev/null +++ b/docs/public/create-api-v3.svg @@ -0,0 +1,87 @@ +
import { z } from "zod";
+import { db } from "./db";
+import {
+  createClient,
+  createEndpoint,
+  createEndpointConfig,
+  createRouter,
+} from "@aura-stack/router";
+
+const config = createEndpointConfig({
+  schemas: {
+    body: z.object({
+      firstname: z.string(),
+      lastname: z.string(),
+      age: z.number(),
+    }),
+  },
+});
+
+export const createUser = createEndpoint("POST", "/users", async (ctx) => {
+    const { firstname, lastname, age } = ctx.body;
+    const createdUser = await db.user.insert({ firstname, lastname, age });
+    return Response.json({ data: createdUser });
+}, config);
\ No newline at end of file diff --git a/docs/public/create-api.svg b/docs/public/create-api.svg new file mode 100644 index 0000000..b5f0b13 --- /dev/null +++ b/docs/public/create-api.svg @@ -0,0 +1,106 @@ +
import { z } from "zod";
+import { db } from "./db";
+import {
+  createClient,
+  createEndpoint,
+  createEndpointConfig,
+  createRouter,
+} from "@aura-stack/router";
+
+const config = createEndpointConfig({
+  schemas: {
+    body: z.object({
+      firstname: z.string(),
+      lastname: z.string(),
+      age: z.number(),
+    }),
+  },
+});
+
+export const createUser = createEndpoint(
+  "POST",
+  "/users",
+  async (ctx) => {
+    const { firstname, lastname, age } = ctx.body;
+    const createdUser = await db.user.insert({ firstname, lastname, age });
+    return Response.json({ data: createdUser });
+  },
+  config,
+);
+
+export const router = createRouter([createUser]);
+
+export const client = createClient<typeof router>({
+  baseURL: "http://localhost:3000",
+});
+
+const newUser = await client.post("/users", {
+  body: {
+    firstname: "John",
+    lastname: "Doe",
+    age: 30,
+  },
+});
\ No newline at end of file diff --git a/docs/public/endpoints-clean.png b/docs/public/endpoints-clean.png new file mode 100644 index 0000000..6cf23e3 Binary files /dev/null and b/docs/public/endpoints-clean.png differ diff --git a/docs/public/endpoints.png b/docs/public/endpoints.png new file mode 100644 index 0000000..20384e4 Binary files /dev/null and b/docs/public/endpoints.png differ diff --git a/docs/public/router-core-v1.png b/docs/public/router-core-v1.png new file mode 100644 index 0000000..d3a1e1c Binary files /dev/null and b/docs/public/router-core-v1.png differ diff --git a/docs/public/router-core-v2.svg b/docs/public/router-core-v2.svg new file mode 100644 index 0000000..6c9d416 --- /dev/null +++ b/docs/public/router-core-v2.svg @@ -0,0 +1,94 @@ +
import { z } from "zod";
+import { db } from "./db";
+import {
+  createEndpoint,
+  createEndpointConfig,
+  createRouter,
+  createClient,
+} from "@aura-stack/router";
+
+const config = createEndpointConfig({
+  schemas: {
+    body: z.object({
+      name: z.string(),
+      lastname: z.string(),
+      age: z.number(),
+    }),
+  },
+});
+
+export const createUser = createEndpoint(
+  "POST",
+  "/users",
+  (ctx) => {
+    const { name, lastname, age } = ctx.body;
+    const createdUser = db.users.insert({ name, lastname, age });
+    return Response.json({ data: createdUser });
+  },
+  config,
+);
+
+export const router = createRouter([createUser]);
\ No newline at end of file diff --git a/docs/public/router-core-v4.svg b/docs/public/router-core-v4.svg new file mode 100644 index 0000000..fb7b9b3 --- /dev/null +++ b/docs/public/router-core-v4.svg @@ -0,0 +1,91 @@ +
import { z } from "zod";
+import { db } from "./db";
+import {
+  createEndpoint, 
+  createEndpointConfig, 
+  createRouter,
+  createClient,
+} from "@aura-stack/router";
+
+const config = createEndpointConfig({
+  schemas: {
+    body: z.object({
+      name: z.string(),
+      lastname: z.string(),
+      age: z.number(),
+    }),
+  },
+});
+
+export const createUser = createEndpoint("POST", "/users", (ctx) => {
+    const { name, lastname, age } = ctx.body;
+    const createdUser = db.users.insert({ name, lastname, age });
+    return Response.json({ data: createdUser });
+  },
+  config,
+);
+
+export const router = createRouter([createUser]);
\ No newline at end of file diff --git a/docs/public/router-core-v5.svg b/docs/public/router-core-v5.svg new file mode 100644 index 0000000..984f9d6 --- /dev/null +++ b/docs/public/router-core-v5.svg @@ -0,0 +1,78 @@ +
import { z } from "zod";
+import { db } from "./db";
+import {
+  createEndpoint, 
+  createEndpointConfig, 
+  createRouter,
+} from "@aura-stack/router";
+
+export const getUser = createEndpoint("GET", "/users/:userId", (ctx) => {
+  const { userId } = ctx.params;
+  const user = await db.users.findUser(userId) 
+  return Response.json({ data: user });
+});
+
+export const router = createRouter([createUser]);
\ No newline at end of file diff --git a/docs/public/router-core-v7.svg b/docs/public/router-core-v7.svg new file mode 100644 index 0000000..8bdf713 --- /dev/null +++ b/docs/public/router-core-v7.svg @@ -0,0 +1,78 @@ +
import { z } from "zod";
+import { db } from "./db";
+import {
+  createEndpoint,
+  createEndpointConfig,
+  createRouter,
+} from "@aura-stack/router";
+
+export const getUser = createEndpoint("GET", "/users/:userId", async (ctx) => {
+  const { userId } = ctx.params;
+  const user = await db.users.findUser(userId);
+  return Response.json({ data: user });
+});
+
+export const router = createRouter([getUser]);
\ No newline at end of file diff --git a/docs/public/router-core-v8.svg b/docs/public/router-core-v8.svg new file mode 100644 index 0000000..09c6c25 --- /dev/null +++ b/docs/public/router-core-v8.svg @@ -0,0 +1,78 @@ +
import { z } from "zod";
+import { db } from "./db";
+import {
+  createEndpoint,
+  createEndpointConfig,
+  createRouter,
+} from "@aura-stack/router";
+
+export const getUser = createEndpoint("GET", "/users/:userId", async (ctx) => {
+  const { userId } = ctx.params;
+  const user = await db.users.findUser(userId);
+  return Response.json({ data: user });
+});
+
+export const router = createRouter([getUser]);
\ No newline at end of file diff --git a/docs/public/router-core-v9.svg b/docs/public/router-core-v9.svg new file mode 100644 index 0000000..4229749 --- /dev/null +++ b/docs/public/router-core-v9.svg @@ -0,0 +1,78 @@ +
import { z } from "zod";
+import { db } from "./db";
+import {
+  createEndpoint,
+  createEndpointConfig,
+  createRouter,
+} from "@aura-stack/router";
+
+export const getUser = createEndpoint("GET", "/users/:userId", async (ctx) => {
+  const { userId } = ctx.params;
+  const user = await db.users.findUser(userId);
+  return Response.json({ data: user });
+});
+
+export const router = createRouter([getUser]);
\ No newline at end of file diff --git a/docs/public/router-core.png b/docs/public/router-core.png new file mode 100644 index 0000000..3816ff3 Binary files /dev/null and b/docs/public/router-core.png differ diff --git a/docs/src/app/global.css b/docs/src/app/global.css index 799f2ce..8e2f109 100644 --- a/docs/src/app/global.css +++ b/docs/src/app/global.css @@ -2,3 +2,126 @@ @import "fumadocs-ui/css/neutral.css"; @import "fumadocs-ui/css/preset.css"; @import "fumadocs-twoslash/twoslash.css"; +@import "tw-animate-css"; +@import "shadcn/tailwind.css"; + +@custom-variant dark (&:is(.dark *)); + +@theme inline { + --radius-sm: calc(var(--radius) - 4px); + --radius-md: calc(var(--radius) - 2px); + --radius-lg: var(--radius); + --radius-xl: calc(var(--radius) + 4px); + --radius-2xl: calc(var(--radius) + 8px); + --radius-3xl: calc(var(--radius) + 12px); + --radius-4xl: calc(var(--radius) + 16px); + --color-background: var(--background); + --color-foreground: var(--foreground); + --color-card: var(--card); + --color-card-foreground: var(--card-foreground); + --color-popover: var(--popover); + --color-popover-foreground: var(--popover-foreground); + --color-primary: var(--primary); + --color-primary-foreground: var(--primary-foreground); + --color-secondary: var(--secondary); + --color-secondary-foreground: var(--secondary-foreground); + --color-muted: var(--muted); + --color-muted-foreground: var(--muted-foreground); + --color-accent: var(--accent); + --color-accent-foreground: var(--accent-foreground); + --color-destructive: var(--destructive); + --color-border: var(--border); + --color-input: var(--input); + --color-ring: var(--ring); + --color-chart-1: var(--chart-1); + --color-chart-2: var(--chart-2); + --color-chart-3: var(--chart-3); + --color-chart-4: var(--chart-4); + --color-chart-5: var(--chart-5); + --color-sidebar: var(--sidebar); + --color-sidebar-foreground: var(--sidebar-foreground); + --color-sidebar-primary: var(--sidebar-primary); + --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); + --color-sidebar-accent: var(--sidebar-accent); + --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); + --color-sidebar-border: var(--sidebar-border); + --color-sidebar-ring: var(--sidebar-ring); +} + +:root { + --radius: 0.625rem; + --background: oklch(1 0 0); + --foreground: oklch(0.145 0 0); + --card: oklch(1 0 0); + --card-foreground: oklch(0.145 0 0); + --popover: oklch(1 0 0); + --popover-foreground: oklch(0.145 0 0); + --primary: oklch(0.205 0 0); + --primary-foreground: oklch(0.985 0 0); + --secondary: oklch(0.97 0 0); + --secondary-foreground: oklch(0.205 0 0); + --muted: oklch(0.97 0 0); + --muted-foreground: oklch(0.556 0 0); + --accent: oklch(0.97 0 0); + --accent-foreground: oklch(0.205 0 0); + --destructive: oklch(0.577 0.245 27.325); + --border: oklch(0.922 0 0); + --input: oklch(0.922 0 0); + --ring: oklch(0.708 0 0); + --chart-1: oklch(0.646 0.222 41.116); + --chart-2: oklch(0.6 0.118 184.704); + --chart-3: oklch(0.398 0.07 227.392); + --chart-4: oklch(0.828 0.189 84.429); + --chart-5: oklch(0.769 0.188 70.08); + --sidebar: oklch(0.985 0 0); + --sidebar-foreground: oklch(0.145 0 0); + --sidebar-primary: oklch(0.205 0 0); + --sidebar-primary-foreground: oklch(0.985 0 0); + --sidebar-accent: oklch(0.97 0 0); + --sidebar-accent-foreground: oklch(0.205 0 0); + --sidebar-border: oklch(0.922 0 0); + --sidebar-ring: oklch(0.708 0 0); +} + +.dark { + --background: oklch(0.145 0 0); + --foreground: oklch(0.985 0 0); + --card: oklch(0.205 0 0); + --card-foreground: oklch(0.985 0 0); + --popover: oklch(0.205 0 0); + --popover-foreground: oklch(0.985 0 0); + --primary: oklch(0.922 0 0); + --primary-foreground: oklch(0.205 0 0); + --secondary: oklch(0.269 0 0); + --secondary-foreground: oklch(0.985 0 0); + --muted: oklch(0.269 0 0); + --muted-foreground: oklch(0.708 0 0); + --accent: oklch(0.269 0 0); + --accent-foreground: oklch(0.985 0 0); + --destructive: oklch(0.704 0.191 22.216); + --border: oklch(1 0 0 / 10%); + --input: oklch(1 0 0 / 15%); + --ring: oklch(0.556 0 0); + --chart-1: oklch(0.488 0.243 264.376); + --chart-2: oklch(0.696 0.17 162.48); + --chart-3: oklch(0.769 0.188 70.08); + --chart-4: oklch(0.627 0.265 303.9); + --chart-5: oklch(0.645 0.246 16.439); + --sidebar: oklch(0.205 0 0); + --sidebar-foreground: oklch(0.985 0 0); + --sidebar-primary: oklch(0.488 0.243 264.376); + --sidebar-primary-foreground: oklch(0.985 0 0); + --sidebar-accent: oklch(0.269 0 0); + --sidebar-accent-foreground: oklch(0.985 0 0); + --sidebar-border: oklch(1 0 0 / 10%); + --sidebar-ring: oklch(0.556 0 0); +} + +@layer base { + * { + @apply border-border outline-ring/50; + } + body { + @apply bg-background text-foreground; + } +} \ No newline at end of file diff --git a/docs/src/app/layout.tsx b/docs/src/app/layout.tsx index 60bc6f1..f4b9982 100644 --- a/docs/src/app/layout.tsx +++ b/docs/src/app/layout.tsx @@ -1,17 +1,18 @@ import "@/app/global.css" import { RootProvider } from "fumadocs-ui/provider/next" -import { Inter } from "next/font/google" +import { Sora } from "next/font/google" -const inter = Inter({ +const sora = Sora({ subsets: ["latin"], + display: "swap", }) export { metadata } from "@/lib/metadata" export default function Layout({ children }: LayoutProps<"/">) { return ( - - + + {children} diff --git a/docs/src/app/page.tsx b/docs/src/app/page.tsx new file mode 100644 index 0000000..c20a6a7 --- /dev/null +++ b/docs/src/app/page.tsx @@ -0,0 +1,21 @@ +import { Features } from "@/components/features" +import { Header } from "@/components/header" +import { Hero } from "@/components/hero" +import { PoweringSection } from "@/components/powering" +import { Footer } from "@/components/footer" + +const IndexPage = () => { + return ( + <> +
+
+ + + +
+