Frontend scaffold for an AI-native Data Agent Platform.
- React 18 + TypeScript + Vite
- Tailwind CSS + shadcn/ui (new-york style, classic light SaaS palette)
- Zustand (global UI + locale stores; feature-level stores per module)
- React Router v6 (feature-composed routes)
- react-i18next (zh-CN default, en-US fallback; per-feature namespaces)
- Mock API client (
src/lib/mock-client.ts) — swap-point for a real HTTP client
npm install
npm run dev # vite dev server on :5173
npm run build # type-check + production build
npm run preview # preview the production build
npm run lint # eslint
npm run typecheck # tsc --noEmitsrc/
app/ # providers, router, App
components/
ui/ # shadcn primitives (button, tooltip)
layout/ # AppShell, Sidebar, TopBar, ModulePlaceholder
features/
knowledge-graph/ # implemented entry
data-source/ # TODO
agents/ # TODO
workflow/ # TODO
insights/ # TODO
settings/ # TODO
stores/ # global Zustand stores
lib/ # cn(), i18n, mock-client
locales/ # global `common` namespace (zh-CN / en-US)
styles/globals.css # design tokens, dark theme
- Create
src/features/<name>/. - Add
routes.tsxexporting aRouteObject[]. - (Optional)
api/mock.tswithregisterMockRoute(...)calls, imported for side effects fromroutes.tsx. - (Optional)
store.tsfor feature-local Zustand state. - (Optional)
locales/{zh-CN,en-US}.jsonand register the namespace insrc/lib/i18n.ts. - Register the feature's routes in
src/app/router.tsx. - Add a sidebar entry in
src/components/layout/Sidebar.tsxand copy insrc/locales/*/common.jsonundernav.*.
Classic light SaaS admin palette with a blue primary accent. Tokens live in src/styles/globals.css; Tailwind reads them via tailwind.config.ts. Fonts: Space Grotesk (UI) + IBM Plex Mono (numerics/labels), loaded from Google Fonts in index.html.
import { mockClient, registerMockRoute } from "@/lib/mock-client";
registerMockRoute("GET", "/api/example", () => ({ ok: true }));
const data = await mockClient.get<{ ok: boolean }>("/api/example");When backing the app with a real API, replace the dispatch body in src/lib/mock-client.ts with a real fetch/axios call.
| Module | Path | State |
|---|---|---|
| Knowledge Graph | /knowledge-graph |
scaffolded (UI shell + mock overview) |
| Data Sources | /data-source |
TODO placeholder |
| Agents | /agents |
TODO placeholder |
| Workflows | /workflow |
TODO placeholder |
| Insights | /insights |
TODO placeholder |
| Settings | /settings |
TODO placeholder |