DEV Community

tdk-cli
tdk-cli

Posted on

Walking Through the Finance Stack in an ERP With TDK CLI

The finance stack is the first place many people look in an ERP, and in the tdk-erp-system example it is one of seven domain stacks. It contains fifteen resources: fourteen backend APIs and one React dashboard. This article walks through what they are, how to start them, and how to check them.

What runs

The backends are Hono 4 services on Bun. Each one covers one part of financial work:

  • general-ledger-api handles core financial accounting.
  • accounts-payable-api manages vendor payments.
  • accounts-receivable-api handles customer invoicing.
  • budgeting-api covers budget planning and control.
  • financial-reporting-api produces financial statements.
  • tax-compliance-api handles tax calculation and filing.
  • payroll-processing-api calculates payroll.
  • revenue-recognition-api covers revenue accounting.
  • audit-trail-api logs financial audit events.

Others cover expenses, fixed assets, cash flow, banking connectivity, cost allocation, and financial analytics. The frontend, finance-dashboard-app, is a Vite 5 and React app for executives.

Ports

The backends use ports 4010 to 4024, and the dashboard uses port 3010. Each backend exposes a /health route, which the README links directly, so you can check a service in a browser or with curl.

Starting the stack

With Docker running and TDK CLI installed, start the finance stack from the repository root:

tdk doctor --json
tdk up finance
Enter fullscreen mode Exit fullscreen mode

Before starting, you can read the plan without starting anything:

tdk up finance --dry-run
Enter fullscreen mode Exit fullscreen mode

Checking it

Ask for readiness rather than assuming it:

tdk status --json
Enter fullscreen mode Exit fullscreen mode

If a service fails, read its recent output:

tdk logs --json --service general-ledger-api --tail 200
Enter fullscreen mode Exit fullscreen mode

Open the dashboard on port 3010 once the backends report ready. If the dashboard loads but shows errors, start with the backend it calls, not the dashboard.

Dependencies

Services declare their dependencies in service.json, using dependsOn. A reporting service that reads from the ledger should list the ledger as a dependency, so TDK starts the ledger first. The finance stack is a good place to check how that works, because most of its services share the ledger's data.

Stopping

When you are done, stop the stack:

tdk down
Enter fullscreen mode Exit fullscreen mode

Summary

The finance stack is fifteen resources on known ports, started with one command and checked with two. Keep the readiness output in view, read logs for the first error, and check the backend before the dashboard.

Top comments (0)