Move docs to docusaurus site

This commit is contained in:
Takeshi Kimata
2024-05-12 13:59:35 +09:00
parent af7cdb790e
commit 2b3dec3c12
17 changed files with 120 additions and 245 deletions

View File

@@ -1,8 +1,4 @@
{ {
"label": "Architecuture", "label": "Architecuture",
"position": 2, "position": 3
"link": {
"type": "generated-index",
"description": "Architecuture"
}
} }

View File

@@ -0,0 +1,4 @@
{
"label": "Get started",
"position": 2
}

View File

@@ -0,0 +1,7 @@
---
sidebar_position: 2
---
# Running TestPlat as a Docker container
##

View File

@@ -0,0 +1,55 @@
---
sidebar_position: 3
---
# Running TestPlat manually
:::info[Prerequisite]
Prerequisite: v20 or higher node must be installed.
:::
To use TestPlat, you need run frontend server and backend server (API server).
First, clone the repository.
```bash
git clone git@github.com:kimatata/TestPlat.git
```
## Run backend server
Moves to backend directory, then install dependencies.
```bash
cd backend
npm ci
```
Initialize the database with the following command.
```bash
npm run migrate
```
Start backend server.
```bash
node index
```
## Run frontend server
Moves to frontend directory, then install dependencies.
```bash
cd frontend
npm ci
```
Start frontend server
```bash
rpm run dev
```

View File

@@ -0,0 +1,10 @@
---
sidebar_position: 1
---
# Self hosting
TestPlat is designed for self-hosted use. There are two ways to self-host the application: “Manual” and “Docker”.
- Docker (Recommended)
- Manual

View File

