Skip to content

Commit d04cfd8

Browse files
committed
feat: enhance documentation structure and add CLI tool for translation
1 parent d0f58f9 commit d04cfd8

5 files changed

Lines changed: 123 additions & 52 deletions

File tree

‎README.md‎

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,64 @@
1-
# docs
1+
# ObjectStack Documentation
22

3-
A multi-language documentation site built with Fumadocs, supporting English and Chinese.
3+
The official documentation for ObjectStack, built with Next.js (App Router) and [Fumadocs](https://fumadocs.vercel.app).
4+
5+
## Project Structure
6+
7+
This repository contains the documentation for:
8+
- **ObjectStack Platform**: The core development platform.
9+
- **ObjectQL**: The backend data protocol engine.
10+
- **ObjectUI**: The declarative UI engine.
11+
- **ObjectOS**: The runtime operating system.
412

513
## Features
614

7-
- 🌍 **Multi-language Support**: Full internationalization with English (en) and Chinese (zh-CN)
8-
- 📝 **MDX Content**: Write documentation using MDX for interactive content
9-
- 🔍 **Fast Search**: Quick search across all documentation
10-
- 🎨 **Modern UI**: Beautiful and responsive design with Fumadocs UI
11-
- 📱 **Mobile Friendly**: Fully responsive on all devices
15+
- 🌍 **Multi-language Support**:
16+
- Source: English (`content/docs`)
17+
- Target: Chinese (`content/docs-zh-CN`) - *Auto-translated via AI*
18+
- 📝 **MDX Content**: Interactive documentation with Type-safe components.
19+
- 🛠️ **Automated Workflows**:
20+
- AI Translation CLI (`packages/docs-cli`)
21+
- Broken link checking
22+
- SEO optimization
1223

1324
## Getting Started
1425

15-
### Installation
26+
### Prerequisites
1627

17-
```bash
18-
npm install
19-
```
28+
- Node.js 18+
29+
- pnpm
2030

21-
After cloning the repository, configure the Git merge driver for `pnpm-lock.yaml`:
31+
### Installation
2232

2333
```bash
24-
git config merge.pnpm-merge.name "pnpm-lock.yaml merge driver"
25-
git config merge.pnpm-merge.driver "pnpm install"
34+
pnpm install
2635
```
2736

28-
This helps avoid merge conflicts in the lock file by automatically regenerating it during merges.
29-
3037
### Development
3138

39+
Start the development server:
40+
3241
```bash
33-
npm run dev
42+
pnpm run dev
3443
```
3544

36-
Visit `http://localhost:3000` to view the documentation site.
45+
Visit `http://localhost:3000` to view the documentation.
3746

38-
### Build
47+
## Writing Documentation
3948

40-
```bash
41-
npm run build
42-
```
49+
1. Create new MDX files in `content/docs`.
50+
2. Update `meta.json` in the corresponding directory.
51+
3. Commit your changes (CI will handle translation).
52+
53+
### CLI Tools
4354

44-
### Production
55+
We provide a custom CLI for translation tasks:
4556

4657
```bash
47-
npm start
58+
# Translate all files
59+
pnpm docs-cli translate --all
4860
```
4961

50-
## Building Multi-language Documentation
5162

5263
For a comprehensive guide on how to build and maintain multi-language documentation, see the [Multi-language Documentation Guide](content/docs/i18n-guide.en.mdx) available in the documentation:
5364

‎content/docs/00-intro/meta.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"title": "Preamble & Design",
3-
"pages": ["index", "welcome", "manifesto", "ai-codex"]
3+
"pages": ["index", "welcome", "manifesto", "architecture", "ai-codex"]
44
}

