docs: add upage usage instructions document

This commit is contained in:
LIlGG
2025-09-26 16:46:52 +08:00
parent f3a3e99df2
commit 54d1d65642
10 changed files with 27 additions and 14 deletions

View File

@@ -140,7 +140,7 @@ LOGTO_BASE_URL=http://localhost:5173
# 随机任意的 36 位字符串,用于加密 Logto 的 cookie。
LOGTO_COOKIE_SECRET=
# 是否在开发环境中启用 Logto 认证,设置为 false 则在开发环境不强制认证
LOGTO_ENABLE_DEV=false
LOGTO_ENABLE=false
# 运行环境,与 NODE_ENV 有所不同, NODE_ENV 在打包时就已确定,而此变量用于某些功能在不同环境下的开放
# development | production | test
OPERATING_ENV=production

1
.gitignore vendored
View File

@@ -52,5 +52,4 @@ mock
# storage
/public/uploads
/data/

View File

@@ -32,10 +32,14 @@ RUN pnpm prune --prod --ignore-scripts
FROM node:20.18.0-alpine AS runtime
WORKDIR /app
ENV OPERATING_ENV=production
ENV NODE_ENV=production
ENV LOGTO_ENABLE_DEV=false
ENV LOGTO_ENABLE=false
ENV PORT=3000
ENV HOST=0.0.0.0
ENV USAGE_LOG_FILE=true
ENV MAX_UPLOAD_SIZE_MB=5
ENV LOG_LEVEL=debug
# Use pnpm
RUN corepack enable && corepack prepare pnpm@9.4.0 --activate

View File

@@ -1,15 +1,16 @@
<h1 align="center">UPage</h1>
<h3 align="center">基于人工智能的可视化网页构建平台</h3>
<h3 align="center">基于大模型的可视化网页构建平台</h3>
<p align="center">
<a href="https://github.com/halo-dev/upage/releases"><img alt="GitHub release" src="https://img.shields.io/github/release/halo-dev/upage.svg?style=flat-square&include_prereleases" /></a>
<a href="https://github.com/halo-dev/upage/commits"><img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/halo-dev/upage.svg?style=flat-square" /></a>
<a href="https://github.com/halo-dev/upage/actions"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/halo-dev/upage/halo.yaml?branch=main&style=flat-square" /></a>
<a href="https://halo-dev.github.io/upage/"><img alt="Documentation" src="https://img.shields.io/badge/docs-latest-blue?style=flat-square" /></a>
</p>
------------------------------
UPage 是一款基于人工智能的可视化网页构建平台,支持多种 AI 提供商集成,基于自然语言快速实现定制化网页。
UPage 是一款基于大模型的可视化网页构建平台,支持多种 AI 提供商集成,使用自然语言快速实现定制化网页。
------------------------------
@@ -27,17 +28,19 @@ docker run -d \
--restart unless-stopped \
-p 3000:3000 \
-e LLM_DEFAULT_PROVIDER=OpenAILike \
-e OPENAI_LIKE_API_BASE_URL=your-openai-like-api-base-url \
-e OPENAI_LIKE_API_KEY=your-openai-like-api-key \
-e LLM_DEFAULT_MODEL=your-default-model \
-e LLM_MINOR_MODEL=your-minor-model \
-v ./data:/app/data \
-v ./logs:/app/logs \
-v ./storage:/app/storage \
ghcr.io/halo-dev/upage
halohub/upage:latest
```
其中参数说明如下:
- `-e LLM_DEFAULT_PROVIDER=OpenAILike`:设置默认的 LLM 提供商为 OpenAILike即兼容 OpenAI 的 API 接口。
- `-e OPENAI_LIKE_API_BASE_URL=your-openai-like-api-base-url`:设置 OpenAILike 的 API 基础 URL。
- `-e OPENAI_LIKE_API_KEY=your-openai-like-api-key`:设置 OpenAILike 的 API 密钥。
- `-e LLM_DEFAULT_MODEL=your-default-model`:设置默认的 LLM 模型,用于构建页面。
- `-e LLM_MINOR_MODEL=your-minor-model`:设置次要的 LLM 模型,用于执行其他任务。

View File

@@ -93,7 +93,7 @@ const config: LogtoConfig = {
const originalLogto = makeLogtoRemix(config, { sessionStorage });
export function shouldEnforceAuth(): boolean {
return process.env.LOGTO_ENABLE_DEV !== 'false';
return process.env.LOGTO_ENABLE !== 'false';
}
function getMockDevUser(): MockUser {

View File

@@ -41,7 +41,7 @@ services:
- LOGTO_APP_SECRET=${LOGTO_APP_SECRET}
- LOGTO_COOKIE_SECRET=${LOGTO_COOKIE_SECRET}
- LOGTO_BASE_URL=${LOGTO_BASE_URL}
- LOGTO_ENABLE_DEV=${LOGTO_ENABLE_DEV:-false}
- LOGTO_ENABLE=${LOGTO_ENABLE:-false}
- USAGE_LOG_FILE=true
- STORAGE_DIR=/app/storage
- MAX_UPLOAD_SIZE_MB=${MAX_UPLOAD_SIZE_MB:-5}

View File

@@ -41,7 +41,7 @@ services:
- LOGTO_APP_SECRET=${LOGTO_APP_SECRET}
- LOGTO_COOKIE_SECRET=${LOGTO_COOKIE_SECRET}
- LOGTO_BASE_URL=${LOGTO_BASE_URL}
- LOGTO_ENABLE_DEV=${LOGTO_ENABLE_DEV:-false}
- LOGTO_ENABLE=${LOGTO_ENABLE:-false}
- USAGE_LOG_FILE=${USAGE_LOG_FILE:-true}
- MAX_UPLOAD_SIZE_MB=${MAX_UPLOAD_SIZE_MB:-5}
volumes:

View File

@@ -1,5 +1,7 @@
TAG=1.31.0
LOGTO_ENDPOINT=
LOGTO_ADMIN_ENDPOINT=
LOGTO_POSTGRES_PORT=
LOGTO_POSTGRES_PASSWORD=postgres1
LOGTO_CORE_PORT=3001
LOGTO_ADMIN_PORT=3002
LOGTO_ADMIN_PORT=3002

View File

@@ -20,6 +20,8 @@ services:
postgres:
image: postgres:17-alpine
user: postgres
ports:
- ${LOGTO_POSTGRES_PORT:-5432}:5432
environment:
POSTGRES_USER: logto
POSTGRES_PASSWORD: ${LOGTO_POSTGRES_PASSWORD}

View File

@@ -13,14 +13,17 @@
"check": "biome check --write --no-errors-on-unmatched .",
"check:stage": "biome check --write --staged --no-errors-on-unmatched",
"clean": "node scripts/clean.js",
"setup": "prisma generate && prisma migrate deploy",
"setup": "prisma migrate deploy && prisma generate",
"docker:build": "docker build -t upage-ai:production -t upage-ai:latest --target runtime .",
"docker:dev:run": "docker compose -f docker-compose-dev.yaml up",
"docker:prod:run": "docker compose -f docker-compose-prod.yaml up",
"prepare": "husky || true",
"test": "vitest --run",
"test:watch": "vitest",
"typecheck": "tsc"
"typecheck": "tsc",
"docs:start": "pnpm --filter upage-docs run start",
"docs:build": "pnpm --filter upage-docs run build",
"docs:serve": "pnpm --filter upage-docs run serve"
},
"dependencies": {
"@agentic/ai-sdk": "^8.4.4",
@@ -105,7 +108,8 @@
"unist-util-visit": "^5.0.0",
"winston": "^3.17.0",
"winston-daily-rotate-file": "^5.0.0",
"zod": "^4.1.11"
"zod": "^4.1.11",
"node-fetch": "^3.3.2"
},
"devDependencies": {
"@biomejs/biome": "2.2.4",
@@ -130,7 +134,6 @@
"dotenv": "^17.2.2",
"fast-glob": "^3.3.3",
"husky": "9.1.7",
"node-fetch": "^3.3.2",
"pnpm": "^10.17.1",
"sass-embedded": "^1.93.1",
"typescript": "^5.9.2",