Simple web client for Traque - error and event tracking for startups. This app is built with React, Vite, TanStack Router/Query, and Tailwind CSS. It connects to the Traque API.
Learn more about the product on the Traque website.
Prerequisites:
- Node.js 20+ (or Bun 1.1+)
Install dependencies:
# with Bun (recommended)
bun install
# or with npm
npm install
# or with pnpm / yarn
pnpm install
yarn installCreate an .env file:
cp .env.example .envThen set the required variable:
VITE_API_URL=http://localhost:8080Run the app:
# dev server on http://localhost:5000
bun run dev
# or
npm run devWe use the Vercel AI SDK (@ai-sdk/react + ai) to stream chat responses and tool calls. The chat UI lives in src/routes/_authenticated/dashboard/chat/$chatId.tsx and uses useChat with DefaultChatTransport to connect to the backend:
-
Transport: streams from
POST ${VITE_API_URL}/api/v1/ai/agents/:projectId/chat, sendingthreadMetadata.id(the chat id) plus optional filters (dateFrom,dateTo). -
Parts rendering: each message arrives as parts. We render:
- text via a
Streamdown-poweredResponsecomponent - reasoning in a collapsible panel
- tool-… parts with custom UI per tool
- text via a
-
Tool states: tools stream through states (
input-streaming→input-available→output-availableoroutput-error). We expose a generic tool UI insrc/components/ai/tool.tsx(status badges, params JSON, result/error panel) and add bespoke renderers for productized tools likegetExceptionStatistic(chart above).
To add a new tool renderer, add a new case 'tool-yourToolName' in the switch and return the appropriate component. For generic debugging, use the Tool, ToolInput, and ToolOutput components.
dev: start Vite dev server (port 5000)start: same asdevbuild: production build with Vite + type-check with TypeScriptserve: preview the production buildtest: run unit tests with Vitestformat: format code with Biomelint:fix: check and fix with Biome
We validate VITE_API_URL at runtime. If it is missing or invalid, the app will fail early to avoid silent misconfigurations. Set it to your API base URL.
- React 19, Vite 6
- TanStack Router + TanStack Query
- Tailwind CSS 4
- Radix UI primitives
- Vitest + Testing Library
- Biome for formatting and linting
src/routes: app routes (file-based routing with TanStack Router)src/api: API clients and hookssrc/components: UI componentssrc/config: environment config (VITE_API_URL)src/lib: shared libraries (auth, utils, etc.)
bun run build creates a static build in dist/. Serve it with any static host or reverse proxy. Remember: Vite env vars are injected at build time.
- App fails to start: check
.envand ensureVITE_API_URLis set. - Port in use: change the port in
package.jsonscripts or stop the other process. - API CORS errors: verify your backend CORS settings and the
VITE_API_URLvalue.
Traque is a simple, effective error and event tracking service with a mobile app. See setup examples and product info on the Traque website.