Next.js chat UI with shadcn/ui components and Vietnamese language support
When building or modifying the chat interface, dashboard, or any frontend components.
apps/web/
apps/web/src/
├── app/
│ ├── layout.tsx # Root layout with metadata
│ ├── page.tsx # Landing / Chat page
│ └── api/ # API routes (proxy)
├── components/
│ ├── chat/
│ │ ├── ChatWindow.tsx # Main chat container
│ │ ├── MessageBubble.tsx # Individual message
│ │ ├── InputBar.tsx # Message input with send
│ │ └── ActionPlan.tsx # Render Action Plan card
│ ├── ui/ # shadcn/ui components
│ └── layout/
│ ├── Header.tsx
│ ├── Sidebar.tsx
│ └── Footer.tsx
└── lib/
├── api.ts # API client (fetch/axios)
└── utils.ts # cn() helper
interface Message {
id: string;
role: 'user' | 'assistant';
content: string;
actionPlan?: ActionPlan;
citations?: Citation[];
createdAt: Date;
}
// Render markdown with legal citations highlighted
<ReactMarkdown
remarkPlugins={[remarkGfm]}
components={{
// Custom renderers for citations, tables, etc.
}}
>
{message.content}
</ReactMarkdown>
// Visual step-by-step procedure card
<ActionPlanCard>
<StepTimeline steps={actionPlan.steps} />
<DocumentChecklist documents={step.documents} />
<FeeBreakdown fees={actionPlan.estimated_cost} />
<LegalReferences citations={actionPlan.legal_references} />
</ActionPlanCard>
'use client' only for interactivity