diff --git a/app/page.mdx b/app/introduction/page.mdx similarity index 100% rename from app/page.mdx rename to app/introduction/page.mdx diff --git a/app/page.tsx b/app/page.tsx new file mode 100644 index 0000000..1e40eca --- /dev/null +++ b/app/page.tsx @@ -0,0 +1,104 @@ +import { Resource, type ResourceType } from "@/components/Resources"; +import { wrapper } from "@/components/mdx"; +import type { Metadata } from "next"; +import type { FC } from "react"; + +export const metadata: Metadata = { + title: "Lysand Documentation", + description: + "Introduction to the Lysand Protocol, a communication medium for federated applications, leveraging the HTTP stack.", +}; + +const Page: FC = () => { + const resources: ResourceType[] = [ + { + name: "JSON-based APIs", + description: "Simple JSON objects are used to represent all data.", + icon: "tabler:code-dots", + }, + { + name: "MIT licensed", + description: + "Lysand is licensed under the MIT License, which allows you to use it for any purpose.", + icon: "tabler:license", + }, + { + name: "Built-in namespaced extensions", + description: + "Extensions for common use cases are built-in, such as custom emojis and reactions", + icon: "tabler:puzzle", + }, + { + name: "Easy to implement", + description: + "Lysand is designed to be easy to implement in any language.", + icon: "tabler:code", + }, + { + name: "Signed by default", + description: + "All requests are signed using advanced cryptographic algorithms.", + icon: "tabler:shield-check", + }, + { + name: "No vendor lock-in", + description: + "Standardization is heavy and designed to break vendor lock-in.", + icon: "tabler:database", + }, + { + name: "In-depth security docs", + description: + "Docs provide lots of information on how to program a secure server.", + icon: "tabler:shield", + }, + { + name: "Official SDKs", + description: "Official SDKs are available for TypeScript", + icon: "tabler:plug", + }, + ]; + + return wrapper({ + children: ( + <> +
+

+ Lysand +

+

+ Federation, simpler +

+

+ A simple, extensible federated protocol for building + useful applications. +

+
+ +

Made by developers

+ +

+ Lysand is designed and maintained by the developers of the + Lysand Server, which uses Lysand for federation. This + community could include you! Check out our{" "} + + Git repository + {" "} + to see how you can contribute. +

+ +
+ {resources.map((resource) => ( + + ))} +
+ + ), + }); +}; + +export default Page; diff --git a/components/Navigation.tsx b/components/Navigation.tsx index ac78159..82fac8a 100644 --- a/components/Navigation.tsx +++ b/components/Navigation.tsx @@ -246,7 +246,7 @@ export const navigation: NavGroup[] = [ { title: "Guides", links: [ - { title: "Introduction", href: "/" }, + { title: "Introduction", href: "/introduction" }, { title: "SDKs", href: "/sdks" }, { title: "Entities", href: "/entities" }, ], diff --git a/components/Resources.tsx b/components/Resources.tsx index 9d01a8c..14a38ae 100644 --- a/components/Resources.tsx +++ b/components/Resources.tsx @@ -8,34 +8,29 @@ import { } from "framer-motion"; import Link from "next/link"; -import type { - ComponentPropsWithoutRef, - ComponentType, - MouseEvent, -} from "react"; +import { Icon } from "@iconify-icon/react"; +import type { ComponentPropsWithoutRef, MouseEvent } from "react"; import { GridPattern } from "./GridPattern"; import { Heading } from "./Heading"; -import { ChatBubbleIcon } from "./icons/ChatBubbleIcon"; -import { UsersIcon } from "./icons/UsersIcon"; -interface Resource { - href: string; +export interface ResourceType { + href?: string; name: string; description: string; - icon: ComponentType<{ className?: string }>; - pattern: Omit< + icon: string; + pattern?: Omit< ComponentPropsWithoutRef, "width" | "height" | "x" >; } -const resources: Resource[] = [ +const resources: ResourceType[] = [ { href: "/entities", name: "Entities", description: "Learn how Entities work and how to use them to transmit federated data.", - icon: ChatBubbleIcon, + icon: "tabler:code-asterisk", pattern: { y: 16, squares: [ @@ -49,7 +44,7 @@ const resources: Resource[] = [ name: "Security", description: "Learn how to secure your Lysand implementation and protect your users' data.", - icon: UsersIcon, + icon: "tabler:building-bank", pattern: { y: -6, squares: [ @@ -60,10 +55,14 @@ const resources: Resource[] = [ }, ]; -function ResourceIcon({ icon: Icon }: { icon: Resource["icon"] }) { +function ResourceIcon({ icon }: { icon: string }) { return (
- +
); } @@ -72,7 +71,7 @@ function ResourcePattern({ mouseX, mouseY, ...gridProps -}: Resource["pattern"] & { +}: ResourceType["pattern"] & { mouseX: MotionValue; mouseY: MotionValue; }) { @@ -110,7 +109,7 @@ function ResourcePattern({ ); } -function Resource({ resource }: { resource: Resource }) { +export function Resource({ resource }: { resource: ResourceType }) { const mouseX = useMotionValue(0); const mouseY = useMotionValue(0); @@ -131,7 +130,13 @@ function Resource({ resource }: { resource: Resource }) { className="group relative flex rounded-md bg-zinc-50 transition-shadow hover:shadow-md hover:shadow-zinc-900/5 dark:bg-white/2.5 dark:hover:shadow-black/5" > @@ -139,10 +144,14 @@ function Resource({ resource }: { resource: Resource }) {

- - - {resource.name} - + {resource.href ? ( + + + {resource.name} + + ) : ( + resource.name + )}

{resource.description}