docs: restructure server and web documentation into ADR files and a
routing table
This commit is contained in:
+33
-30
@@ -1,22 +1,30 @@
|
||||
# MyGO Web
|
||||
|
||||
MyGO's browser client is a pure client-side rendered application built with React, TypeScript, and Vite.
|
||||
MyGO Web is a client-side React application built with TypeScript and Vite.
|
||||
|
||||
## Development
|
||||
## Setup
|
||||
|
||||
Install the repository-pinned Go and Node.js versions from the repository root:
|
||||
Install the pinned toolchains from the repository root:
|
||||
|
||||
```bash
|
||||
mise install
|
||||
```
|
||||
|
||||
Start the Go API from the repository root:
|
||||
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 through the existing public API if needed:
|
||||
Create a development account when needed:
|
||||
|
||||
```bash
|
||||
curl --request POST http://127.0.0.1:10086/api/v1/auth/register \
|
||||
@@ -24,42 +32,47 @@ curl --request POST http://127.0.0.1:10086/api/v1/auth/register \
|
||||
--data '{"username":"web-user","email":"web@example.com","password":"password123"}'
|
||||
```
|
||||
|
||||
Then start the browser client from `web/`:
|
||||
Start Vite from `web/`:
|
||||
|
||||
```bash
|
||||
mise exec -- npm ci
|
||||
mise exec -- npm run dev
|
||||
```
|
||||
|
||||
Vite proxies `/api` to `http://127.0.0.1:10086`. Production deployments must serve the static build and `/api/v1` from the same origin, normally through a reverse proxy.
|
||||
Vite proxies `/api` to `http://127.0.0.1:10086`. Production deployments serve the static build and `/api/v1` from the same origin.
|
||||
|
||||
## Browser Testing and Debugging
|
||||
## Checks
|
||||
|
||||
The Web project uses the Playwright `@playwright/test` for both repeatable E2E tests and interactive browser debugging. The npm cache, browser binaries, CLI daemon state, screenshots, traces, and videos stay under the repository-level ignored `.cache/` and `.artifacts/` directories.
|
||||
Run the Web checks from `web/`:
|
||||
|
||||
Install the Debian browser dependencies once per development container:
|
||||
```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 matching bundled Chromium revision:
|
||||
Install the repository-pinned Chromium revision:
|
||||
|
||||
```bash
|
||||
mise exec -- npm run playwright:install
|
||||
```
|
||||
|
||||
E2E tests and interactive debugging intentionally share the same stable Playwright core and browser revision.
|
||||
|
||||
Currently Playwright's version is locked by the only `@playwright/test` dependency. Standalone `@playwright/cli` or `@playwright/mcp` won't be added unless additional requirement.
|
||||
|
||||
Run the headless browser tests with Chromium sandboxing enabled:
|
||||
Run the headless E2E tests:
|
||||
|
||||
```bash
|
||||
mise exec -- npm run test:e2e
|
||||
```
|
||||
|
||||
Run interactive commands through the repository wrapper:
|
||||
## Browser Debugging
|
||||
|
||||
Use the repository wrapper for interactive diagnostics:
|
||||
|
||||
```bash
|
||||
mise exec -- npm run playwright:cli -- open http://127.0.0.1:5173/login
|
||||
@@ -70,16 +83,6 @@ mise exec -- npm run playwright:cli -- screenshot --filename=.artifacts/playwrig
|
||||
mise exec -- npm run playwright:cli -- close
|
||||
```
|
||||
|
||||
The wrapper changes to the repository root before invoking the stable `playwright cli` bundled with the locked test runner. This loads `.playwright/cli.config.json`, which selects bundled Chromium in headless, isolated, sandboxed mode and limits generated output under `.artifacts/playwright-cli/` to 100 MB.
|
||||
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-cli`, a global Playwright installation, or a floating `npx` package.
|
||||
|
||||
If the upstream CLI entry point changes, update only the `playwright:cli` npm script. Agents should follow the repository-scoped `$playwright-cli` Skill in `.agents/skills/playwright-cli/` for snapshots, sessions, network diagnosis, test debugging, and artifact handling.
|
||||
|
||||
## Checks
|
||||
|
||||
```bash
|
||||
mise exec -- npm run check
|
||||
```
|
||||
|
||||
The production build is emitted to `dist/` as static assets. Browser E2E tests are run separately because they require the browser setup above. See `docs/web/roadmap.md` at the repository root for architecture boundaries and planned dependencies.
|
||||
Do not invoke Playwright through a global installation or a floating `npx` package. Agents use the repository-scoped `$playwright-cli` skill for browser work.
|
||||
|
||||
Reference in New Issue
Block a user