GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - APIJSON/A2API at multi_tables

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

24 Commits
24 Commits

Folders and files

NameName
Last commit message
Last commit date
.cursor/skills
.cursor/skills
 
 
apps
apps
 
 
articles
articles
 
 
conversations
conversations
 
 
e2e
e2e
 
 
packages
packages
 
 
playwright-report
playwright-report
 
 
test-results
test-results
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README-Chinese.md
README-Chinese.md
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.base.json
tsconfig.base.json
 
 

Repository files navigation

English | 中文

A2API

Chat agent to HTTP API to safely, quickly and stably add, view, edit or remove data in tables, forms or charts together with A2UI.
AI generate UI once, API repeat everytime safely, quickly and stably.

Agent-to-API protocol and MVP demo: generate a simple task UI, tune an HTTP API request until it works, then let users change filters, sort, and paging from the UI — which directly calls HTTP API
without going through the LLM again, no more token cost.

No SQL execution path. Sensitive writes (default: delete) wait in the Admin approval queue; other writes auto-execute and leave an auto_approved audit record on the server.

Requirements

  • Node.js 18+
  • Local APIJSONBoot-MultiDataSource (or compatible) at http://localhost:8080

Quick start

cd ~/a2api
cp .env.example .env
npm install
npm test
npm run build
npm run dev
  • Client (Vite): http://localhost:5173

  • Admin (config approvals): npm run dev:admin → http://localhost:5174

    • Tables Apply + Call: run apps/admin/sql/sys_Apply.sql and sys_Call.sql, reload Access/Request. If Call logs say GET denied for LOGIN, run apps/admin/sql/patch_Call_access.sql (Access id 9003; 9002 is Apply).
    • Ordinary CRUD hits APIJSON HTTP directly; admin server only runs approve → Access/Request/Document/Chain
    • Admin tabs: Apply · Call logs · Stats
  • API (Hono): http://localhost:3000

Open the client URL. Use Login (top-right) to open the account menu and set AI Model / Base URL / API Key (APIAuto-style). Try chips such as List the latest 3 moments with authors, then change sort/page and click Query / Refresh — the right panel shows usedLlm: false and the exact APIJSON body.

Curated chat examples live in conversations/; project Agent skills in .cursor/skills/.

Optional: set OPENAI_API_KEY in .env to refine bootstrap with an LLM. Without it, built-in intent rules for User / Moment / Comment still work (English and Chinese phrases).

Monorepo layout

Path Role
packages/protocol A2API 0.1 envelopes, JSON Pointer helpers, validators, CRUD fixture tests
packages/runtime ApiJsonClient, HitlController, BoundExecutor
apps/chat-demo Orchestrator + chat UI (Bootstrap) + bound filters (Steady-state)
apps/admin Config application approvals → write Access / Request / Document / Chain

Protocol (MVP)

Envelopes: { "version": "0.1", "<type>": { ... } }

  • proposeRequest — candidate APIJSON call
  • reviseRequest / decision — edit / approve|reject
  • bindRequest — after code == 200, template + paramMap for UI-driven calls
  • requestResult / status — outcomes

Read methods auto-execute. Non-sensitive post / put auto-execute with an audit row. Sensitive methods (default delete, override SENSITIVE_METHODS) wait for Admin Approve/Reject.

Two-phase UX

  1. Bootstrap (chat / AI or rules) — generate UI + propose APIJSON → validate → execute until success → emit bindRequest
  2. Steady-state (no LLM) — filter/sort/page → BoundExecutor merges paramMap into bodyTemplate → POST {baseUrl}/{method}

UI | Data tabs

Top tabs:

  • UI — chat bootstrap + bound table/detail/charts
  • Data — APIAuto-style HTTP debugger
  • Admin — sensitive approval queue + audit trail (auto_approved / approved / rejected)

Also:

  • Embed APIAuto — iframe http://localhost:8080/api/index.html?send=true&type=JSON&url=...&json=... (share-link auto fill + send)
  • Open APIAuto in new window — same share URL in a new tab

Agent / console automation:

a2apiAgent.switchTab("data")
a2apiAgent.debug({
  url: "http://localhost:8080/get",
  json: { User: { id: 38710 } },
  send: true,          // builtin send
  // useApiAuto: true, // or load iframe + auto send
})

Configure APIJSON

export APIJSON_BASE_URL=http://localhost:8080
# or edit .env

Ensure the Demo schema (User / Moment / Comment) is available on that server.

Writes (POST/PUT/DELETE): the Demo often requires a logged-in session (@role OWNER/LOGIN). The MVP still generates the request and shows the HITL Approve/Reject UI; if APIJSON returns "not logged in", log in via your Demo/APIAuto session cookies or relax Access for local testing. Reads work out of the box against the public Demo data.

Scripts

npm test          # protocol + runtime unit tests
npm run build     # compile packages + demo
npm run dev       # API :3000 + Vite :5173
npm run typecheck

Phase 2 (not in this MVP)

Versioned snapshots (reuse / auto-adjust / manual-adjust), local-first store, cross-device sync via APIJSON tables or file import/export — see the design plan.

About

✅ AI 生成一次 UI,API 每次都安全、快速、稳定读写数据。用 A2UI 聊天即兴生成 UI 来安全、快速、稳定调用 HTTP API 增删改查表格、表单、图表等数据。本仓库为副本,请给原仓库右上角点亮 ⭐️ Star

github.com/TommyLemon/A2API

Resources

Readme
License
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.