@@ -8,12 +8,12 @@ import {themes as prismThemes} from 'prism-react-renderer';
/** @type {import('@docusaurus/types').Config} */ /** @type {import('@docusaurus/types').Config} */
const config = { const config = {
title: 'TestPlat Document', title: 'TestPlat',
// tagline: 'Dinosaurs are cool', // tagline: 'Dinosaurs are cool',
favicon: 'img/favicon.ico', favicon: 'img/favicon.ico',
// Set the production url of your site here // Set the production url of your site here
url: 'https://your-docusaurus-site.example.com', url: 'https://kimatata.github.io',
// Set the /<baseUrl>/ pathname under which your site is served // Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/' // For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/TestPlat/', baseUrl: '/TestPlat/',
@@ -30,8 +30,8 @@ const config = {
// useful metadata like html lang. For example, if your site is Chinese, you // useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans". // may want to replace "en" with "zh-Hans".
i18n: { i18n: {
defaultLocale: 'ja', defaultLocale: 'en',
locales: ['ja'], locales: ['en'],
}, },
presets: [ presets: [
@@ -59,57 +59,17 @@ const config = {
// Replace with your project's social card // Replace with your project's social card
image: 'img/docusaurus-social-card.jpg', image: 'img/docusaurus-social-card.jpg',
navbar: { navbar: {
title: 'TestPlat Docs', title: 'TestPlat',
// logo: { logo: {
// alt: 'TestPlat Logo', alt: 'TestPlat Logo',
// src: 'img/logo.svg', src: 'img/android-chrome-192x192.png',
// },
items: [
// {
// type: 'docSidebar',
// sidebarId: 'tutorialSidebar',
// position: 'left',
// label: 'Tutorial',
// },
{to: '/docs', label: 'Docs', position: 'left'},
// {to: '/blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/facebook/docusaurus',
label: 'GitHub',
position: 'right',
}, },
items: [
{to: '/docs', label: 'Docs', position: 'left'},
], ],
}, },
footer: { footer: {
style: 'dark', style: 'dark',
links: [
// {
// title: 'Docs',
// items: [
// {
// label: 'Tutorial',
// to: '/docs/intro',
// },
// ],
// },
// {
// title: 'Community',
// items: [
// {
// label: 'Stack Overflow',
// href: 'https://stackoverflow.com/questions/tagged/docusaurus',
// },
// {
// label: 'Discord',
// href: 'https://discordapp.com/invite/docusaurus',
// },
// {
// label: 'Twitter',
// href: 'https://twitter.com/docusaurus',
// },
// ],
// },
],
copyright: `Copyright © ${new Date().getFullYear()} TestPlat. Built with Docusaurus.`, copyright: `Copyright © ${new Date().getFullYear()} TestPlat. Built with Docusaurus.`,
}, },
prism: { prism: {

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,6 +1,7 @@
{ {
"Index": { "Index": {
"get_started": "Get Started", "get_started": "Get Started",
"demo": "Demo",
"oss_tcmt": "Open Source Test Case Management", "oss_tcmt": "Open Source Test Case Management",
"web_application": "Web Application", "web_application": "Web Application",
"integrate_and_manage": "Integrate and manage all your software testing.", "integrate_and_manage": "Integrate and manage all your software testing.",
@@ -17,25 +18,10 @@
"case_home": "Dashboard", "case_home": "Dashboard",
"case_run": "Test Runs" "case_run": "Test Runs"
}, },
"Guide": {
"self_host": "Self Host",
"docker": "Docker",
"manual": "Manual",
"self_host_app": "Self host the application",
"run_as_docker": "Running TestPlat as a Docker container",
"run_by_manually": "Running TestPlat manually",
"move_to_back": "Moves to backend directory",
"backend_install": "Install dependencies",
"init_db": "Initialize Database",
"backend_start": "Start backend server",
"move_to_front": "Moves to frontend directory",
"front_install": "Install dependencies",
"front_start": "Start frontend server"
},
"Header": { "Header": {
"title": "Open Source Test Case Management Tool", "title": "Open Source Test Case Management Tool",
"description": "Integrate and manage all your software testing", "description": "Integrate and manage all your software testing",
"guide": "Guide", "docs": "Docs",
"projects": "Projects" "projects": "Projects"
}, },
"Projects": { "Projects": {

View File

@@ -1,6 +1,7 @@
{ {
"Index": { "Index": {
"get_started": "テスト管理を始める", "get_started": "テスト管理を始める",
"demo": "デモ",
"oss_tcmt": "オープンソーステストケース管理", "oss_tcmt": "オープンソーステストケース管理",
"web_application": "ウェブアプリケーション", "web_application": "ウェブアプリケーション",
"integrate_and_manage": "ソフトウェア開発にかかわるすべてのテストを統合管理", "integrate_and_manage": "ソフトウェア開発にかかわるすべてのテストを統合管理",
@@ -17,25 +18,10 @@
"case_home": "ダッシュボード", "case_home": "ダッシュボード",
"case_run": "テスト実行" "case_run": "テスト実行"
}, },
"Guide": {
"self_host": "セルフホスト",
"docker": "Docker",
"manual": "マニュアル",
"self_host_app": "アプリのセルフホスト",
"run_as_docker": "Docker containerによる実行",
"run_by_manually": "手動での実行",
"move_to_back": "backendディレクトリに遷移",
"backend_install": "依存関係をインストール",
"init_db": "データベースの初期化",
"backend_start": "バックエンドサーバーの起動",
"move_to_front": "frontendディレクトリに遷移",
"front_install": "依存関係をインストール",
"front_start": "フロントエンドサーバーの起動"
},
"Header": { "Header": {
"title": "オープンソーステストケース管理ツール", "title": "オープンソーステストケース管理ツール",
"description": "ソフトウェア開発にかかわるすべてのテストを統合管理", "description": "ソフトウェア開発にかかわるすべてのテストを統合管理",
"guide": "ガイド", "docs": "ドキュメント",
"projects": "プロジェクト" "projects": "プロジェクト"
}, },
"Projects": { "Projects": {

View File

@@ -6,12 +6,12 @@ import {
Chip, Chip,
Link as NextUiLink, Link as NextUiLink,
} from "@nextui-org/react"; } from "@nextui-org/react";
import { MoveUpRight } from "lucide-react";
import { useTranslations } from "next-intl"; import { useTranslations } from "next-intl";
import { Link } from "@/src/navigation"; import { Link } from "@/src/navigation";
import LangSwitch from "./LangSwitch"; import LangSwitch from "./LangSwitch";
import { ThemeSwitch } from "@/components/theme-switch"; import { ThemeSwitch } from "@/components/theme-switch";
import { GithubIcon } from "@/components/icons"; import { GithubIcon } from "@/components/icons";
import Image from "next/image"; import Image from "next/image";
export default function Header(params: { locale: string }) { export default function Header(params: { locale: string }) {
@@ -46,15 +46,6 @@ export default function Header(params: { locale: string }) {
</Link> </Link>
</Chip> </Chip>
</NavbarItem> </NavbarItem>
<NavbarItem className="hidden sm:block">
<Link
className="data-[active=true]:text-primary data-[active=true]:font-medium"
href="/guide/selfhost"
locale={params.locale}
>
{t("guide")}
</Link>
</NavbarItem>
<NavbarItem className="hidden sm:block"> <NavbarItem className="hidden sm:block">
<Link <Link
className="data-[active=true]:text-primary data-[active=true]:font-medium" className="data-[active=true]:text-primary data-[active=true]:font-medium"
@@ -64,6 +55,17 @@ export default function Header(params: { locale: string }) {
{t("projects")} {t("projects")}
</Link> </Link>
</NavbarItem> </NavbarItem>
<NavbarItem className="hidden sm:block">
<NextUiLink
isExternal
href="https://kimatata.github.io/TestPlat/docs/selfhost"
aria-label="docs"
showAnchorIcon
anchorIcon={<MoveUpRight size={12} className="ms-1" />}
>
{t("docs")}
</NextUiLink>
</NavbarItem>
</NavbarContent> </NavbarContent>
<NavbarContent className="basis-1 pl-4" justify="end"> <NavbarContent className="basis-1 pl-4" justify="end">

View File

@@ -1,6 +1,5 @@
import { title, subtitle } from "@/components/primitives"; import { title, subtitle } from "@/components/primitives";
import { Button, Link as NextUiLink } from "@nextui-org/react"; import { Button, Link as NextUiLink } from "@nextui-org/react";
import { ExternalLink } from "lucide-react";
import { Link } from "@/src/navigation"; import { Link } from "@/src/navigation";
import { useTranslations } from "next-intl"; import { useTranslations } from "next-intl";
@@ -38,27 +37,32 @@ export default function MainTitle({ locale }: Props) {
<div className="mt-5"> <div className="mt-5">
<Button color="primary" radius="full"> <Button color="primary" radius="full">
<Link href={`/guide/selfhost`} locale={locale}> <NextUiLink
isExternal
href="https://kimatata.github.io/TestPlat/docs/selfhost"
aria-label="docs"
className="text-white"
>
{t("get_started")} {t("get_started")}
</NextUiLink>
</Button>
<Button color="primary" radius="full" className="ms-2">
<Link href={`/projects/`} locale={locale}>
{t("demo")}
</Link> </Link>
</Button> </Button>
<Button <Button color="primary" radius="full" className="ms-2">
color="primary"
radius="full"
variant="bordered"
className="ms-3"
>
<Link href={`/projects/`} locale={locale}>
GitHub
</Link>
<NextUiLink <NextUiLink
size="sm"
isExternal isExternal
href="https://github.com/kimatata/TestPlat" href="https://github.com/kimatata/TestPlat"
aria-label="Github" aria-label="Github"
showAnchorIcon className="text-white"
anchorIcon={<ExternalLink size={16} />} >
></NextUiLink> GitHub
</NextUiLink>
</Button> </Button>
</div> </div>
</div> </div>

View File

@@ -1,39 +0,0 @@
import { useTranslations } from "next-intl";
import { Link, NextUiLinkClasses } from "@/src/navigation";
export type Props = {
locale: string;
};
export default function Guidebar({ locale }: Props) {
const t = useTranslations("Guide");
const links = [
{
name: t("self_host"),
href: "/guide/selfhost",
indent: false,
},
{
name: t("docker"),
href: "/guide/selfhost/docker",
indent: true,
},
{
name: t("manual"),
href: "/guide/selfhost/manual",
indent: true,
},
];
return (
<div className="w-64 border-r-1 ps-6 pt-6 dark:border-neutral-700">
{links.map((link) => (
<div key={link.name} className={`py-1 ${link.indent ? "ps-4" : ""}`}>
<Link href={link.href} locale={locale} className={NextUiLinkClasses}>
{link.name}
</Link>
</div>
))}
</div>
);
}

View File

@@ -1,18 +0,0 @@
import Guidebar from "./GuideBar";
export default function GuideLayout({
children,
params: { locale },
}: {
children: React.ReactNode;
params: { locale: string };
}) {
return (
<div className="flex border-t-1 dark:border-neutral-700 min-h-[calc(100vh-64px)]">
<Guidebar locale={locale} />
<div className="flex w-full">
<div className="flex-grow px-12">{children}</div>
</div>
</div>
);
}

View File

@@ -1,13 +0,0 @@
import { useTranslations } from "next-intl";
import { title } from "@/components/primitives";
import { Snippet, Card, CardBody } from "@nextui-org/react";
export default function Page() {
const t = useTranslations("Guide");
return (
<section className="mx-auto max-w-screen-xl my-12">
<h1 className={title({ size: "sm" })}>{t("run_as_docker")}</h1>
</section>
);
}

View File

@@ -1,53 +0,0 @@
import { useTranslations } from "next-intl";
import { title } from "@/components/primitives";
import { Snippet } from "@nextui-org/react";
export default function Page() {
const t = useTranslations("Guide");
const manualProcedures = [
{
uid: "clone",
detail: "",
code: "git clone git@github.com:kimatata/TestPlat.git",
},
{
uid: "move-to-backend",
detail: t("move_to_back"),
code: "cd backend",
},
{
uid: "backend-install",
detail: t("backend_install"),
code: "npm install",
},
{ uid: "init-db", detail: t("init_db"), code: "npm run migrate" },
{ uid: "backend_start", detail: t("front_start"), code: "node index" },
{
uid: "move-to-frontend",
detail: t("move_to_front"),
code: "cd frontend",
},
{
uid: "front-install",
detail: t("frontend_install"),
code: "npm install",
},
{ uid: "front-start", detail: t("front_start"), code: "npm run start" },
];
return (
<section className="mx-auto max-w-screen-xl my-12">
<h1 className={title({ size: "sm" })}>{t("run_by_manually")}</h1>
<div className="mt-3">
{manualProcedures.map((procedure, index) => (
<div key={procedure.uid} className={`${index !== 0 ? "mt-3" : ""}`}>
<p>{procedure.detail}</p>
<Snippet variant="solid" color="primary" style={{ width: "32rem" }}>
{procedure.code}
</Snippet>
</div>
))}
</div>
</section>
);
}

View File

@@ -1,12 +0,0 @@
import { useTranslations } from "next-intl";
import { title } from "@/components/primitives";
export default function Page() {
const t = useTranslations("Guide");
return (
<section className="mx-auto max-w-screen-xl my-12">
<h1 className={title({ size: "sm" })}>{t("self_host")}</h1>
</section>
);
}