docs: reorganize documentation with i18n and Swagger API reference

- Add per-submodule docs structure (server-core, dashboard-ui, device-agent)
- Restructure VitePress with i18n support (Indonesian default + English)
- Add Swagger API reference pages with Swagger UI CDN embed
- Create merge.js script for combining sidebar manifests
- Integrate docs build into Docker (update.sh + nginx volume mount)
- Add documentation section to root README
This commit is contained in:
datadunia
2026-06-10 02:36:24 +07:00
parent 13e8787553
commit 60d326880a
11 changed files with 2735 additions and 20 deletions
+45 -17
View File
@@ -1,22 +1,50 @@
import { defineConfig } from 'vitepress'
// Sidebar manifests from submodules
import serverCoreSidebar from '../../server-core/docs/sidebar.json'
import dashboardSidebar from '../../dashboard-ui/docs/sidebar.json'
import agentSidebar from '../../device-agent/docs/sidebar.json'
export default defineConfig({
title: 'NexusGuard Docs',
description: 'Enterprise Zero-Trust SD-WAN Documentation',
title: 'NexusGuard',
description: 'Enterprise Zero-Trust SD-WAN Suite',
base: '/docs/',
cleanUrls: true,
themeConfig: {
sidebar: [
{
text: 'Guides',
items: [
{ text: 'Sign In', link: '/guides/sign-in' },
{ text: 'Access Remote Server', link: '/guides/access-remote-server' },
{ text: 'Add WireGuard Configuration', link: '/guides/add-wireguard-configuration' },
{ text: 'Peers', link: '/guides/peers' },
{ text: 'Email Service', link: '/guides/email-service' },
{ text: 'WebHooks', link: '/guides/webhooks' },
]
}
]
}
locales: {
root: {
label: 'Bahasa Indonesia',
lang: 'id',
themeConfig: {
sidebar: [
serverCoreSidebar,
dashboardSidebar,
agentSidebar,
],
nav: [
{ text: 'Beranda', link: '/' },
{ text: 'Panduan', link: '/guides/' },
{ text: 'API', link: '/api/' },
{ text: 'GitHub', link: 'https://git.datadunia.com/nexusguard/Nexus-Guard-Suite' },
],
},
},
en: {
label: 'English',
lang: 'en',
themeConfig: {
sidebar: [
serverCoreSidebar,
dashboardSidebar,
agentSidebar,
],
nav: [
{ text: 'Home', link: '/en/' },
{ text: 'Guides', link: '/en/guides/' },
{ text: 'API', link: '/en/api/' },
{ text: 'GitHub', link: 'https://git.datadunia.com/nexusguard/Nexus-Guard-Suite' },
],
},
},
},
})
+32
View File
@@ -0,0 +1,32 @@
# NexusGuard API Reference
This page provides interactive documentation for the NexusGuard Server Core API.
<div id="swagger-ui"></div>
<script setup>
import { onMounted } from 'vue'
onMounted(() => {
// Load Swagger UI from CDN
const script = document.createElement('script')
script.src = 'https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js'
script.onload = () => {
window.SwaggerUIBundle({
url: '/server-core/docs/swagger.json',
dom_id: '#swagger-ui',
presets: [
window.SwaggerUIBundle.presets.apis,
window.SwaggerUIBundle.SwaggerUIStandalonePreset
],
layout: 'BaseLayout'
})
}
document.head.appendChild(script)
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = 'https://unpkg.com/swagger-ui-dist@5/swagger-ui.css'
document.head.appendChild(link)
})
</script>
+31
View File
@@ -0,0 +1,31 @@
# Referensi API NexusGuard
Halaman ini menyediakan dokumentasi interaktif untuk API Server Core NexusGuard.
<div id="swagger-ui"></div>
<script setup>
import { onMounted } from 'vue'
onMounted(() => {
const script = document.createElement('script')
script.src = 'https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js'
script.onload = () => {
window.SwaggerUIBundle({
url: '/server-core/docs/swagger.json',
dom_id: '#swagger-ui',
presets: [
window.SwaggerUIBundle.presets.apis,
window.SwaggerUIBundle.SwaggerUIStandalonePreset
],
layout: 'BaseLayout'
})
}
document.head.appendChild(script)
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = 'https://unpkg.com/swagger-ui-dist@5/swagger-ui.css'
document.head.appendChild(link)
})
</script>
+26
View File
@@ -0,0 +1,26 @@
import { readFileSync } from 'node:fs';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const __dirname = dirname(fileURLToPath(import.meta.url));
const submodules = [
{ name: 'server-core', path: '../server-core/docs/sidebar.json' },
{ name: 'dashboard-ui', path: '../dashboard-ui/docs/sidebar.json' },
{ name: 'device-agent', path: '../device-agent/docs/sidebar.json' }
];
const sidebar = [];
for (const mod of submodules) {
const filePath = join(__dirname, mod.path);
try {
const content = JSON.parse(readFileSync(filePath, 'utf-8'));
sidebar.push(content);
console.error(`\u2713 Loaded ${mod.name}`);
} catch (e) {
console.error(`\u26A0 Skipping ${mod.name}: ${e.message}`);
}
}
console.log(JSON.stringify(sidebar, null, 2));
+2552
View File
File diff suppressed because it is too large Load Diff