Skip to content
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
43 changes: 25 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
.idea/
projects/*
!projects/docs-landing-page/
tmp/
content/*
!content/code0
!content/meta.json

# build output
dist/
# generated types
.astro/
# deps
/node_modules

# dependencies
node_modules/
# generated content
.contentlayer
.content-collections
/.source

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

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


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
# others
.env*.local
.vercel
next-env.d.ts
14 changes: 1 addition & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,12 @@
script:
- npm ci
- ./clone_projects.sh
- ./build.sh
- npm run build

build:
extends:
- .build
stage: build
variables:
C0_GLOBAL_BASE: /-/development/telescopium/-/jobs/$CI_JOB_ID/artifacts/dist
after_script:
- node scripts/local_link_suffixer.js
- |
echo -e "\e[0Ksection_start:`date +%s`:glpa_summary\r\e[0KHeader of the summary"
echo "Documentation preview available at https://code0-tech.gitlab.io${C0_GLOBAL_BASE}/index.html"
echo -e "\e[0Ksection_end:`date +%s`:glpa_summary\r\e[0K"
artifacts:
paths:
- dist
expire_in: 7 days
rules:
- if: ($CI_COMMIT_BRANCH != "build-branch" || $C0_TRIGGER_REF != "refs/heads/main") && $C0_TRIGGER_REF != "refs/heads/main"

Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 20.16.0
nodejs 22
4 changes: 0 additions & 4 deletions .vscode/extensions.json

This file was deleted.

11 changes: 0 additions & 11 deletions .vscode/launch.json

This file was deleted.

14 changes: 14 additions & 0 deletions app/(home)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type {ReactNode} from 'react';

export default function Layout({children}: { children: ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>
<head>
<meta httpEquiv={"refresh"} content={"0; URL=code0"}/>
</head>
<body>
{children}
</body>
</html>
);
}
3 changes: 3 additions & 0 deletions app/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function HomePage() {
return <span/>;
}
29 changes: 29 additions & 0 deletions app/[...slug]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import '../global.css';
import {RootProvider} from 'fumadocs-ui/provider';
import {Inter} from 'next/font/google';
import type {ReactNode} from 'react';
import {source} from "@/lib/source";
import {baseOptions} from "@/app/layout.config";
import {DocsLayout} from "fumadocs-ui/layouts/docs";

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 search={{
options: {
type: 'static',
},
}}>
<DocsLayout tree={source.pageTree} {...baseOptions}>
{children}
</DocsLayout>
</RootProvider>
</body>
</html>
);
}
71 changes: 71 additions & 0 deletions app/[...slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import {source} from '@/lib/source';
import {
DocsPage,
DocsBody,
DocsDescription,
DocsTitle,
} from 'fumadocs-ui/page';
import {notFound} from 'next/navigation';
import {createRelativeLink} from 'fumadocs-ui/mdx';
import {getMDXComponents} from '@/mdx-components';
import type {LoaderConfig, LoaderOutput, Page} from 'fumadocs-core/source';
import type {ComponentProps, FC} from 'react';

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 MDXContent = page.data.body;

return (
<DocsPage toc={page.data.toc} full={page.data.full} tableOfContent={{
style: 'clerk',
single: false,
}}>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDXContent
components={getMDXComponents({
// this allows you to link to other pages with relative file paths
a: createRelativeLinkWithFilenameOnly(source, page),
})}
/>
</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 {
title: page.data.title,
description: page.data.description,
};
}

function createRelativeLinkWithFilenameOnly(
source: LoaderOutput<LoaderConfig>,
page: Page,
): FC<ComponentProps<'a'>> {
return async function RelativeLink({href, ...props}) {
const relativeLink = createRelativeLink(source, page)
// support filename-only links
if (href && (!href.startsWith('http') && href.endsWith('.md'))) {
return relativeLink({href: `./${href}`, ...props});
}
return relativeLink({href, ...props});
};
}
6 changes: 6 additions & 0 deletions app/api/search/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {source} from '@/lib/source';
import {createFromSource} from 'fumadocs-core/search/server';

export const revalidate = false;

export const {staticGET: GET} = createFromSource(source);
5 changes: 5 additions & 0 deletions app/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';

@source '../node_modules/fumadocs-ui/dist/**/*.js';
20 changes: 20 additions & 0 deletions app/layout.config.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type {BaseLayoutProps} from 'fumadocs-ui/layouts/shared';

/**
* Shared layout configurations
*
* you can customise layouts individually from:
* Home Layout: app/(home)/layout.tsx
* Docs Layout: app/docs/layout.tsx
*/
export const baseOptions: BaseLayoutProps = {
nav: {
title: (
<>
<img src={"/code0_logo.png"} alt={"Code0 Logo"} width={24}/>
Code0
</>
),
},
links: [],
};
38 changes: 0 additions & 38 deletions astro.config.mjs

This file was deleted.

31 changes: 0 additions & 31 deletions build.sh

This file was deleted.

5 changes: 3 additions & 2 deletions clone_projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ set -eo pipefail
shopt -s extglob
shopt -s dotglob

cd projects
rm -rf -- !(docs-landing-page)
cd content

for project in $(cat ../documentation_repositories.txt); do
git clone ${project}.git
Expand All @@ -21,6 +20,8 @@ for project in $(cat ../documentation_repositories.txt); do

rm -rf -- !(docs)
rm -rf .git
mv docs/* .
rm -rf docs
cd ..
done
cd ..
27 changes: 27 additions & 0 deletions content/code0/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: ""
---

<div className={"flex"}>
<div>
<h2 style={{fontSize: '48px'}} className={"mt-0"}>Welcome to the Code0 Documentation</h2>
<span style={{fontSize: '20px'}}>Build powerful backends without writing code!</span>

<div>
<Card
style={{display: 'inline-block'}}
className="mt-4"
href="https://github.com/code0-tech/"
title={"Visit our GitHub"}
/>
</div>
</div>

<img src={"/code0_logo.png"} alt={"Code0 Logo"} width={400} className={"mt-0"}/>
</div>

## About Code0 [!toc]

Code0 is a no-code backend creator, revolutionizing backend development by enabling users to build backends without
programming skills. Our platform simplifies backend creation with a node-based editor, allowing you to design event
flows, RESTful APIs, event-driven systems and more effortlessly.
5 changes: 5 additions & 0 deletions content/code0/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"title": "Code0",
"root": true,
"pages": []
}
7 changes: 7 additions & 0 deletions content/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"pages": [
"code0",
"sagittarius",
"aquila"
]
}
Loading