Skip to content

Commit 41e00bc

Browse files
committed
docs: sdk docs
1 parent 07fe179 commit 41e00bc

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

sdk/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SDK
2+
3+
Although Sales & Dungeons runs as a local application it is split into a backend (handling the database, printing and more) and the UI (handling the visual interface). Backend and frontend communicate via HTTP requests like typical web applications. This has the nice side effect that other applications can also interact with the S&D. Some examples of what you could do:
4+
5+
- Remotely create, delete, edit templates, generators and data sources
6+
- Write a script that imports data sources from different sources than provided in S&D
7+
- Connect your application to the data from S&D
8+
- Trigger printing
9+
- Create your own UI
10+
11+
## Architecture
12+
13+
![arch](../.github/images/snd_arch.png)
14+
15+
## Protocol
16+
17+
Communication is done via HTTP POST requests only, because I'm using my own mini-rpc framework which makes it very simple to make go functions available to a frontend. It's called `nra`, and you can find more about it [here](https://github.com/BigJk/nra). In essence:
18+
19+
- All requests are POST
20+
- The body of the request is a JSON encoded array of arguments (e.g. `["arg1", "arg2", 3, { "hello": "world" }]`)
21+
- All functions are present under ``http://127.0.0.1:7123/api/FUNCTION_NAME``
22+
- You can get a basic overview about the available functions via ``http://127.0.0.1:7123/api/functions``

0 commit comments

Comments
 (0)