Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: adds fumadocs #59

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# deps
/node_modules

# generated content
.contentlayer
.content-collections
.source

# test & build
/coverage
/.next/
/out/
/build
*.tsbuildinfo

# misc
.DS_Store
*.pem
/.pnp
.pnp.js
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# others
.env*.local
.vercel
next-env.d.ts
26 changes: 26 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# docs

This is a Next.js application generated with
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).

Run development server:

```bash
npm run dev
# or
pnpm dev
# or
yarn dev
```

Open http://localhost:3000 with your browser to see the result.

## Learn More

To learn more about Next.js and Fumadocs, take a look at the following
resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
- [Fumadocs](https://fumadocs.vercel.app) - learn about Fumadocs
7 changes: 7 additions & 0 deletions docs/app/(home)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { ReactNode } from 'react';
import { HomeLayout } from 'fumadocs-ui/layouts/home';
import { baseOptions } from '@/app/layout.config';

export default function Layout({ children }: { children: ReactNode }) {
return <HomeLayout {...baseOptions}>{children}</HomeLayout>;
}
19 changes: 19 additions & 0 deletions docs/app/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Link from 'next/link';

export default function HomePage() {
return (
<main className="flex flex-1 flex-col justify-center text-center">
<h1 className="mb-4 text-2xl font-bold">Hello World</h1>
<p className="text-fd-muted-foreground">
You can open{' '}
<Link
href="/docs"
className="text-fd-foreground font-semibold underline"
>
/docs
</Link>{' '}
and see the documentation.
</p>
</main>
);
}
4 changes: 4 additions & 0 deletions docs/app/api/search/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { source } from '@/lib/source';
import { createFromSource } from 'fumadocs-core/search/server';

export const { GET } = createFromSource(source);
14 changes: 14 additions & 0 deletions docs/app/docs-og/[...slug]/route.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { generateOGImage } from 'fumadocs-ui/og';
import { metadataImage } from '@/lib/metadata';

export const GET = metadataImage.createAPI((page) => {
return generateOGImage({
title: page.data.title,
description: page.data.description,
site: 'OramaCore',
});
});

export function generateStaticParams() {
return metadataImage.generateParams();
}
47 changes: 47 additions & 0 deletions docs/app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { source } from '@/lib/source';
import {
DocsPage,
DocsBody,
DocsDescription,
DocsTitle,
} from 'fumadocs-ui/page';
import { notFound } from 'next/navigation';
import defaultMdxComponents from 'fumadocs-ui/mdx';
import { metadataImage } from '@/lib/metadata';

export default async function Page(props: {
params: Promise<{ slug?: string[] }>;
}) {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();

const MDX = page.data.body;

return (
<DocsPage toc={page.data.toc} full={page.data.full}>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDX components={{ ...defaultMdxComponents }} />
</DocsBody>
</DocsPage>
);
}

export async function generateStaticParams() {
return source.generateParams();
}

export async function generateMetadata(props: {
params: Promise<{ slug?: string[] }>;
}) {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();

return metadataImage.withImage(page.slugs, {
title: page.data.title,
description: page.data.description,
});
}
12 changes: 12 additions & 0 deletions docs/app/docs/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import type { ReactNode } from 'react';
import { baseOptions } from '@/app/layout.config';
import { source } from '@/lib/source';

export default function Layout({ children }: { children: ReactNode }) {
return (
<DocsLayout tree={source.pageTree} {...baseOptions}>
{children}
</DocsLayout>
);
}
3 changes: 3 additions & 0 deletions docs/app/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
21 changes: 21 additions & 0 deletions docs/app/layout.config.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';

/**
* Shared layout configurations
*
* you can configure layouts individually from:
* Home Layout: app/(home)/layout.tsx
* Docs Layout: app/docs/layout.tsx
*/
export const baseOptions: BaseLayoutProps = {
nav: {
title: 'OramaCore',
},
links: [
{
text: 'Docs',
url: '/docs',
active: 'nested-url',
},
],
};
18 changes: 18 additions & 0 deletions docs/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import './global.css';
import { RootProvider } from 'fumadocs-ui/provider';
import { Inter } from 'next/font/google';
import type { ReactNode } from 'react';

const inter = Inter({
subsets: ['latin'],
});

export default function Layout({ children }: { children: ReactNode }) {
return (
<html lang="en" className={inter.className} suppressHydrationWarning>
<body className="flex flex-col min-h-screen">
<RootProvider>{children}</RootProvider>
</body>
</html>
);
}
4 changes: 4 additions & 0 deletions docs/content/docs/architecture/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: OramaCore Architecture
description: A deep dive into the OramaCore architecture.
---
52 changes: 52 additions & 0 deletions docs/content/docs/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: OramaCore
description: An introduction to OramaCore - a complex AI architecture made easy and open-source.
---
import { File, Folder, Files } from 'fumadocs-ui/components/files';
import { SearchIcon, DatabaseIcon, WholeWordIcon, FileJson } from 'lucide-react';

Building search engines, copilots, answer systems, or pretty much any AI project is harder than it should be.

Even in the simplest cases, you'll need a vector database, a connection to an LLM for generating embeddings, a solid chunking mechanism, and another LLM to generate answers. And that's without even considering your specific needs, where all these pieces need to work together in a way that's unique to your use case.

OramaCore simplifies the chaos of setting up and maintaining a complex architecture. It gives you a single, easy-to-use, opinionated server that's designed to help you create tailored solutions for your own unique challenges.

## Why OramaCore

OramaCore gives you everything you need **in a single Dockerfile**.

Just pull it from DockerHub:

```sh
docker pull oramasearch/oramacore:latest
```

You're getting acces to:

<Cards>
<Card icon={<SearchIcon className="dark:text-purple-300 text-purple-500" />} title='Search engine'>
A powerful, low-latency search engine with built-in support for >30 languages.
</Card>

<Card icon={<DatabaseIcon className="dark:text-blue-300 text-blue-500" />} title='Vector database'>
A complete vector database with automatic chunking and automatic embeddings generation.
</Card>

<Card icon={<WholeWordIcon className="dark:text-green-300 text-green-500" />} title='Small, fine tuned language models'>
An array of small, fine-tuned language models that can handle all sorts of operations on your data, from translating natural language queries into optimized OramaCore queries to running custom agents.
</Card>

<Card icon={<FileJson className="dark:text-yellow-300 text-yellow-500" />} title='A JavaScript runtime'>
A fast, integrated, fully functional JavaScript runtime (powered by [Deno](https://deno.com)) so you can write custom agents and business logic in plain JavaScript.
</Card>
</Cards>

All from a single, self-contained image.

## On being opinionated

When building OramaCore, we made a deliberate choice to create an opinionated system. We offer strong, general-purpose default configurations while still giving you the flexibility to customize them as needed.

There are plenty of great vector databases and full-text search engines out there. But most of them don't work seamlessly together out of the box—they often require extensive fine-tuning to arrive at a functional solution.

Our goal is to provide you with a platform that's ready to go the moment you pull a single Docker file.
7 changes: 7 additions & 0 deletions docs/lib/metadata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createMetadataImage } from 'fumadocs-core/server';
import { source } from '@/lib/source';

export const metadataImage = createMetadataImage({
imageRoute: '/docs-og',
source,
});
8 changes: 8 additions & 0 deletions docs/lib/source.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { docs, meta } from '@/.source';
import { createMDXSource } from 'fumadocs-mdx';
import { loader } from 'fumadocs-core/source';

export const source = loader({
baseUrl: '/docs',
source: createMDXSource(docs, meta),
});
10 changes: 10 additions & 0 deletions docs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { createMDX } from 'fumadocs-mdx/next';

const withMDX = createMDX();

/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
};

export default withMDX(config);
Loading
Loading