taowen / vue-db

Get rid of as many mutable states as possible
https://vue-db.js.org
MIT License
5 stars 0 forks source link

A little confused #1

Closed paul-hammant closed 2 years ago

paul-hammant commented 2 years ago

In demo-todo-server/src/index.ts, I can't see any use of vue-db. I thought that I would see a database (say sqlite), and some magic exposure of CRUD operations over the wire to the the client-side vue-db lib. Choice of wire precise URLs and GET/POST/PUT/DELETE is still a thing that the developer would architect themselves when using vue-db? And in this example, it would be possible to be compatible with todobackend.com's choices of RESTFUL webAPI (or impossible)?

taowen commented 2 years ago

the demo is using a in memory array to simulate database https://github.com/taowen/vue-db/blob/main/packages/demo-todo-server/src/index.ts#L8

The wire protocol can be RESTful http, it is provided via a callback https://github.com/taowen/vue-db/blob/main/packages/demo-todo-client/src/main.ts#L11 It is not too hard to write adapter for todobackend.com

https://github.com/taowen/vue-db/blob/main/packages/demo-todo-server/src/index.ts is not referencing vue-db because vue-db is pure client side library. Expose mysql table directly via http need to include a pretty large solution of authentication/authorization/pagination/data aggregation. It exceeds the scope of this tiny library.

But, vue-db defines a solid foundation for interactive client/server, designing with minimizing latency in mind:

I am working on vue-fusion as a layer upon vue-db to include server side code. But it is not targeting Web HTML5 technology. It is a SSR/OTA/HMR solution for wechat miniprogram.

paul-hammant commented 2 years ago

Sounds good.