Repository navigation
Client Development
English · 한국어
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 select their build runtimes in the repository's Dockerfile and .github/workflows/ci.yml; the final image serves static files with Nginx. Both application CI jobs disable setup-node automatic caching and use the explicit shared cache policy below. Check each Action's declared runtime and runner requirements when upgrading it.
The Node type declarations in web/package.json should match the CI/Docker runtime major. Type declarations do not install or upgrade Node, and passing type checks against a newer declaration set does not establish compatibility with the minimum runtime in engines.node.
For development, check out the client in Miroven/ and API beside it in Miroven-API/. For a reproducible deployment, choose a compatible tag or full commit SHA for each repository and check out those refs before building. Keep the API beside the client or adjust sibling paths used by scripts. Record both refs and any uncommitted changes in verification records.
Use web/package.json for supported runtime requirements and declared dependencies, web/package-lock.json for resolved dependency versions, and npm ci to reproduce that lockfile. Installed node_modules may be stale; a package version alone does not identify a source snapshot.
From the Miroven root:
cd web
npm ci
npm run devWith 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.
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 firefox 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.
In Miroven-API/:
uv run python scripts/bootstrap_local.py
docker compose -f compose.yaml -f compose.web.yaml up -d --build --waitThe 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.
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 --waitThen 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:integrationPlaywright 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/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.
CI retries Playwright installation up to three times with 30 seconds between attempts for temporary CDN/download failures. TLS certificate verification remains enabled; installation still fails the job if all attempts fail.
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
verifyjob 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-offlinestill installs and verifies the locked dependencies on every run. -
verifyalso caches onlyweb/.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.
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.
Dependabot major version updates for @types/node, Docker node, and GitHub Actions are ignored; review runtime and runner compatibility and upgrade them manually. Read the current lockfile for the test-runner version.
.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.
The contribution policy requires Conventional Commit PR titles and squash merge messages. Types/scopes, compatibility explanations and the independent client release process are defined in CONTRIBUTING and the bilingual release guide.
Release Please is configured to collect repository-wide changes, propose synchronized version/lockfile/CHANGELOG updates, and publish a source GitHub Release when its checked release PR is merged. Current version state and the first-run comparison ref are defined in .release-please-manifest.json and release-please-config.json; bootstrap history and recovery instructions live in the repository's release guide.
The new Commit and release policy workflow validates titles and synchronized versions using Python 3.12 standard-library scripts in .github/scripts/. GitHub App variable/secret, squash-message settings and required checks need separate activation; committed files do not configure them. The release App must not bypass checks. Initially a maintainer merges release PRs; no production deployment, environment-specific ZIP or npm publication is added. Build the selected tag with the intended public URLs. See the release guide for first-run review, tests and recovery.
- Client development · 클라이언트 개발
- Self-hosting · 자체 호스팅
- PWA, offline use, and updates · PWA·오프라인·업데이트
- Client performance · 클라이언트 성능
- Architecture · 아키텍처
- Cryptographic format · 암호화 형식
- Image processing · 사진 처리
- Security model · 보안 경계
- Product principles · 제품 원칙
- Dependency licenses · 의존성 라이선스
- Account and sync · 계정과 동기화
- Backup and recovery · 백업과 복구
- Entry quotes · 기록 인용
- Profile document · 프로필 문서