Skip to content

Commit a929764

Browse files
start working on how markdown should look
1 parent 8059ce3 commit a929764

13 files changed

Lines changed: 821 additions & 16 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import yaml from "js-yaml"
2+
import { marked } from "marked"
3+
4+
export interface Doc {
5+
title: string
6+
icon: string
7+
file: string
8+
path: string
9+
content: string
10+
md: {
11+
html: string
12+
tableOfContent: []
13+
}
14+
}
15+
16+
export const useDocs = createGlobalState(() => {
17+
return useAsyncState(async () => {
18+
const res = await fetch("/docs/docs.yaml")
19+
const data = await res.text()
20+
const docs = yaml.load(data) as Doc[]
21+
const contents = await Promise.all(
22+
docs
23+
.map(doc => fetch(`/docs/${doc.file}`)
24+
.then(res => res.text())),
25+
)
26+
27+
marked.use({
28+
renderer: {
29+
blockquote({ tokens }) {
30+
const text = this.parser.parse(tokens)
31+
return `<blockquote class="d-block px-4 py-6 border-s-lg border-primary bg-surface mb-4 overflow-auto" style="--v-border-opacity: 1;">${text}</blockquote>`
32+
},
33+
},
34+
})
35+
return docs.map((doc, index) => {
36+
const content = contents[index] ?? ""
37+
return {
38+
...doc,
39+
content,
40+
md: {
41+
html: marked.parse(content),
42+
tableOfContent: [],
43+
},
44+
}
45+
})
46+
}, [])
47+
})

frontend/kubecloud-v2/global.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ declare global {
1313
VANTA?: {
1414
DOTS?: (options: Record<string, any>) => void
1515
GLOBE?: (options: Record<string, any>) => void
16-
BIRDS?: (options: Record<string, any>) => void
17-
HALO?: (options: Record<string, any>) => void
1816
}
1917
}
2018
}

frontend/kubecloud-v2/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@
2222
"async-await-mutex-lock": "^1.0.12",
2323
"axios": "^1.13.2",
2424
"izitoast": "^1.4.0",
25+
"js-yaml": "^4.1.1",
26+
"marked": "^17.0.1",
2527
"nuxt": "^4.2.2",
2628
"nuxt-toast": "^1.4.0",
2729
"quill": "^2.0.3",
30+
"three": "^0.182.0",
2831
"validator": "^13.15.26",
2932
"vue": "^3.5.25",
3033
"vue-router": "^4.6.3",
@@ -35,7 +38,9 @@
3538
"@nuxt/eslint": "1.12.1",
3639
"@nuxt/hints": "^1.0.0-alpha.5",
3740
"@openapitools/openapi-generator-cli": "^2.25.2",
41+
"@types/js-yaml": "^4.0.9",
3842
"@types/node": "^25.0.2",
43+
"@types/three": "^0.182.0",
3944
"@types/validator": "^13.15.10",
4045
"eslint": "^9.0.0",
4146
"lint-staged": "^16.2.7",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<template>
2+
<div>Docs Getting Started</div>
3+
</template>
File renamed without changes.
Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,76 @@
11
<template>
2-
<StickySidebarLayout :cols="9">
3-
<template #items>
4-
<v-list-item link exact title="Getting Started" :to="ROUTES.Docs()" />
5-
<v-list-item link exact title="Tutorials" :to="ROUTES.Docs.Tutorials()" />
2+
<StickySidebarLayout :cols="9" :sidebar-width="300">
3+
<template #sidebar>
4+
<VCard :style="{ padding: '16px !important' }">
5+
<v-list>
6+
<v-list-item class="text-body-1 text-accent font-weight-bold">
7+
Documentation
8+
</v-list-item>
9+
10+
<v-list-item
11+
v-for="doc in docs"
12+
:key="doc.path"
13+
:prepend-icon="doc.icon"
14+
link
15+
exact
16+
:title="doc.title"
17+
:to="ROUTES.Docs(doc.path)"
18+
class="text-accent"
19+
/>
20+
21+
<div class="mt-4" />
22+
23+
<v-list-item class="text-body-1 text-accent font-weight-bold">
24+
Table of Contents
25+
</v-list-item>
26+
27+
<v-list-item
28+
v-for="doc in docs"
29+
:key="doc.path"
30+
link
31+
exact
32+
density="compact"
33+
class="text-body-2"
34+
>
35+
{{ doc.title }}
36+
</v-list-item>
37+
</v-list>
38+
<!-- :to="ROUTES.Docs(doc.path)" -->
39+
</VCard>
640
</template>
741

8-
<NuxtPage />
9-
<div :style="{ height: '2000px' }" />
10-
<NuxtPage />
42+
<!-- x {{ route.path }}
43+
{{ isLoading }}
44+
{{ docs.map(doc => doc.content) }} -->
45+
<NuxtPage :page="activePage" />
46+
<!-- <div :style="{ height: '2000px' }" />
47+
<NuxtPage /> -->
1148
</StickySidebarLayout>
1249
</template>
1350

