
A React TypeScript application with secure backend integration that generates AI-powered training plans from datasets using PostgreSQL database and Builder API.
This application uses a secure frontend-backend architecture with:
bashgit clone <repository-url> cd training-agent
bashnpm install
bash# Create a PostgreSQL database for the application createdb training_agent
bash# Backend configuration cd server cp .env.example .env # Edit server/.env with your database and Builder API credentials # Frontend configuration cd .. cp .env.example .env # Edit .env with your frontend configuration
bashcd server npm install npm run migrate:up
bashnpm run dev
bashcd .. npm run dev
The backend will be available at http://localhost:3001 and the frontend at http://localhost:5173.
This application uses a secure architecture with PostgreSQL database and server-side Builder API integration.
Configure the backend server in server/.env:
env# PostgreSQL Database Configuration PGHOST=localhost PGPORT=5432 PGDATABASE=training_agent PGUSER=postgres PGPASSWORD=your_postgres_password # Builder API Configuration (Backend Only - Secure) BUILDER_API_TOKEN=your_api_token_here BUILDER_API_BASE_URL=https://api.builder.example.com BUILDER_IS_WORKSPACE_TOKEN=false BUILDER_WORKSPACE_ID= # Server Configuration PORT=3001 FRONTEND_URL=http://localhost:5173 NODE_ENV=development
Configure the frontend in .env:
env# Backend Service Configuration # The application uses relative URLs for backend communication # This works when frontend and backend are served from the same domain # VITE_BACKEND_URL=http://localhost:3001 # Language Configuration VITE_DEFAULT_LANGUAGE=en
Note: The application automatically uses relative URLs for API requests (e.g., /api/datasets), making the application more portable across different environments.
Note: All database operations and Builder API credentials are handled securely on the backend. No sensitive credentials are exposed to the frontend.
The application automatically operates in different modes:
Connected Mode: Builder API available
Demo Mode: Builder API unavailable
The integrated API client supports:
The app includes a built-in configuration interface:
src/ ├── components/ # React components │ ├── ApiConfig.tsx # API configuration UI │ └── TrainingAgentApp.tsx # Main app component ├── contexts/ # React contexts │ └── ApiContext.tsx # API client context ├── hooks/ # Custom React hooks │ └── useApiClient.ts # API operation hooks ├── services/ # Business logic │ └── apiClient.ts # API client implementation ├── types/ # TypeScript definitions │ └── api.ts # API type definitions └── App.tsx # Root component
src/types/api.tssrc/services/apiClient.tssrc/hooks/useApiClient.tsThe app implements comprehensive error handling:
bashnpm run build
The built files will be in the dist/ directory.
| Variable | Description | Default |
|---|---|---|
VITE_SUPABASE_URL | Supabase project URL | - |
VITE_SUPABASE_ANON_KEY | Supabase anonymous key | - |
Note: The application uses relative URLs for backend communication, so no backend URL configuration is needed.
| Variable | Description | Default |
|---|---|---|
BUILDER_API_TOKEN | Builder API authentication token | - |
BUILDER_API_BASE_URL | Base URL for Builder API | - |
BUILDER_IS_WORKSPACE_TOKEN | Whether token is workspace-specific | false |
BUILDER_API_VERBOSE | Enable verbose API logging | false |
BUILDER_WORKSPACE_ID | Specific workspace ID to use | - |
SUPABASE_URL | Supabase project URL | - |
SUPABASE_SERVICE_ROLE_KEY | Supabase service role key | - |
Problem: "Backend service unavailable" or connection errors Solution:
/api/healthProblem: "Using demo data - Builder API unavailable" message Solution:
server/.env.env.example to .env (frontend) and server/.env.example to server/.env (backend)BUILDER_API_TOKEN is correct and has proper permissions[Your License Here] .
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。


探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务