Skip to content

Latest commit

 

History

History
174 lines (112 loc) · 5.89 KB

README.en.md

File metadata and controls

174 lines (112 loc) · 5.89 KB

AI Application Generation & Delivery Platform

中文 · English

GitHub stars Java 21 Spring Boot LangChain4j License: MIT

From natural-language requirements to previewable, editable, buildable and deployable web applications.

Java · Spring Boot · LangChain4j · LangGraph4j · Redis · Elasticsearch · Vue


Overview

An AI application generation and delivery platform built with Java, Spring Boot, LangChain4j and LangGraph4j.

The system turns an application description into project code, then parses, stores, retrieves, validates, builds and publishes the result as an accessible web artifact.

The project focuses on the engineering problems after code generation: preserving project context across turns, keeping Memory and AiService consistent after personalization changes, streaming tool events reliably over SSE, validating generated Vue code, and reusing existing project code during later generations.

Features

Streaming generation

Streams model text, tool requests and tool results over SSE. Supports both the standard generation path and LangGraph4j workflows.

Engineering note →

Stateful conversations

MySQL stores complete history, Redis stores the model context window, and summaries plus versioning control long conversations.

Engineering note →

Project-aware generation

Indexes code chunks in Elasticsearch and combines KNN with BM25 retrieval to reuse relevant project context.

Engineering note →

Build validation

Vue projects go through SFC parsing, repair, a second validation pass and npm run build before publishing.

Engineering note →

Tool execution stream

Handles partial and complete callbacks, duplicate events, empty-stream retries and state replay.

Visual editing

Supports element selection and editing in generated pages. The parent page takes over hover and selected overlays when iframe injection is unstable.

Engineering note →

Personalization consistency

Synchronizes MySQL, Redis, Memory Version and cached AiService instances after style changes.

Engineering note →

Artifact delivery

Publishes parsed and stored results as static resources addressed by deployKey, with deployment rollback support.

Architecture

flowchart LR
    U[User request] --> API[Spring Boot API]
    API --> W[Generation workflow]
    W --> L[LangChain4j / LangGraph4j]
    L --> S[SSE event stream]
    W --> M[Memory layer]
    M --> DB[(MySQL)]
    M --> R[(Redis)]
    W --> RAG[Code retrieval]
    RAG --> ES[(Elasticsearch)]
    S --> P[Parser / Saver]
    P --> V[Vue validation and build]
    V --> D[Deployable artifact]
Loading

Technology stack

Layer Technologies
Backend Java 21, Spring Boot, Spring Web, Spring AOP
AI orchestration LangChain4j, LangGraph4j, Reactor
Storage MySQL, Redis, Caffeine, Redisson
Retrieval Elasticsearch, KNN, BM25
Frontend Vue 3, TypeScript, Vite
Build and delivery Maven, Vue compiler, static artifact publishing

Getting started

Requirements: Java 21, MySQL, Redis and an available OpenAI-compatible model endpoint.

Configuration: src/main/resources/application.yml. Keep credentials in environment variables or an untracked local configuration file.

Start the backend:

./mvnw spring-boot:run

The default port is 8124 and the API prefix is /api.

Start the frontend:

cd ai-generate-code-frontend
npm install
npm run dev

API examples

Method Endpoint Description
GET /api/chat/gen/code Streaming code generation
GET /api/chat/gen/workflow Workflow-based generation
POST /api/app/add Create an application
POST /api/app/deploy Deploy an application
POST /api/app/undeploy Remove a deployment
GET /api/static/{deployKey}/** Access deployed resources

Engineering notes

The engineering journal in docs/engineering-journal/ records the main implementation decisions and failure cases, including iframe editing, Memory consistency, tool streaming, RAG and build validation.

Current status

The main generation, Memory, retrieval, build validation and deployment paths are implemented. Automated SSE and Memory tests, connection-pool and Redis failure tests, retrieval evaluation and repeatable load-test scripts are still being expanded.

The repository does not publish unmeasured throughput or production-availability claims.

License

MIT