thin-backend-todo-app
assert-combinators
Our great sponsors
thin-backend-todo-app | assert-combinators | |
---|---|---|
4 | 5 | |
11 | 23 | |
- | - | |
10.0 | 5.7 | |
almost 2 years ago | 3 months ago | |
JavaScript | TypeScript | |
- | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
thin-backend-todo-app
-
Thin Backend - Instant Postgres Backend for React/Vue/Svelte/... Apps with Realtime, Optimistic Updates & Auto-generated TypeScript Bindings
In the early development phase we actually added GraphQL support to Thin. It was removed as we figured out that a lot of the common CRUD operations would take a lot more boilerplate code when doing it with GraphQL. Now our API consists of high level functions like `createRecord(tableName, object)` and `useQuery(query(tableName))`. You can find some example code here: https://github.com/digitallyinduced/thin-backend-todo-app/blob/main/app.tsx
-
Thin Backend: Instant API for your Postgres DB
If you want to play around with Thin, you can find a small example app here. It's running on Vercel here.
-
GraphJin – An Instant GraphQL to SQL Compiler
If you're looking for something like GraphJin, PostGraphile or Hasura but with less boilerplate and complexity, more end-to-end typesafe approach and optimistic updates, check out Thin Backend https://thin.dev/ (https://github.com/digitallyinduced/thin-backend)
Thin Backend takes a bit more of a higher level approach to database operations than services like GraphJin, but solves fundamentally the same problem. Doing things in a more structured way also allows us to do things like optimistic updates by default that require manual work with GraphQL tools.
To see some code examples, here's a small example project done with thin-backend: https://github.com/digitallyinduced/thin-backend-todo-app It's running on Vercel here: https://thin-backend-todo-app.vercel.app/
-
Thin Backend - Instant Postgres Backend for React Apps with Realtime, Optimistic Updates & Auto-generated TypeScript Bindings
} ``` Live example here: https://thin-backend-todo-app.vercel.app/ Full Code: https://github.com/digitallyinduced/thin-backend-todo-app
assert-combinators
-
Kysely: TypeScript SQL Query Builder
We use in prod variant of no 1. [0]. Why? Because:
* it's extremely lightweight (built on pure, functional combinators)
* it allows us to use more complex patterns ie. convention where every json field ends with Json which is automatically parsed; which, unlike datatype alone, allows us to create composable query to fetch arbitrarily nested graphs and promoting single [$] key ie. to return list of emails as `string[]` not `{ email: string }[]` with `select email as [$] from Users` etc.
* has convenience combinators for things like constructing where clauses from monodb like queries
* all usual queries like CRUD, exists etc. and some more complex ie. insertIgnore, merge1n etc has convenient api
We resort to runtime type assertions [1] which works well for this and all other i/o; runtime type assertions are necessary for cases when your running service is incorrectly attached to old or future remote schema (there are other protections against it but still happens).
[0] https://github.com/appliedblockchain/tsql
[1] https://github.com/appliedblockchain/assert-combinators
-
GraphJin – An Instant GraphQL to SQL Compiler
We use not so much frameworks but combination of lightweight libraries:
- runtime assertions [0] - to map unknown values at i/o boundary into statically typed code (rpc input parameters, sql results etc)
- template based sql combinators to sanitize sql/generate sql [1]
- jsonrpc over websockets - for bidirectional comms between f/e and b/e
[0] https://github.com/appliedblockchain/assert-combinators
[1] https://github.com/appliedblockchain/tsql
- Parser Combinators in Haskell
-
An Inconsistent Truth: Next.js and Typesafety
Types can be asserted at runtime (parsed) at IO boundaries (reading http request or response, websocket message, parsing json file etc). Once they enter statically type system they don't need to be asserted again.
The difference it makes is illusion of type-safety vs type-safety this article touches on.
You can try to bind service with client somehow but in many cases this will fail in production as you can't guarantee paired versioning, due to normal situations by design of your architecture or temporary mid-deployment state or other team doing something they were not suppose to do etc. It's hard to avoid runtime parsing in general.
Functional combinators [0] or faster [1] with predicate/assert semantics work very well with typescript, which is very pleasant language to work with.
[0] https://github.com/appliedblockchain/assert-combinators
[1] https://github.com/preludejs/refute
-
Parsix: Parse Don't Validate
Once i/o boundaries are parsing unknown types into static types, your type safety is guaranteed.
[0] https://github.com/appliedblockchain/assert-combinators