A lightweight web IDE for Legend Lite — write Pure models, execute queries, ask questions in natural language, and visualize class diagrams.
- Pure Editor — Monaco-based editor with syntax highlighting, LSP diagnostics, and autocompletion
- Pure Query Execution — Write Pure queries and execute them against DuckDB with results in a data grid
- Raw SQL — Execute SQL directly against the runtime's database connection
- Ask AI — Natural language to Pure query (powered by Gemini LLM via the NLQ pipeline)
- Class Diagram — Interactive Cytoscape.js graph of classes, associations, and generalisations
- Node.js 18+
- Legend Lite backend running on
http://localhost:8080(see below)
In the legend-lite repo:
# Without NLQ (engine only)
mvn exec:java -pl engine \
-Dexec.mainClass="org.finos.legend.engine.server.LegendHttpServer"
# With NLQ (Ask AI feature)
GEMINI_API_KEY=your-key-here \
mvn exec:java -pl nlq \
-Dexec.mainClass="org.finos.legend.engine.nlq.NlqHttpServer"The backend starts on port 8080. The frontend expects this — if you change the port, update BASE_URL in src/lspClient.ts.
npm install
npm run devOpens at http://localhost:5173. The app shows a connection indicator in the header — green means the backend is reachable.
| Tab | Description |
|---|---|
| Pure Query | Write and execute Pure expressions against the model defined in the left editor |
| Raw SQL | Execute SQL directly against the runtime's DuckDB connection |
| Ask AI | Type a natural language question, get a Pure query back (requires NLQ backend) |
| Diagram | Interactive class diagram extracted from the Pure model |
- Type a question like "show me total PnL by trader for the AMER equity desk"
- The pipeline runs: Retrieve classes → Route to root → Plan query → Generate Pure
- The generated Pure query appears in the result panel
- Click "Open in Pure Editor →" to copy it to the Pure Query tab and execute it
src/
App.tsx — Main app component with all tabs and query execution
App.css — Full styling (dark theme)
lspClient.ts — HTTP client for all backend endpoints
DiagramView.tsx — Cytoscape.js class diagram renderer
| Endpoint | Used By |
|---|---|
POST /lsp |
Model editor (diagnostics, completions) |
POST /engine/execute |
Pure Query tab |
POST /engine/sql |
Raw SQL tab |
POST /engine/nlq |
Ask AI tab |
POST /engine/diagram |
Diagram tab |
GET /health |
Connection indicator |
The backend URL is configured in src/lspClient.ts:
const BASE_URL = 'http://localhost:8080';npm run build # Production build → dist/
npm run preview # Preview production buildApache 2.0