mznotes/design.md

110 lines
2.7 KiB
Markdown
Raw Normal View History

2023-03-23 01:31:24 +00:00
- CLI API
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- `mznotes install` : Install a script into the database
- `mznotes show` : Show the information about a particular node, by ID
- Database of nodes + code
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Code
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Code is all interface-based. Interface implementations give specific ways
behaviors are implemented
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Standard interfaces:
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Indexed
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Node definition
2023-03-28 02:34:46 +00:00
```typescript
type Node = {
2023-03-23 01:31:24 +00:00
metadata: KVStore,
2023-03-28 02:34:46 +00:00
interfaces: Set<InterfaceURI>,
2023-03-23 01:31:24 +00:00
edges: Set<(EdgeType, Edge)>,
}
```
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Within the metadata kv store, keys are namespaced, according to the
application name. Application names must be registered ahead of time
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Nodes implement interfaces, the code of which is fetched from the internet
and validated
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Nodes are namespaced, although namespacing isn't the primary hierarchy
protocol.
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- This is needed because the database itself has a privileged namespace
- The privileged namespace is for keeping track of database state, for
example which scripts are trusted
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Database service:
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- IFTTT Events
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Local vs. distributed IFTTT events?
- Local means that ur particular device is repsonsible for running it
- Distributed means any device can consume the event???
- is this even a good idea? Maybe just have one dedicated worker
device. For example, may not want to run certain automation tasks
on phone, while others may only be able to be run on phone
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Cron tasks
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Sync protocol:
- After a modification, the modification gets written to a queue
- CRDT?
- Other privileged concepts:
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- User: a pub/priv key pair
2023-03-28 02:34:46 +00:00
- Sample apps
- Content / blob storage
- Exposed interfaces
- `Content`
- `upload() -> Writer`
- `get(node_id : NodeId) -> Reader`
- `Writer`
- `next_chunk(Vec<u8>)`
- `Reader`
- `next_chunk() -> Vec<u8>`
2023-03-23 01:31:24 +00:00
- Personal journaling (like Logseq)
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Weight / fitness tracking
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Calendar app (store events)
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Git app (store code)
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- File backup
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Chat / Mail?
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Photo viewer + indexing using ML models for face detection / keywords
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Not sure yet:
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Automatic sharing of database nodes? This seems like a bad idea for
multiple reasons. Maybe better to just have a specific app for
doing permission models
- Other concerns
2023-03-28 02:34:46 +00:00
2023-03-23 01:31:24 +00:00
- Local protection using libsecret?
2023-03-28 02:34:46 +00:00
2023-03-23 02:24:46 +00:00
- Migrations?
2023-03-28 02:34:46 +00:00
2023-03-23 02:24:46 +00:00
- If an application needs to migrate its data format, should we formalize
this?
- Data migrations that don't need to create / delete nodes, only metadata