You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a React 19 + TypeScript Vite frontend for the CLI Proxy API Management API. Main source lives in `src/`: routes in `src/router`, pages in `src/pages`, components in `src/components`, API clients in `src/services/api`, state in `src/stores`, hooks in `src/hooks`, styles in `src/styles`, and types in `src/types`. Assets live in `src/assets`, with provider icons under `src/assets/icons`. Localization files are in `src/i18n/locales`; update all supported locales when adding user-facing text. Production output is `dist/index.html`.
6
+
7
+
## Build, Test, and Development Commands
8
+
9
+
-`bun install --frozen-lockfile`: install dependencies from `bun.lock`.
10
+
-`bun run dev`: start the Vite dev server at `http://localhost:5173`.
11
+
-`bun run build`: run TypeScript compilation and build `dist/`.
12
+
-`bun run preview`: serve the built output locally.
13
+
-`bun run test`: run the Bun test suite.
14
+
-`bun run lint`: run ESLint over TypeScript/TSX files.
15
+
-`bun run verify`: run tests, lint, TypeScript compilation, and the production build.
16
+
-`bun run type-check`: run `tsc --noEmit`.
17
+
-`bun run format`: apply Prettier to `src/**/*.{ts,tsx,css,scss}`.
18
+
19
+
## Coding Style & Naming Conventions
20
+
21
+
Use 2-space indentation, semicolons, single quotes, ES5 trailing commas, and 100-character line width. Prefer typed React components and avoid new `any` unless it marks a boundary. Use the `@/` alias for `src` imports. Component files use PascalCase, hooks use `useName`, API modules use domain names such as `oauth.ts`, and SCSS Modules sit beside their page or component as `Name.module.scss`.
22
+
23
+
## Testing Guidelines
24
+
25
+
Tests use Bun's built-in test runner and are colocated under `tests/` as `*.test.ts`. Run `bun run test` for focused test work and `bun run verify` before handoff. Use `bun run type-check` as a fast standalone TypeScript check. For UI changes, verify the affected route in the browser and include screenshots or notes.
26
+
27
+
## Commit & Pull Request Guidelines
28
+
29
+
Git history follows Conventional Commit style, for example `feat: add support for xAI provider`, `fix(auth-files): keep disabled card actions visible`, and `ci: use node 24 for releases`. Keep commits focused and scoped when useful. Pull requests should include a change summary, linked issue when applicable, UI screenshots, backend version or reproduction details for integration work, and verification notes.
30
+
31
+
## Architecture & Configuration Notes
32
+
33
+
This UI is not the proxy; it talks to the backend Management API under `/v0/management`. Treat backend contracts as the source of truth. For OAuth/provider changes, inspect `../CLIProxyAPI` before changing route names, provider keys, callback parameters, or auth-file semantics. Store no secrets in the repo; management keys are entered at runtime and persisted only in browser storage.
-**System**: quick links, update check, request logging toggle, local login data cleanup, and fetch `/v1/models` (grouped view). Requires at least one proxy API key to query models.
88
86
@@ -140,7 +138,9 @@ The UI language is automatically detected from browser settings and can be manua
140
138
bun run dev # Vite dev server
141
139
bun run build # tsc + Vite build
142
140
bun run preview # serve dist locally
141
+
bun run test# Bun test suite
143
142
bun run lint # ESLint (fails on warnings)
143
+
bun run verify # test + lint + build
144
144
bun run format # Prettier
145
145
bun run type-check # tsc --noEmit
146
146
```
@@ -151,7 +151,7 @@ Issues and PRs are welcome. Please include:
151
151
152
152
- Reproduction steps (server version + UI version)
153
153
- Screenshots for UI changes
154
-
- Verification notes (`bun run lint`, `bun run type-check`, `bun run build`)
154
+
- Verification notes (`bun run verify`, plus `bun run type-check` when run separately)
0 commit comments