-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SDK | ||
|
||
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: | ||
|
||
- Remotely create, delete, edit templates, generators and data sources | ||
- Write a script that imports data sources from different sources than provided in S&D | ||
- Connect your application to the data from S&D | ||
- Trigger printing | ||
- Create your own UI | ||
|
||
## Architecture | ||
|
||
![arch](../.github/images/snd_arch.png) | ||
|
||
## Protocol | ||
|
||
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: | ||
|
||
- All requests are POST | ||
- The body of the request is a JSON encoded array of arguments (e.g. `["arg1", "arg2", 3, { "hello": "world" }]`) | ||
- All functions are present under ``http://127.0.0.1:7123/api/FUNCTION_NAME`` | ||
- You can get a basic overview about the available functions via ``http://127.0.0.1:7123/api/functions`` |