Accounting support service "Jomon" frontend / 会計支援サービス Jomon のフロントエンド
- Frontend repository for the accounting support service Jomon, developed and operated by the Digital Creation Club traP.
- Built with Vue 3 + TypeScript on top of Vite, following a feature-based module structure for maintainability.
- Uses the OpenAPI-generated TypeScript client for type-safe integration with the backend.
- Framework: Vue 3 (Composition API)
- Build: Vite 7, vue-tsc
- State Management: Pinia
- HTTP Client: axios
- Styling: Tailwind CSS 4, custom components
- Testing & Quality: ESLint, Prettier, vue-axe, MSW
- Node.js 22.12 or higher (Vite 7 requires Node.js 20.19+ / 22.12+; using the latest LTS is recommended)
- npm (bundled with Node.js)
- JVM (Java 17+ recommended for OpenAPI Generator)
We recommend locking Node.js versions via tools like Volta or fnm for consistent local environments.
-
Install dependencies.
npm install
-
Configure environment variables.
- Place
.env.localat the project root and define settings with theVITE_prefix.
- Place
-
Start the development server.
npm run dev
- Vite boots at
http://localhost:5173by default with hot module replacement enabled.
- Vite boots at
| Command | Description |
|---|---|
npm run dev |
Start the Vite development server. |
npm run build |
Run vue-tsc --noEmit then produce a production build with Vite. |
npm run serve |
Preview an existing production build via vite preview. |
npm run build:watch |
Continuously watch and rebuild during development. |
npm run lint |
Execute ESLint with automatic fixes. |
npm run lint:nofix |
Execute ESLint without applying fixes. |
npm run type-check |
Run type-only checks using vue-tsc --noEmit. |
npm run format |
Format code using Prettier. |
npm run format:check |
Verify formatting differences with Prettier. |
npm run gen-api |
Generate the TypeScript client from the OpenAPI schema. |
npm run clean |
Remove generated API clients in src/lib/apis/generated. |
After
npm install, thepostinstallscript automatically triggersnpm run gen-api. When the API schema changes, runnpm run clean && npm run gen-apimanually.
src/
components/ Reusable UI components
features/
<feature>/
entities.ts Domain entities and seed types
store.ts Pinia store (added per feature as needed)
composables.ts Composition API utilities (optional)
data/ Layer handling OpenAPI data
repository.ts API access using the generated client
converter.ts Mapping between generated and domain models
*.ts Feature-specific utilities
__mocks__/ MSW handlers and mock data
lib/apis/generated/ Auto-generated OpenAPI client (Do not edit)
pages/ Page-level Vue components
styles/ Global styles
GET flows convert generated models to domain models in data/converter.ts, while POST/PUT requests transform domain models back to generated schemas in data/repository.ts. Each feature includes only the stores or composables it truly needs.
- Implement with the Composition API under TypeScript
strictmode. - Use kebab-case for file names, PascalCase for types/interfaces, and prefix composables with
use. - Keep formatting consistent with Prettier (2 spaces, single quotes); run
npm run formatbefore committing. - Rely on ESLint (
plugin:vue/strongly-recommended,vuejs-accessibility) and verify ARIA attribute/label pairing. - Perform manual accessibility checks with
vue-axefor key forms and dialogs.
- Static checks:
npm run lint,npm run type-check - For UI logic tests, use Vue Test Utils with MSW, reusing handlers under
src/features/<feature>/__mocks__. - Conduct accessibility validation on major forms/dialogs with
vue-axeduring manual testing.
- Update
openapitools.jsonandscripts/generate-apis.tsto sync schema changes. - Run
npm run gen-apito regenerate clients undersrc/lib/apis/generated. - Commit generated artifacts so reviewers can track differences.
- To refresh the MSW worker, run
npx msw init public/ --save.
- 会計支援サービス Jomon のフロントエンドリポジトリです。デジタル創作同好会 traP で開発・運用しています。
- Vue 3 + TypeScript と Vite を用い、機能単位のモジュール構成で保守性を高めています。
- OpenAPI から生成した TypeScript クライアントを活用し、バックエンドと型安全に連携します。
- フレームワーク: Vue 3 (Composition API)
- ビルド: Vite 7, vue-tsc
- 状態管理: Pinia
- HTTP クライアント: axios
- スタイル: Tailwind CSS 4, 自作コンポーネント
- テスト/品質: ESLint, Prettier, vue-axe, MSW
- Node.js 22.12 以上 (Vite 7 が要求する Node.js 20.19+ / 22.12+ を満たすため最新 LTS を推奨)
- npm (Node.js に同梱)
- JVM (OpenAPI Generator 利用のため Java 17 以上を推奨)
Node.js 環境は Volta や fnm などのバージョンマネージャで固定すると安定します。
-
依存パッケージをインストールします。
npm install
-
環境変数ファイルを設定します。
- プロジェクトルートに
.env.localを配置し、VITE_プレフィックス付きで設定を記述します。
- プロジェクトルートに
-
開発サーバーを起動します。
npm run dev
- 既定では
http://localhost:5173で Vite の開発サーバーが起動し、HMR が有効になります。
- 既定では
| コマンド | 説明 |
|---|---|
npm run dev |
Vite の開発サーバーを起動します。 |
npm run build |
vue-tsc --noEmit で型検証後、Vite で本番ビルドを生成します。 |
npm run serve |
生成済みビルドを vite preview で確認します。 |
npm run build:watch |
監視モードでビルドを実行します。 |
npm run lint |
ESLint を自動修正付きで実行します。 |
npm run lint:nofix |
自動修正なしで ESLint を実行します。 |
npm run type-check |
vue-tsc --noEmit による型検証のみを実行します。 |
npm run format |
Prettier でコード整形を行います。 |
npm run format:check |
Prettier の整形差分を確認します。 |
npm run gen-api |
OpenAPI スキーマから TypeScript クライアントを生成します。 |
npm run clean |
生成済み API クライアント (src/lib/apis/generated) を削除します。 |
npm install後にpostinstallスクリプトでnpm run gen-apiが自動実行されます。API スキーマ更新時はnpm run clean && npm run gen-apiを手動で再実行してください。
src/
components/ 再利用可能な UI コンポーネント
features/
<feature>/
entities.ts ドメインエンティティとシード型
store.ts Pinia ストア (必要な機能のみ配置)
composables.ts Composition API ベースのユーティリティ (任意)
data/ OpenAPI 由来データを扱う層
repository.ts 生成クライアントを利用した API アクセス
converter.ts 生成型とドメイン型の相互変換
*.ts feature 固有の補助ロジック
__mocks__/ MSW 用のモックハンドラとデータ
lib/apis/generated/ OpenAPI から自動生成されたクライアント (編集禁止)
pages/ 画面単位の Vue コンポーネント
styles/ グローバルスタイル
GET 系データは data/converter.ts で生成型からドメイン型へ、POST/PUT 時は data/repository.ts でドメイン型から生成型へ変換しながら送信する設計です。store.ts や composables.ts は feature ごとに必要なもののみ配置しています。
- TypeScript
strict設定のもとで Composition API を用いて実装します。 - ファイル命名はケバブケース、型・インターフェースはパスカルケース、Composable は
useプレフィックスで統一します。 - Prettier (2 スペース・シングルクォート) で整形し、コミット前に
npm run formatを推奨します。 - ESLint (
plugin:vue/strongly-recommended,vuejs-accessibility) を活用し、ARIA 属性とラベルの対応を確認します。 - 主要フォームやダイアログでは
vue-axeを活用した手動アクセシビリティ検証を行います。
- 静的解析:
npm run lint,npm run type-check - UI ロジックの自動テストを追加する場合は Vue Test Utils と MSW を利用し、モックは
src/features/<feature>/__mocks__を再利用します。 - 主要なフォーム・ダイアログでは
vue-axeを併用してアクセシビリティ検証を行ってください。
openapitools.jsonとscripts/generate-apis.tsを更新してスキーマを同期します。npm run gen-apiを実行し、src/lib/apis/generatedにクライアントを再生成します。- 生成物はコミットし、差分がレビューできるようにしてください。
- MSW のワーカーを更新する際は
npx msw init public/ --saveを利用します。