summaryrefslogtreecommitdiff
path: root/README.md
blob: 0cf0c9d3fe09bba9c3771c9c7e80f35c89ebca86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# suproc

*Suproc* is *corpus* (Latin for "body") spelled backwards. A local-first, privacy-focused spreadsheet app.

## Architecture

Basically, light server and fat client.

### Server

- Server is only used for data transportation and broadcasting. 
- Everything is encrypted before sending to the server and only decrypted on client-side.
- Server is also used for key exchange in between clients.
- Server is optional and everything else works offline.

### Client

- Client is the "Database"
    - Client stores original and copies of sheets.
    - When sharing, the client sends a copy of sheet to the other client
    - Copies across different clients are synced using CRDT through server
    - Client stores data in open formats.
- Client makes data retrieval and manipulation easy and fun
    - Client embeds [Janet](http://janet-lang.org/) to manipulate data (e.g. making HTTP requests, filtering by custom computed fields and etc.)
    - Client supports cron job that updates data (executes Janet script) automatically
    - Client supports custom commands and Vim-like key bindings
- Client is extensible by the power of Lisp
    - Client acts as a Janet interpreter itself, which is sort of like Emacs
    - Client can be extended using plugins written in Janet

## Project structure

This is a monorepo.

```
suproc/
├─docs      # Documentation
├─server    # Server
├─client    # Client core libraries
├─web       # web wrapper of client
└─desktop   # desktop wrapper of client
```

## Tech Stack

- Server and client core: **Go**
- Desktop and web: **Wails** + **Vue**
- Communication: **WebSocket**
    - [coder/websocket](https://github.com/coder/websocket) on the server
    - Vanilla [WebSocket API](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) on the client (?)
- Conflict resolution: **CRDT**
    - [crdt](https://github.com/neurodrone/crdt) in pure Go
    - See also [Yjs](https://github.com/yjs/yjs) in JavaScript
- Scripting: **Janet**
    - [janet-go](https://github.com/meinside/janet-go)

TODO Encryption (age?)