Skip to content
YEMS edited this page Oct 21, 2026 · 15 revisions

Client development

English · 한국어

Applies to the Miroven v1.1.0 client. Place the client in Miroven/ and the API checkout beside it in Miroven-API/. Requires Node.js 22.13 or later and npm; the combined development stack also needs Docker Compose with a Linux engine.

CI and Docker builds use Node.js 24.22.1; the minimum supported development version remains Node.js 22.13. The Docker build stage uses node:24.22.1-bookworm-slim, and the final image serves static files with Nginx. Both CI jobs disable setup-node automatic caching and use the existing manual cache policy with Node 24 keys. JavaScript actions use Node 24 runtimes (Actions Runner 2.327.1 or later).

Local development

From the Miroven root:

cd web
npm ci
npm run dev

With NEXT_PUBLIC_MIROVEN_API_URL unset, the app uses only its local encrypted vault. npm run build creates the static export in web/out/. Use the full build command so CSP and Service Worker post-processing run. See self-hosting for build configuration.

Checks

Run these commands in Miroven/web/:

Command Scope
npm run verify:fast Secret scan, ESLint, and unit tests
npm run verify:full License inspection, fast checks, build, CSP, SW, bundle budgets, rendered HTML, and browser tests
npm run api:generate Copy generated API types from the sibling API checkout
npm run api:check Verify that those types match

Prepare local test browsers with npx playwright install chromium webkit. Checks for a change should cover the affected behavior. A test run is evidence for that environment, not proof of public HTTPS, real SMTP, or physical mobile compatibility. API integration requires the API checkout and a dedicated local development stack; it is separate from local-only browser tests.

The composer becomes interactive after hydration and the initial local journal read. Initial onboarding and iOS storage notices are resolved before the interactive layout is painted; local writing does not wait for account authentication or delayed draft restoration. The static HTML save button starts disabled. composer-startup.spec.ts covers notice timing and unavailable preferences in Chromium, Firefox, and iPhone-emulated WebKit. Quote tests use completed-onboarding preferences and verify quote attachment/removal before continuing; first-visit behavior remains covered separately.

Same-origin development stack

In Miroven-API/:

uv run python scripts/bootstrap_local.py
docker compose -f compose.yaml -f compose.web.yaml up -d --build --wait

The app is at http://localhost:8080 and Mailpit at http://localhost:8025. Bootstrap preserves existing environment files. Stop the stack with down using the same Compose file combination; keep volumes.

Split-origin integration checks

Use only the development Mailpit stack. First stop any same-origin stack with its original Compose file combination. In PowerShell, start this from the API folder:

docker compose -f compose.yaml -f compose.split-dev.yaml up -d --build --wait

Then in Miroven/web/:

$env:NEXT_PUBLIC_APP_URL='http://127.0.0.1:3100'
$env:NEXT_PUBLIC_MIROVEN_API_URL='http://127.0.0.1:8000/api/v1'
npm run build
$env:MIROVEN_INTEGRATION_URL='http://127.0.0.1:3100'
$env:MIROVEN_INTEGRATION_API_ORIGIN='http://127.0.0.1:8000'
npm run test:integration

Playwright starts the static server. Stop the API stack with the same Compose files and down. Integration tests can leave synthetic accounts and ciphertext in the development database; Mailpit does not deliver external email.

For the Free/Pro integration case, add a synthetic email to the dedicated development API's MIROVEN_ADMIN_EMAILS and set MIROVEN_INTEGRATION_ADMIN_EMAIL to that same address when running test:integration. This case signs in both member and administrator through Mailpit and verifies server-driven trial, cancellation, expiry and quota display. Without the administrator setting it is reported separately as skipped; the existing sync/deletion cases still run.

Distinguish sandbox connection/file restrictions from application failures. If needed, point TEMP and TMP to the ignored web/.local/tmp for Vitest caches. Follow the repository's web/AGENTS.md when using coding agents.

GitHub Actions verification

.github/workflows/ci.yml installs Chromium, Firefox, and WebKit for local browser checks, and Chromium for the combined API/sync checks. Before Playwright installs Linux dependencies, both jobs disable APT source files in /etc/apt/sources.list.d/ that reference packages.microsoft.com on the disposable runner. These feeds are not required for the tested browsers; an unrelated Microsoft repository outage must not block Ubuntu dependency installation. APT signature verification and Playwright installation failures still fail the job.

The integration job collects Docker logs on failure and tears down the stack only after API bootstrap succeeds and Compose startup is attempted, including partially failed startup. Failures before that point do not run Compose against missing environment files. The Playwright integration report is uploaded only when the test step fails.

Actions cache budget

GitHub Free includes 10 GiB of Actions cache storage per repository, separate from artifacts. Keep the repository's Settings → Actions → General → Cache size eviction limit at 10 GB to stay within the included storage; a higher configured limit can incur charges. GitHub normally expires caches unused for seven days and evicts the least recently accessed entries when the repository limit is reached. The workflow does not change repository storage or billing settings. See GitHub's cache limits.

The CI policy limits cache growth:

  • Only a successful verify job on the default branch saves caches. PRs, other branches, and integration jobs restore without creating additional entries.
  • Both jobs share npm's ~/.npm/_cacache, keyed by OS, architecture, Node major version, and lockfile. npm ci --prefer-offline still installs and verifies the locked dependencies on every run.
  • verify also caches only web/.next/cache, with keys covering the lockfile and build inputs. Changed sources can reuse an earlier cache with the same dependencies; exact hits are not uploaded again. Integration builds remain fresh apart from shared npm downloads.
  • Each upload is skipped if its uncompressed directory exceeds 512 MiB. Repository-wide storage is bounded by GitHub's 10 GiB eviction setting, not this per-entry check. Cache service failures do not fail verification.
  • Playwright browsers, Docker layers, Python environments, node_modules, static exports, and environment files are not added to the Actions cache.

GitHub security automation

The client uses .github/workflows/codeql.yml for JavaScript/TypeScript and GitHub Actions analysis with the security-extended query suite. It runs on pull requests, pushes to main, weekly on Monday at 03:23 Asia/Seoul, and manual dispatch. Analysis does not install application dependencies or build the app.

.github/dependabot.yml checks npm in /web, GitHub Actions, and root Dockerfile images weekly on Monday at 09:00 Asia/Seoul. npm and Actions minor/patch version updates are grouped; major updates remain separate. Security updates are controlled separately in repository settings. Updates are reviewed and verified before merging.

.github/workflows/dependency-review.yml runs on every pull request. It fails when a dependency change introduces a known vulnerability rated moderate or above, including runtime, development, and unknown scopes. Existing license checks remain in the main CI workflow.

To activate these files, merge them into the default branch. In Settings → Advanced Security (or Code security), enable the dependency graph, Dependabot alerts, and Dependabot security updates. Use CodeQL advanced setup for the committed workflow; disable any existing default setup to avoid duplicate/conflicting scans. After the first successful runs, require Dependency Review and the CodeQL analysis checks in the main branch ruleset if they should block merging. CodeQL findings are managed in code scanning; an analysis job completing successfully does not mean no findings exist. Use code scanning merge protection for an alert-severity gate.

Workflow configuration does not itself enable repository settings or branch protection. Confirm actual Actions runs and Security alerts after merging. See the Dependency Review action for prerequisites and check behavior.

Clone this wiki locally