Accounting DSL

Experiment with JetBrains MPS and transactional UI for automated accounting.

This is one of my most complex experiments, which is indeed two experiments in one: a domain specific language (DSL) for accountants and a transactional UI.

Domain Specific Language

For the language I used the brilliant JetBrain MPS, which provides an IDE for creating and using DSLs. I've created a subset of a natural language (Hungarian) which enables the user to define accounting rule sets.

An excerpt from an accounting rule set in the DSL.

Once ready, the rule set can be compiled into a JSON file, which after feeding it into the Accounting Engine, can be used to calculate TAXes for companies, process invoices or similar tasks.

Transactional UI/UX

The UI part of the experience is about the customers of the accountant. My aim was to create a user experience for this system which is more of a conversation and less a traditional UI. By the way, I wanted to reproduce the way customers communicate with accountants: email and phone.

So the system uses magic links for authentication and the UI is basicaly a set of emails. When the system requires input (information/decision) it sends an email, which contains links for the different options in a decision, or a single link to a data input form.

For a system like this a serverless implementation is very natural. As I've already tried Azure Serverless, this time I went with Vercel Functions and to make the project even more interesting used SvelteKit.

Results

As making a real product from this would require a team and a lot of time, I've decided to only create a small MVP. The system can handle a single way of taxation and calculate the amount of tax to be paid based on real invocing data (from the system of the local authority, NAV) and real account data (using Open Banking APIs). The calculation is executed in an async way, and the user is notified via an email message containing a magic link, which takes her to the generated taxation report.

💡
Stack
Language: TypeScript, JetBrains MPS
Frameworks: SvelteKit, Bulma
Modules: Sendgrid, Storyblok, Nordigen, NAV Online Invoice API
Environment: Browser, Vercel Serverless