Web UI

May 1, 2026 ยท View on GitHub

๐Ÿ“ ๆ—ฅๆœฌ่ชž็‰ˆ README ใฏใ“ใกใ‚‰

Web UI โ€” Spec-Driven Presentation Maker

Layer 4 Web UI for Spec-Driven Presentation Maker. A React-based chat interface for creating presentations through conversational AI โ€” design your spec, then let the agent build the slides.

Chat UI


Tech Stack

  • Next.js 16 with Turbopack (static export)
  • React 19 / TypeScript 5
  • Tailwind CSS v4 / shadcn/ui / Radix UI
  • react-oidc-context โ€” Cognito OIDC authentication
  • react-markdown + remark-gfm โ€” Markdown rendering
  • react-dropzone โ€” File upload
  • sonner โ€” Toast notifications
  • PWA โ€” Service Worker + Web App Manifest

Prerequisites

  • Node.js 20+
  • npm

Quick Start

cd web-ui
npm ci
npm run dev     # Starts dev server with Turbopack

Open http://localhost:3000.

Note: Authentication is required by default. See the Authentication section to configure or disable it.


Experimental: Local Mode (Kiro ACP backend)

โš ๏ธ Experimental. APIs, flags, and behavior may change or break without notice.

Run the Web UI entirely on your machine, backed by Kiro CLI via ACP (Agent Client Protocol) instead of the cloud-deployed Agent and Runtime. No AWS deployment needed. Useful for trying the UI without setting up Layer 3/4.

Prerequisites

Start

cd web-ui
npm ci
npm run dev:local

Open http://localhost:3000 (Next.js picks the next free port if 3000 is taken).

How it works

Setting NEXT_PUBLIC_MODE=local enables the Next.js API Routes under src/app/api/ and spawns kiro-cli acp --agent sdpm-spec per active deck. The agent definitions live under mcp-local/.kiro/agents/ and share the MCP toolset from mcp-local/server_acp.py.


Authentication

Authentication uses OIDC via Cognito User Pool. Configuration is loaded from public/aws-exports.json at runtime, with optional environment variable overrides.

Setup

  1. Copy the example config:
cp public/aws-exports.example.json public/aws-exports.json
  1. Fill in your Cognito values:
{
  "authority": "https://cognito-idp.<REGION>.amazonaws.com/<USER_POOL_ID>",
  "client_id": "<CLIENT_ID>",
  "redirect_uri": "http://localhost:3000",
  "post_logout_redirect_uri": "http://localhost:3000",
  "response_type": "code",
  "scope": "openid profile email",
  "automaticSilentRenew": true,
  "agentRuntimeArn": "arn:aws:bedrock-agentcore:<REGION>:<ACCOUNT_ID>:runtime/<NAME>",
  "apiBaseUrl": "https://<API_GW_ID>.execute-api.<REGION>.amazonaws.com/prod/",
  "awsRegion": "<REGION>"
}

Environment Variable Override

Environment variables (NEXT_PUBLIC_COGNITO_*) take priority over aws-exports.json:

VariableDescription
NEXT_PUBLIC_COGNITO_REGIONAWS region
NEXT_PUBLIC_COGNITO_USER_POOL_IDCognito User Pool ID
NEXT_PUBLIC_COGNITO_CLIENT_IDCognito App Client ID
NEXT_PUBLIC_COGNITO_REDIRECT_URIOAuth redirect URI
NEXT_PUBLIC_COGNITO_POST_LOGOUT_REDIRECT_URIPost-logout redirect URI
NEXT_PUBLIC_COGNITO_RESPONSE_TYPEOAuth response type (default: code)
NEXT_PUBLIC_COGNITO_SCOPEOAuth scopes (default: email openid profile)
NEXT_PUBLIC_COGNITO_AUTOMATIC_SILENT_RENEWAuto token renewal (true/false)

Disabling Auth for Local Development

Authentication is enforced through a Next.js Route Group. All protected pages live under src/app/(authenticated)/, which wraps children with AuthProvider in its layout.tsx:

src/app/
โ”œโ”€โ”€ layout.tsx                    # RootLayout โ€” no auth
โ””โ”€โ”€ (authenticated)/
    โ”œโ”€โ”€ layout.tsx                # AuthProvider wrapper
    โ”œโ”€โ”€ page.tsx                  # Redirects to /decks
    โ””โ”€โ”€ decks/page.tsx            # Main page

To bypass auth during local development, remove the AuthProvider wrapper in src/app/(authenticated)/layout.tsx:

Before:

import { AuthProvider } from "@/components/auth/AuthProvider"

export default function AuthenticatedLayout({ children }: { children: React.ReactNode }) {
  return <AuthProvider>{children}</AuthProvider>
}

After:

export default function AuthenticatedLayout({ children }: { children: React.ReactNode }) {
  return <>{children}</>
}

โš ๏ธ This change is for local development only. Do not deploy to production.


Project Structure

web-ui/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx                  # RootLayout (Geist font, Toaster, PWA)
โ”‚   โ”‚   โ”œโ”€โ”€ globals.css
โ”‚   โ”‚   โ””โ”€โ”€ (authenticated)/
โ”‚   โ”‚       โ”œโ”€โ”€ layout.tsx              # AuthProvider wrapper
โ”‚   โ”‚       โ”œโ”€โ”€ page.tsx                # Root โ†’ /decks redirect
โ”‚   โ”‚       โ””โ”€โ”€ decks/page.tsx          # Main deck workspace
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ ui/                         # shadcn/ui primitives
โ”‚   โ”‚   โ”œโ”€โ”€ auth/                       # AuthProvider, AutoSignin
โ”‚   โ”‚   โ”œโ”€โ”€ chat/                       # ChatPanel, ChatMessage, ToolCard, FileDropZone, etc.
โ”‚   โ”‚   โ”œโ”€โ”€ deck/                       # DeckCard, SlideCarousel, OutlineView, DeckListView, etc.
โ”‚   โ”‚   โ””โ”€โ”€ AppShell.tsx                # Header + layout shell
โ”‚   โ”œโ”€โ”€ hooks/                          # useAuth, useDeckList, useWorkspace, useSwipe, etc.
โ”‚   โ”œโ”€โ”€ lib/                            # auth.ts (Cognito config), utils.ts
โ”‚   โ”œโ”€โ”€ services/                       # deckService, uploadService, agentCoreService, parsers
โ”‚   โ””โ”€โ”€ types/
โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ aws-exports.example.json        # Auth config template
โ”‚   โ”œโ”€โ”€ manifest.json                   # PWA manifest
โ”‚   โ””โ”€โ”€ sw.js                           # Service Worker
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ next.config.ts                      # Static export, build โ†’ build/
โ”œโ”€โ”€ tsconfig.json
โ”œโ”€โ”€ components.json                     # shadcn/ui config
โ””โ”€โ”€ postcss.config.mjs

Key Components

Chat (components/chat/)

Conversational interface for interacting with the agent. Includes message rendering with Markdown support, tool execution cards, file drag-and-drop upload, mention overlays, and slide tag references.

Deck (components/deck/)

Presentation management โ€” deck cards with thumbnails, slide carousel viewer, outline view, spec step navigation, search results grid, and deck CRUD actions.

Auth (components/auth/)

OIDC authentication flow โ€” AuthProvider wraps the Cognito OIDC context, AutoSignin handles automatic redirect-based sign-in.


Documentation

DocumentDescription
Getting StartedFull setup guide for all layers
Architecture4-layer design, data flow, auth model
Recommended DeployRecommended path for AWS deployments (CloudShell or local)

License

MIT-0