1451
<script setup lang="ts">
1552
definePageMeta({ middleware: "public" })
53+
54+
const route = useRoute()
55+
const { state: docs } = useDocs()
56+
57+
const activePage = computed(() => {
58+
let activePath = route.path
59+
if (activePath.endsWith("/")) {
60+
activePath = activePath.slice(0, -1)
61+
}
62+
activePath = activePath.replace(ROUTES.Docs(), "")
63+
64+
return docs.value.find(doc => doc.path === activePath)
65+
})
1666
</script>
67+
68+
<style lang="scss">
69+
.v-list-item--active {
70+
color: white !important;
71+
72+
i {
73+
color: rgb(var(--v-theme-primary)) !important
74+
}
75+
}
76+
</style>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template>
2+
<div v-html="page?.md?.html" />
3+
</template>
4+
5+
<script setup lang="ts">
6+
defineProps<{ page: Doc }>()
7+
</script>
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
<template>
2-
<div>Docs Getting Started</div>
2+
<!-- <div>
3+
{{ page }}
4+
</div> -->
5+
6+
<div v-html="page?.md?.html" />
37
</template>
8+
9+
<script setup lang="ts">
10+
defineProps<{ page: Doc }>()
11+
</script>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
- title: Getting Started
2+
icon: mdi-rocket-launch
3+
path: ""
4+
file: getting-started.md
5+
6+
- title: Tutorials
7+
icon: mdi-book-open-page-variant
8+
path: /tutorials
9+
file: tutorial.md
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Getting Started with Mycelium Cloud
2+
3+
Welcome to Mycelium Cloud, a comprehensive platform for deploying and managing Kubernetes clusters on the decentralized ThreeFold Grid infrastructure.
4+
5+
## Overview
6+
7+
Mycelium Cloud provides a complete solution for cloud-native applications with:
8+
9+
- **Decentralized Infrastructure**: Deploy on ThreeFold Grid's distributed network
10+
- **Kubernetes Management**: Full K3s cluster deployment and management
11+
- **IPv6 Networking**: Mycelium peer-to-peer networking
12+
- **High Availability**: Multi-master cluster support
13+
14+
## Architecture
15+
16+
Mycelium Cloud uses peer-to-peer networking that enables:
17+
18+
- **Direct Node Access**: Each node gets a unique Mycelium IP address
19+
- **Cross-Node Communication**: Services communicate across nodes using Mycelium networking
20+
- **Secure Communication**: All traffic is encrypted through the Mycelium network
21+
- **No Public IPs Required**: Services accessible via Mycelium IPs
22+
23+
**Network Flow**: `User Machine → Mycelium Network → Cluster Node → Service`
24+
25+
## Quick Start
26+
27+
### 1. Account Setup
28+
29+
1. **Sign Up**: Create your account from signup page
30+
2. **Verify Email**: Check your email and verify your account
31+
3. **Add Funds**: Navigate to your dashboard and add credits to your account
32+
4. **Add SSH Key**: Navigate to Add SSH card and upload your public SSH key
33+
34+
### 2. Deploy Your First Cluster
35+
36+
1. **Access Deploy**: Click "Deploy Cluster" from your dashboard
37+
2. **Configure VMs**: Define your virtual machines:
38+
- Choose CPU, memory, and storage requirements
39+
- Select the number of master and worker nodes
40+
3. **Select Nodes**: Choose ThreeFold Grid nodes for deployment
41+
4. **Review & Deploy**: Confirm your configuration and deploy
42+
43+
### 3. Access Your Cluster
44+
45+
#### Download Kubeconfig
46+
47+
1. Go to dashboard → Clusters → Click download icon (⬇️)
48+
2. Set kubeconfig: `export KUBECONFIG=/path/to/config`
49+
3. Test: `kubectl get nodes`
50+
51+
#### SSH Access
52+
53+
1. **Find Mycelium IPs**: Check cluster details page for node IPs
54+
2. **Download Mycelium Binary**:
55+
56+
```bash
57+
wget https://github.com/threefoldtech/mycelium/releases/latest/download/mycelium-private-x86_64-unknown-linux-musl.tar.gz
58+
tar -xzf mycelium-private-x86_64-unknown-linux-musl.tar.gz
59+
sudo chmod +x mycelium-private
60+
sudo mv mycelium-private /usr/local/bin/mycelium
61+
```
62+
63+
3. **Start Mycelium**:
64+
65+
```bash
66+
sudo mycelium --peers tcp://188.40.132.242:9651 tcp://136.243.47.186:9651 tcp://185.69.166.7:9651 tcp://185.69.166.8:9651 tcp://65.21.231.58:9651 tcp://65.109.18.113:9651 tcp://209.159.146.190:9651 tcp://5.78.122.16:9651 tcp://5.223.43.251:9651 tcp://142.93.217.194:9651
67+
```
68+
69+
4. **SSH to nodes**: `ssh root@<mycelium-ip>`

0 commit comments

Comments
 (0)