Files
mygo/web/README.md
T

89 lines
2.1 KiB
Markdown

# MyGO Web
MyGO Web is a client-side React application built with TypeScript and Vite.
## Setup
Install the pinned toolchains from the repository root:
```bash
mise install
```
Install Web dependencies from `web/`:
```bash
mise exec -- npm ci
```
## Development
Start the API from the repository root:
```bash
mise exec -- go run . serve
```
Create a development account when needed:
```bash
curl --request POST http://127.0.0.1:10086/api/v1/auth/register \
--header 'Content-Type: application/json' \
--data '{"username":"web-user","email":"web@example.com","password":"password123"}'
```
Start Vite from `web/`:
```bash
mise exec -- npm run dev
```
Vite proxies `/api` to `http://127.0.0.1:10086`. Production deployments serve the static build and `/api/v1` from the same origin.
## Checks
Run the Web checks from `web/`:
```bash
mise exec -- npm run check
```
The command runs linting, unit tests, type checking, and the production build.
## Browser Testing
Install the Debian browser libraries once per development container:
```bash
mise exec -- npm run playwright:install:deps
```
Install the repository-pinned Chromium revision:
```bash
mise exec -- npm run playwright:install
```
Run the headless E2E tests:
```bash
mise exec -- npm run test:e2e
```
## Browser Debugging
Use the repository wrapper for interactive diagnostics:
```bash
mise exec -- npm run playwright:cli -- open http://127.0.0.1:5173/login
mise exec -- npm run playwright:cli -- snapshot
mise exec -- npm run playwright:cli -- console
mise exec -- npm run playwright:cli -- requests
mise exec -- npm run playwright:cli -- screenshot --filename=.artifacts/playwright-cli/login.png
mise exec -- npm run playwright:cli -- close
```
The wrapper uses the pinned `@playwright/test` package, bundled Chromium, and `.playwright/cli.config.json`. Browser caches and generated artifacts stay under the repository-level `.cache/` and `.artifacts/` directories.
Do not invoke Playwright through a global installation or a floating `npx` package. Agents use the repository-scoped `$playwright-cli` skill for browser work.