Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ dist-ssr
*.sw?
doc_build

.nx/cache
.nx/workspace-data

.env

# Local Netlify folder
Expand All @@ -37,5 +34,3 @@ yarn.lock
package-lock.yaml

temp-search-index.json
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v22
v24
9 changes: 0 additions & 9 deletions CHANGELOG.md

This file was deleted.

93 changes: 81 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,91 @@
# Zephyr Cloud Docs
# Zephyr Documentation - Module Federation

Welcome to the Zephyr Cloud documentation repository.
This repository contains the Zephyr Cloud documentation implemented as a module federation architecture with multiple independent micro-frontend applications.

[![Netlify Status](https://api.netlify.com/api/v1/badges/a6a769b6-39a8-4a3b-84f4-d4b970f68c1f/deploy-status)](https://app.netlify.com/sites/zephyr-cloud-docs/deploys)
## Architecture

## Building docs
- **Host App** (`apps/host/`): Main documentation site running on port 3030
- **AI App** (`apps/ai/`): AI and machine learning documentation on port 3001
- **Cloud App** (`apps/cloud/`): Cloud deployment and infrastructure on port 3002
- **Mobile App** (`apps/mobile/`): Mobile development and React Native on port 3003
- **Sidepanel App** (`apps/sidepanel/`): Browser extension and tools on port 3004
- **Web App** (`apps/web/`): Web development and frontend guides on port 3005

Built using [Rspress](https://rspress.dev/).
Run:
## Getting Started

### Prerequisites

- Node.js 22.x
- pnpm 10.x

### Installation

1. Install dependencies for all applications:
```bash
pnpm install:all
```

2. Start all applications in development mode:
```bash
pnpm dev
```

3. Visit the host application at [http://localhost:3030](http://localhost:3030)

4. Navigate to `/apps` to see the module federation navigation page

### Individual App Commands

Start individual applications:
```bash
pnpm dev:host # Host app on port 3030
pnpm dev:ai # AI docs on port 3001
pnpm dev:cloud # Cloud docs on port 3002
pnpm dev:mobile # Mobile docs on port 3003
pnpm dev:sidepanel # Sidepanel docs on port 3004
pnpm dev:web # Web docs on port 3005
```

Build individual applications:
```bash
pnpm build:host
pnpm build:ai
pnpm build:cloud
pnpm build:mobile
pnpm build:sidepanel
pnpm build:web
```

### Build All

Build all applications:
```bash
pnpm install
pnpm build
```

## Sitemap Note
Because sitemap is not visible to the bundler (for now). We need to manually update
the site map file in the root of the repo when adding pages.
## Module Federation Configuration

Each remote application exposes:
- `./App`: Main documentation index
- `./Guide`: Guide section

The host application consumes all remote applications and provides a unified navigation experience.

## Development Workflow

1. Each app can be developed independently
2. Changes are reflected immediately with hot reload
3. The host app provides navigation between all documentation sections
4. Each app maintains its own dependencies and can use different RSPress versions if needed

## Technology Stack

- **RSPress**: Documentation framework
- **Module Federation**: Micro-frontend architecture
- **React**: UI framework
- **TypeScript**: Type safety
- **Tailwind CSS**: Styling (in host app)

## Deployment

## Contributors
![Alt](https://repobeats.axiom.co/api/embed/fd0de09aa25d444bf55d21d43902d7c71f4e69d2.svg "Repobeats analytics image")
Each application can be deployed independently to different domains or the same domain with different paths. Update the `remotes` configuration in the host app's module federation config to point to the deployed URLs.
14 changes: 14 additions & 0 deletions apps/ai/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Local
.DS_Store
*.local
*.log*

# Dist
node_modules
dist/
doc_build/

# IDE
.vscode/*
!.vscode/extensions.json
.idea
4 changes: 4 additions & 0 deletions apps/ai/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Lock files
package-lock.json
pnpm-lock.yaml
yarn.lock
3 changes: 3 additions & 0 deletions apps/ai/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
29 changes: 29 additions & 0 deletions apps/ai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Rspress website

## Setup

Install the dependencies:

```bash
npm install
```

## Get started

Start the dev server:

```bash
npm run dev
```

Build the website for production:

```bash
npm run build
```

Preview the production build locally:

```bash
npm run preview
```
11 changes: 11 additions & 0 deletions apps/ai/docs/_nav.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"text": "Hello world",
"link": "/hello/",
"activeMatch": "/hello/"
},
{
"text": "API",
"link": "https://rspress.rs/api/index.html"
}
]
5 changes: 5 additions & 0 deletions apps/ai/docs/hello.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Hello world!

## Start

Write something to build your own docs! 🎁
7 changes: 7 additions & 0 deletions apps/ai/docs/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
pageType: custom
navbar: false
sidebar: false
outline: false
lastUpdated: false
---
Binary file added apps/ai/docs/public/rspress-dark-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/ai/docs/public/rspress-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/ai/docs/public/rspress-light-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions apps/ai/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import js from '@eslint/js';
import globals from 'globals';
import ts from 'typescript-eslint';

export default [
{ languageOptions: { globals: globals.browser } },
js.configs.recommended,
...ts.configs.recommended,
{ ignores: ['dist/'] },
];
10 changes: 10 additions & 0 deletions apps/ai/module-federation.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { createModuleFederationConfig } from '@module-federation/rspress-plugin';

export default createModuleFederationConfig({
filename: 'remoteEntry.js',
name: 'ai_docs',
exposes: {
'./intro': './docs/index.mdx',
'./hello': './docs/hello.mdx',
},
});
25 changes: 25 additions & 0 deletions apps/ai/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "ai",
"version": "1.0.0",
"private": true,
"scripts": {
"build": "rspress build",
"dev": "rspress dev --port 3001",
"format": "prettier --write .",
"lint": "eslint .",
"preview": "rspress preview"
},
"dependencies": {
"@module-federation/rspress-plugin": "^0.18.3",
"@rspress/core": "2.0.0-beta.31",
"@zephyr-docs/shared": "workspace:*"
},
"devDependencies": {
"@eslint/js": "^9.32.0",
"@types/node": "^22.8.1",
"eslint": "^9.32.0",
"globals": "^16.3.0",
"prettier": "^3.6.2",
"typescript-eslint": "^8.38.0"
}
}
30 changes: 30 additions & 0 deletions apps/ai/rspress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import * as path from 'node:path';
import { defineConfig } from '@rspress/core';
import { pluginModuleFederation } from '@module-federation/rspress-plugin';
import mfConfig from './module-federation.config';

export default defineConfig({
root: path.join(__dirname, 'docs'),
title: 'AI Documentation',
icon: '/rspress-icon.png',
// base: '/ai/',
logo: {
light: '/rspress-light-logo.png',
dark: '/rspress-dark-logo.png',
},
builderConfig: {
output: {
assetPrefix: 'https://docs.zephyr-cloud.io/ai',
},
},
themeConfig: {
socialLinks: [
{
icon: 'github',
mode: 'link',
content: 'https://github.com/web-infra-dev/rspress',
},
],
},
plugins: [pluginModuleFederation(mfConfig)],
});
20 changes: 20 additions & 0 deletions apps/ai/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "ES2020",
"lib": ["DOM", "ES2020"],
"module": "ESNext",
"jsx": "react-jsx",
"strict": true,
"skipLibCheck": true,
"isolatedModules": true,
"resolveJsonModule": true,
"moduleResolution": "bundler",
"useDefineForClassFields": true,
"allowImportingTsExtensions": true,
"composite": true
},
"include": ["docs", "theme", "rspress.config.ts"],
"mdx": {
"checkMdx": true
}
}
14 changes: 14 additions & 0 deletions apps/cloud/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Local
.DS_Store
*.local
*.log*

# Dist
node_modules
dist/
doc_build/

# IDE
.vscode/*
!.vscode/extensions.json
.idea
4 changes: 4 additions & 0 deletions apps/cloud/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Lock files
package-lock.json
pnpm-lock.yaml
yarn.lock
3 changes: 3 additions & 0 deletions apps/cloud/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
29 changes: 29 additions & 0 deletions apps/cloud/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Rspress website

## Setup

Install the dependencies:

```bash
npm install
```

## Get started

Start the dev server:

```bash
npm run dev
```

Build the website for production:

```bash
npm run build
```

Preview the production build locally:

```bash
npm run preview
```
Loading