Skip to content

jgutierrez2/gen-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gen UI

A split-pane generative UI application. Write markdown on the left, get live interactive components on the right. The markdown IS the state — it contains both human-readable descriptions and structured component schemas. Hit "Apply" to send the markdown to an LLM which restructures it and generates UI components.

Prerequisites

  • Node.js 18+
  • Python 3.10+
  • Azure OpenAI access (gpt-5 deployment)

Setup

1. Install frontend dependencies

npm install

2. Install backend dependencies

cd packages/api
pip install -r requirements.txt

3. Configure environment

cp packages/api/.env.example packages/api/.env

Edit packages/api/.env with your Azure OpenAI credentials:

AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com
AZURE_OPENAI_API_KEY=your-api-key
AZURE_OPENAI_DEPLOYMENT=gpt-5
AZURE_OPENAI_API_VERSION=2025-01-01-preview

Running

Start both servers:

# Terminal 1 — API server (port 8000)
npm run dev:api

# Terminal 2 — Next.js dev server (port 3000)
npm run dev:web

Open http://localhost:3000.

How It Works

  1. Write a description of the UI you want in the markdown editor
  2. Click Apply — the markdown is sent to Azure OpenAI
  3. The LLM returns updated markdown with component specifications
  4. Components render as interactive widgets (tables, forms, checklists, etc.)
  5. Interact with components locally (no LLM round-trips for clicks/edits)
  6. Modify your description and Apply again — component state is preserved

Component Types

Type Description
table Editable table with computed values
form Input form with various field types
checklist Toggleable items with progress bar
counter Increment/decrement with optional bounds
metric KPI display with change indicator
chart_bar Horizontal bar chart
tabs Tabbed container with child components
toggle On/off switch
card Static display card
text Styled text block
grid Layout grid for child components
code Syntax-highlighted code block
divider Horizontal rule

Project Structure

packages/
  web/     — Next.js frontend (TypeScript, Tailwind CSS)
  api/     — Python FastAPI backend (Azure OpenAI proxy)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors