Skip to content

Commit a24b57d

Browse files
committed
Add TigerBeetle Schema Wizard
1 parent 712c56a commit a24b57d

File tree

8 files changed

+550
-0
lines changed

8 files changed

+550
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<img src="https://github.com/emschwartz/tigerbeetle-schema-wizard/assets/3262610/046153f4-4657-4109-89b0-cb990b790621" width=200 />
2+
3+
# TigerBeetle Schema Wizard
4+
5+
When using TigerBeetle, you need to model your use case in terms of [ledgers](https://docs.tigerbeetle.com/reference/accounts#ledger), [codes](https://docs.tigerbeetle.com/reference/accounts#code), [accounts](https://docs.tigerbeetle.com/reference/accounts), and [transfers](https://docs.tigerbeetle.com/reference/transfers). That means developers need to first wrap their heads around double-entry bookkeeping in order to take advantage of the power of TigerBeetle.
6+
7+
This project aims to simplify the usage of TigerBeetle by allowing you to define the schema of your business logic in a simple TOML format. It then generates client code in any of the supported languages to make building systems on top of TigerBeetle easy and error-free.
8+
9+
## Contents
10+
11+
- [Schema](./schema.toml)
12+
- [Generated TypeScript client code\*](./src/generated.ts)
13+
- [Example usage script](./src/index.ts)
14+
15+
\* Note: the client code is not currently being generated 😋
16+
17+
## Trying it out
18+
19+
1. [Run TigerBeetle on your local machine](https://docs.tigerbeetle.com/quick-start/single-binary)
20+
2. Clone this repo
21+
3. `npm install`
22+
4. Run `npm run dev` to create two accounts, fund them, and send a transfer between them

projects/tigerbeetle-schema-wizard/package-lock.json

+247
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "tigerbeetle-schema-wizard",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "dist/index.js",
6+
"type": "module",
7+
"scripts": {
8+
"test": "echo \"Error: no test specified\" && exit 1",
9+
"build": "tsc",
10+
"dev": "ts-node ."
11+
},
12+
"author": "",
13+
"license": "ISC",
14+
"devDependencies": {
15+
"@types/node": "^20.9.0",
16+
"ts-node": "^10.9.1",
17+
"type-fest": "^4.6.0",
18+
"typescript": "^5.2.2"
19+
},
20+
"dependencies": {
21+
"tigerbeetle-node": "^0.14.160",
22+
"uuidv7": "^0.6.3"
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This is a simple schema that the TigerBeetle Schema Wizard
2+
# can use to generate client code to interact with TigerBeetle
3+
4+
[ledgers]
5+
6+
[ledgers.eur]
7+
type = "simple_bank_accounts"
8+
9+
[ledgers.usd]
10+
type = "simple_bank_accounts"
11+
allow_negative = false # change this and you're going to jail!

0 commit comments

Comments
 (0)