Monja Accounting
日本語 | English | 简体中文
日本語 — 会計帳簿
ブラウザーから日々の仕訳、帳簿の確認、決算資料の作成を行う会計アプリケーションです。Windows環境でNode.jsとSQL Serverを使用し、会社・会計期間ごとに会計データを管理します。画面は日本語です。
主な機能
- 仕訳管理:仕訳入力、仕訳帳、日付・科目・摘要・金額などによる検索。
- 帳簿・財務諸表:総勘定元帳、試算表、損益計算書(P/L)、貸借対照表(B/S)。
- 科目管理:勘定科目・補助科目の管理、補助名の自由入力と候補検索、補助元帳・残高一覧。
- 会計期間・期首残高:会計期間の管理と期首残高の入力。
- 消費税:税区分・設定、消費税集計表、消費税関連仕訳の作成支援。
- データ連携:CSV取込・出力。
- 運用管理:ログイン認証、会社ごとの所有者によるアクセス制御、監査ログ、同時更新の検出。
動作環境
- Node.js 22以降、npm
- SQL Server 2022または2025(接続可能なデータベース)
- Webブラウザー
- Windowsでの公開運用には、IISの設定例とサービス関連ファイルを同梱しています。
セットアップ
-
プロジェクトのルートで依存パッケージをインストールします。
npm ci
Copy-Item .env.example .env
-
空のデータベースを作成し、そのデータベースに対して sql/01-create-tables.sql を実行します。補助科目検索用の追加インデックスは sql/03-subaccount-search-index.sql と 統合資料 を参照してください。
-
.env に接続先を設定します。DB_NAME は作成したデータベース名に合わせ、DB_SERVER、DB_PORT、DB_USER、DB_PASSWORD とTLS設定を環境に合わせて指定します。PUBLIC_ORIGIN は公開URLのオリジン(例:https://accounting.example.com)を末尾のスラッシュなしで設定します。
-
認証用の users.json がない場合、APP_PASSWORD 環境変数に16文字以上のパスワードを設定し、次のコマンドを実行します。ユーザー名、会社所有者の識別値、表示名を対話形式で入力します。既存データを利用する場合は所有者の識別値を companies.owner と一致させてください。スクリプトは既存の users.json を上書きしません。
node scripts/create-user.js
Remove-Item Env:APP_PASSWORD
-
アプリケーションを起動します。
npm start
既定の待受先は 127.0.0.1:3000 です。同じPCのブラウザーで http://127.0.0.1:3000 にアクセスし、作成したユーザーでログインします。公開運用ではIISなどのリバースプロキシとHTTPSを構成し、PUBLIC_ORIGIN を実際の公開先に合わせてください。認証情報を含む .env と users.json は公開しないでください。
基本的な使い方
- ログインし、対象の会社と会計期間を選択します。
- 勘定科目、必要な補助科目、税区分、期首残高を設定します。
- 仕訳を入力し、仕訳帳と元帳で内容を確認します。
- 試算表、P/L、B/S、消費税集計表で残高や集計結果を確認します。
- 必要に応じてCSV取込・出力や監査ログを利用します。
構成・確認コマンド
| パス |
内容 |
server.js / lib/ |
HTTPサーバー、認証、会計処理、データベース接続 |
public/ |
配信する画面ファイル |
screen-source/ |
画面のソースコード |
sql/ |
SQL Server用のテーブル作成・索引スクリプト |
scripts/ |
ユーザー作成、データ移行、検証用スクリプト |
installer/ / service/ |
Windowsインストーラー・サービス関連ファイル |
docs/ |
実装・運用に関する補足資料 |
npm run check でサーバーの構文を確認できます。個別機能の検証スクリプトは scripts/verify-*.js にあります。実行条件やデータ変更の有無を各スクリプトで確認してから利用してください。
関連資料・ライセンス
English
A browser-based accounting application for recording journal entries, reviewing ledgers, and preparing financial reports. It runs on Node.js and SQL Server in a Windows environment and organizes accounting data by company and accounting period. The application interface is in Japanese.
Features
- Journal management: entry creation, journal listing, and filtering by date, account, description, amount, and other fields.
- Ledgers and financial statements: general ledger, trial balance, profit and loss statement (P/L), and balance sheet (B/S).
- Accounts and subaccounts: account management, free-text subaccount names with suggestions, subsidiary ledgers, and balance lists.
- Accounting periods and opening balances: period management and opening balance entry.
- Japanese consumption tax: tax codes and settings, tax summaries, and assistance with tax-related journal entries.
- Data exchange: CSV import and export.
- Administration: login authentication, company access based on ownership, audit logs, and concurrent update detection.
Requirements
- Node.js 22 or later and npm
- An accessible SQL Server 2022 or 2025 database
- A web browser
- IIS configuration examples and Windows service files are included for Windows deployment.
Setup
-
Install dependencies from the project root:
npm ci
Copy-Item .env.example .env
-
Create an empty database and run sql/01-create-tables.sql against it. For the additional subaccount search index, see sql/03-subaccount-search-index.sql and the integration notes.
-
Edit .env. Set DB_NAME to the database you created, and configure DB_SERVER, DB_PORT, DB_USER, DB_PASSWORD, and TLS options for your environment. Set PUBLIC_ORIGIN to the public URL origin, such as https://accounting.example.com, without a trailing slash.
-
If an authentication file users.json does not exist, set the APP_PASSWORD environment variable to a password of at least 16 characters, then run the following commands. The script prompts for a username, company owner identifier, and display name. When using existing data, the owner identifier must match companies.owner. The script does not overwrite an existing users.json.
node scripts/create-user.js
Remove-Item Env:APP_PASSWORD
-
Start the application:
npm start
The default listening address is 127.0.0.1:3000. Open http://127.0.0.1:3000 on the same computer and sign in with the user you created. For public deployment, configure HTTPS and a reverse proxy such as IIS, and set PUBLIC_ORIGIN to the actual public origin. Keep .env and users.json, which contain credentials, out of public access.
Basic workflow
- Sign in and select a company and accounting period.
- Configure accounts, any required subaccounts, tax codes, and opening balances.
- Enter transactions and review them in the journal and ledgers.
- Review balances and totals in the trial balance, P/L, B/S, and consumption tax summary.
- Use CSV import/export and audit logs as needed.
Project layout and checks
| Path |
Purpose |
server.js / lib/ |
HTTP server, authentication, accounting logic, and database access |
public/ |
Served frontend files |
screen-source/ |
Frontend source code |
sql/ |
SQL Server table and index scripts |
scripts/ |
User creation, data migration, and verification scripts |
installer/ / service/ |
Windows installer and service files |
docs/ |
Additional implementation and operational notes |
Run npm run check to check the server syntax. Feature verification scripts are available as scripts/verify-*.js. Review each script’s prerequisites and whether it modifies data before running it.
Documentation and license
简体中文 — 会计账簿
通过浏览器录入日常会计分录、查看账簿并编制财务报表的会计应用。系统在 Windows 环境中使用 Node.js 和 SQL Server,按公司和会计期间管理会计数据。应用界面为日语。
主要功能
- 分录管理:录入会计分录,查看分录簿,按日期、科目、摘要、金额等条件查询。
- 账簿与财务报表:总分类账、试算平衡表、损益表(P/L)、资产负债表(B/S)。
- 科目管理:管理会计科目与明细科目,自由输入明细科目名称并查询候选项,查看明细账及余额列表。
- 会计期间与期初余额:管理会计期间并录入期初余额。
- 日本消费税:管理税务分类与设置,查看消费税汇总表,辅助编制相关会计分录。
- 数据交换:CSV 导入与导出。
- 运行管理:登录认证、按公司所有者控制访问权限、审计日志、并发更新检测。
运行环境
- Node.js 22 或更高版本及 npm
- 可连接的 SQL Server 2022 或 2025 数据库
- Web 浏览器
- 项目附带 IIS 配置示例和 Windows 服务相关文件,供 Windows 部署使用。
安装与配置
-
在项目根目录安装依赖:
npm ci
Copy-Item .env.example .env
-
创建空数据库,并在该数据库中执行 sql/01-create-tables.sql。明细科目查询所用的附加索引请参阅 sql/03-subaccount-search-index.sql 和集成说明。
-
编辑 .env,将 DB_NAME 设置为已创建的数据库名称,并根据环境配置 DB_SERVER、DB_PORT、DB_USER、DB_PASSWORD 及 TLS 选项。将 PUBLIC_ORIGIN 设置为对外访问地址的源,例如 https://accounting.example.com,末尾不加斜杠。
-
如果尚无认证文件 users.json,先将 APP_PASSWORD 环境变量设置为至少 16 个字符的密码,再运行以下命令。脚本会提示输入用户名、公司所有者标识和显示名称。使用已有数据时,所有者标识必须与 companies.owner 一致。脚本不会覆盖已有的 users.json。
node scripts/create-user.js
Remove-Item Env:APP_PASSWORD
-
启动应用:
npm start
默认监听地址为 127.0.0.1:3000。在同一台电脑的浏览器中访问 http://127.0.0.1:3000,使用已创建的用户登录。对外部署时,请配置 HTTPS 和 IIS 等反向代理,并将 PUBLIC_ORIGIN 设置为实际对外访问地址的源。请勿公开包含认证信息的 .env 和 users.json。
基本使用流程
- 登录并选择公司和会计期间。
- 设置会计科目、所需的明细科目、税务分类和期初余额。
- 录入会计分录,并在分录簿和分类账中核对。
- 通过试算平衡表、损益表、资产负债表和消费税汇总表查看余额及汇总结果。
- 根据需要使用 CSV 导入、导出及审计日志功能。
项目结构与检查
| 路径 |
用途 |
server.js / lib/ |
HTTP 服务、认证、会计处理与数据库访问 |
public/ |
对外提供的前端文件 |
screen-source/ |
前端源代码 |
sql/ |
SQL Server 建表与索引脚本 |
scripts/ |
用户创建、数据迁移与验证脚本 |
installer/ / service/ |
Windows 安装程序与服务相关文件 |
docs/ |
实现与运行管理补充资料 |
运行 npm run check 可检查服务器代码语法。各功能的验证脚本位于 scripts/verify-*.js。执行前请查看相应脚本的运行条件,以及是否会修改数据。
相关资料与许可证
评论