refactor: improve docs structure

This commit is contained in:
0xSage 2023-10-26 11:34:47 +07:00
parent 3ee288f339
commit 66d26c0372
16 changed files with 41 additions and 29 deletions

View File

@ -1,13 +1,16 @@
---
sidebar_position: 1
title: Architecture
sidebar_position: 2
title: Anatomy of an app
---
## Jan overall architecture
## Jan Architecture
![Overall architecture](img/architecture-1.drawio.png)
- Jan platform includes the following components:
- Processes:
- UI process:
- UI process:
- This is Electron framework `renderer` component (Web technology equivalent)
- Jan provides core platform UI that:
- Allows App to `register()` function blueprint with name and arguments
@ -20,3 +23,18 @@ title: Architecture
- `@janhq/core` library that exposes Core API for App to reuse. Currently it only supports App `index.ts`
- Vertically, there are `Platform Core` component and `App` component. Each of those includes UI and Node process that work in pair.
##
Platform has 3 events that are broadcast to installed Apps
![Platform events](img/app-anatomy-4.drawio.png)
- onLaunch()
![Platform onLaunch()](img/app-anatomy-1.drawio.png)
- onStart()
![Platform onStart()](img/app-anatomy-2.drawio.png)
- onDispose()
![Platform onDispose()](img/app-anatomy-3.drawio.png)
- At any given time, when there is new App installtion/ unintallation, the Platform restarts and trigger
- When App is being used, here is how the information passes between Platform and Apps
![Communication](img/app-anatomy-5.drawio.png)

View File

@ -0,0 +1,6 @@
---
sidebar_position: 1
title: Build an app
---
TODO: quickstart tutorial

View File

@ -0,0 +1,6 @@
---
sidebar_position: 2
title: Development workflow
---
todo

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -1,5 +1,4 @@
---
sidebar_position: 2
title: Concepts
---

View File

@ -1,17 +0,0 @@
---
sidebar_position: 3
title: App Anatomy
---
Platform has 3 events that are broadcast to installed Apps
![Platform events](img/app-anatomy-4.drawio.png)
- onLaunch()
![Platform onLaunch()](img/app-anatomy-1.drawio.png)
- onStart()
![Platform onStart()](img/app-anatomy-2.drawio.png)
- onDispose()
![Platform onDispose()](img/app-anatomy-3.drawio.png)
- At any given time, when there is new App installtion/ unintallation, the Platform restarts and trigger
- When App is being used, here is how the information passes between Platform and Apps
![Communication](img/app-anatomy-5.drawio.png)

View File

@ -1,6 +1,6 @@
---
sidebar_position: 1
title: How to Build a Jan App
title: Building a chat app
---
TODO

View File

@ -1,6 +1,6 @@
---
sidebar_position: 2
title: How to Build RAG App
title: Building a RAG app
---
TODO

View File

@ -1,6 +1,6 @@
---
sidebar_position: 3
title: How to Publish a Jan App
title: Publishing a Jan app
---
TODO

View File

@ -117,7 +117,7 @@ const config = {
src: "img/logo.svg",
},
items: [
// Navbar Top
// Navbar left
// {
// type: "docSidebar",
// sidebarId: "featuresSidebar",
@ -135,7 +135,7 @@ const config = {
type: "docSidebar",
sidebarId: "guidesSidebar",
position: "right",
label: "Guides",
label: "User Guides",
},
{
type: "docSidebar",

View File

@ -49,13 +49,13 @@ const sidebars = {
devSidebar: [
{
type: "category",
label: "Overview",
label: "Getting Started",
collapsible: true,
collapsed: false,
items: [
{
type: "autogenerated",
dirName: "overview",
dirName: "getting-started",
},
],
},