JonasR-Git/web-architect-ai:把现有网站转成可审阅的迁移蓝图与 HTML 原型
JonasR-Git/web-architect-ai
GitHub 项目 web-architect-ai 可将现有网站爬取并转化为可审阅的迁移蓝图、页面与组件规格以及 AI 生成的设计方向,最终产出五个 HTML 原型变体。
Turn an existing website into a reviewable migration blueprint, page and component specifications, and AI-generated design directions.
Status: experimental local prototype. This is a workbench for exploring and reviewing a migration, with drafts and HTML mockups as outputs.
What it does
- Crawls a website with Puppeteer and extracts page structure, content, media, forms and technology signals.
- Groups similar pages and lets you inspect and edit the resulting blueprint and content mapping.
- Runs AI-assisted critique and migration planning, then generates page and component specifications.
- Offers design directions and generates five HTML mockup variants through a multi-stage workflow.
- Persists sessions and assets locally under
data/sessions.
flowchart LR
A[Website URL] --> B[Crawl and extract]
B --> C[Critique and migration plan]
C --> D[Editable blueprint]
D --> E[Page and component specs]
E --> F[Design directions]
F --> G[HTML mockups]
G --> H[Implementation plan]
Loading
Run locally
Use Node.js and npm compatible with the project's Next.js 16 dependency.
git clone https://github.com/JonasR-Git/web-architect-ai.git
cd web-architect-ai
npm ciCreate .env.local in the repository root. For real model calls:
OPENROUTER_API_KEY=your_openrouter_api_key
The default model is defined in src/lib/openai.ts. If it is unavailable to your OpenRouter account, set AI_MODEL_ID to an available model before starting real AI calls.
Alternatively, enable mock AI responses without a provider key:
USE_MOCK=true
Then start the application:
npm run dev
Open localhost:3000, enter a website URL and work through the analysis, blueprint and design flow. Use a site you own or are authorised to crawl. Mock AI mode concerns model responses; it should not be treated as a guarantee that crawling makes no network requests.
Architecture
| Layer | Implementation |
|---|---|
| Application | Next.js App Router, React and TypeScript |
| Server workflows | Server Actions and an SSE crawl API |
| Website intake | Puppeteer crawler and extraction logic |
| AI orchestration | OpenRouter SDK with configurable models for analysis and generation stages |
| Workbench | Analysis, blueprint editing, specifications and design/mockup workflows |
| Persistence | Local filesystem sessions and assets |
Entry points include src/app/actions.ts, src/modules/core/ai-service.ts, src/modules/core/persistence.ts and src/modules/core/views/home-view.tsx.
Configuration
OPENROUTER_API_KEY enables provider-backed AI calls. The implementation also recognises USE_MOCK and CRAWLER_MODE, plus model overrides for individual workflow stages.
Model override variable names
AI_MODEL_IDLIGHTWEIGHT_MODELAI_MODEL_CRITIQUEAI_MODEL_MIGRATIONAI_MODEL_COMPONENTAI_MODEL_CONTENTAI_MODEL_SPECIFICATIONAI_MODEL_DESIGNAI_MODEL_IMPLEMENTATIONAI_MODEL_MOCKUPAI_MODEL_STYLEMOCKUP_STAGE1_MODELthroughMOCKUP_STAGE5_MODELMOCKUP_STAGE3_TEMPERATURE
Refer to the implementation for defaults and supported values. The model choice can affect quality, latency and cost.
Quality checks
The repository declares these checks:
npm run lint npm run build
To run a built application locally:
npm start
There is currently no configured npm test command. An existing test-like source file does not constitute a runnable test suite. The commands above document the available checks; they are not a claim that a particular revision passed them.
Current boundaries
- Sessions are stored locally; hosted persistence and a multi-user authentication model are not established features.
- Missing provider configuration can produce mock or fallback data. Check the active mode before interpreting output as a real analysis.
- Crawling can be resource-intensive, and limits differ between execution paths.
- AI-generated plans, specifications and mockups need review before being used for an actual migration.
- The repository does not yet include an automated CI workflow, a provider configuration example file or a published licence.
Suggested next steps
These are proposed improvements, rather than shipped capabilities:
- Configure a test runner and CI checks.
- Add
.env.exampleand clearer mode indicators. - Publish a short demo with a reproducible example website.
- Add consistent crawl limits and evaluation cases for blueprint and specification quality.
- Define hosted storage and access control before deploying for multiple users.
来源:GitHub · github.com