‎content/docs/01-quickstart/enterprise-integrators.mdx‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,13 @@ export default {
303303
### Step 4: Launch Containers
304304

305305
```bash
306-
docker-compose up -d
306+
docker compose up -d
307307
```
308308

309309
Check status:
310310

311311
```bash
312-
docker-compose ps
312+
docker compose ps
313313
```
314314

315315
Expected output:
@@ -325,13 +325,13 @@ objectos-redis redis:7-alpine Up 2 minutes
325325

326326
```bash
327327
# All services
328-
docker-compose logs -f
328+
docker compose logs -f
329329

330330
# Just ObjectOS
331-
docker-compose logs -f objectos
331+
docker compose logs -f objectos
332332

333333
# Last 100 lines
334-
docker-compose logs --tail=100 objectos
334+
docker compose logs --tail=100 objectos
335335
```
336336

337337
### Step 6: Access Application
@@ -569,13 +569,13 @@ export default {
569569

570570
```bash
571571
# Check database is running
572-
docker-compose ps postgres
572+
docker compose ps postgres
573573

574574
# Test connection
575-
docker-compose exec postgres psql -U objectstack -d objectstack
575+
docker compose exec postgres psql -U objectstack -d objectstack
576576

577577
# Check logs
578-
docker-compose logs postgres
578+
docker compose logs postgres
579579
```
580580

581581
### Permission Denied
@@ -590,13 +590,13 @@ GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO objectstack_user;
590590

591591
```bash
592592
# Check logs
593-
docker-compose logs objectos
593+
docker compose logs objectos
594594

595595
# Validate config
596-
docker-compose config
596+
docker compose config
597597

598598
# Restart containers
599-
docker-compose restart
599+
docker compose restart
600600
```
601601

602602
## Next Steps

‎content/docs/index.mdx‎

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
---
2-
title: Welcome
3-
description: Welcome to ObjectStack Documentation
2+
title: Introduction
3+
description: ObjectStack - The Protocol-Driven Development Platform
44
---
55

6-
# Welcome to ObjectStack
6+
# ObjectStack Documentation
77

8-
ObjectStack is a comprehensive platform for building modern applications with powerful tools and frameworks.
8+
**ObjectStack** is a full-stack, local-first development platform designed for **data sovereignty** and **technical decoupling**.
99

10-
## Our Products
10+
It standardizes the development process using a "Protocol-Driven" architecture, separating business logic from technical implementation.
1111

12-
We offer three core products designed to streamline your development workflow:
12+
## Core Products
1313

14-
- **ObjectUI**: A modern UI component library for building beautiful and responsive user interfaces
15-
- **ObjectQL**: A powerful query language and data access layer for efficient data operations
16-
- **ObjectOS**: An operating system framework that provides the foundation for building scalable applications
14+
ObjectStack consists of three integrated engines:
1715

18-
## Features
16+
### [ObjectQL (Backend)](./02-objectql)
17+
The universal data protocol. Define your data models once in JSON schema, and run them on any database (SQLite, PostgreSQL, Oracle, etc.).
1918

20-
- **Multi-language Support**: Switch between English and Chinese
21-
- **Fast Search**: Quick search across all documentation
22-
- **Beautiful UI**: Modern and responsive design
23-
- **MDX Support**: Write docs with MDX for interactive content
19+
### [ObjectUI (Frontend)](./03-objectui)
20+
The declarative UI engine. Render enterprise-grade interfaces directly from your data protocols without writing repetitive component code.
21+
22+
### [ObjectOS (Runtime)](./04-objectos)
23+
The operating system for your apps. Binds ObjectQL and ObjectUI together with built-in identity management, security, and access control.
2424

2525
## Getting Started
2626

27-
Explore the documentation using the sidebar navigation. You can switch languages using the language selector in the top navigation bar.
27+
Ready to build? Choose your path:
28+
29+
- 🚀 **[Quick Start Guide](./01-quickstart)**: Create your first app in under 10 minutes.
30+
- 💡 **[Core Concepts](./00-intro/welcome)**: Learn about the philosophy behind ObjectStack.
31+
- 🏗️ **[Architecture](./00-intro/architecture)**: Deep dive into the technical design.
32+

‎packages/docs-cli/README.md‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# @docs/cli
2+
3+
Internal CLI tool for automating documentation workflows for ObjectStack.
4+
5+
## Features
6+
7+
- **AI Translation**: Automatically translate MDX documentation from English to Chinese using OpenAI models.
8+
- **Smart Updates**: Can process specific files or bulk translate the entire documentation.
9+
10+
## Installation
11+
12+
This package is part of the monorepo workspace. Install dependencies from the root:
13+
14+
```bash
15+
pnpm install
16+
```
17+
18+
## Usage
19+
20+
### Translate Documentation
21+
22+
The `translate` command reads English documentation from `content/docs` and generates Chinese translations in `content/docs-zh-CN`.
23+
24+
**Prerequisites:**
25+
You must set the following environment variables (in `.env` or your shell):
26+
27+
```bash
28+
OPENAI_API_KEY=sk-...
29+
OPENAI_BASE_URL=https://api.openai.com/v1 # Optional
30+
```
31+
32+
**Commands:**
33+
34+
```bash
35+
# Translate a specific file
36+
pnpm docs-cli translate content/docs/00-intro/index.mdx
37+
38+
# Translate multiple files
39+
pnpm docs-cli translate content/docs/00-intro/index.mdx content/docs/01-quickstart/index.mdx
40+
41+
# Translate all files in content/docs
42+
pnpm docs-cli translate --all
43+
44+
# Specify a custom model (default: gpt-4o)
45+
pnpm docs-cli translate --all --model gpt-4-turbo
46+
```
47+
48+
### CI/CD Integration
49+
50+
In CI environments, you can use the `CHANGED_FILES` environment variable to translate only modified files:
51+
52+
```bash
53+
export CHANGED_FILES="content/docs/new-page.mdx"
54+
pnpm docs-cli translate
55+
```

0 commit comments

Comments
 (0)