assert-combinators
thin-backend
assert-combinators | thin-backend | |
---|---|---|
5 | 43 | |
23 | 1,227 | |
- | 0.0% | |
5.7 | 0.0 | |
3 months ago | over 1 year ago | |
TypeScript | JavaScript | |
GNU General Public License v3.0 or later | MIT License |
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.
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
thin-backend
-
Ask HN: How would you refactor a big project in 2023?
A tool like https://thin.dev/ might be good for you. You can port and serve functionality a little bit at a time into thin and use their managed postgres db and the schema editor to handle the new fields in the backend.
-
Why We're Moving on from Firebase
Check out thin.dev https://thin.dev/ It uses SQL DDL statements literally as the building blocks for everything.
-
Prisma vs. Thin Backend
Postgres database has been gaining more popularity because of its advanced database and scalability. Created by digitally induced, Thin Backend is simplifying Postgres by giving users a backend server that has an API that connects with Postgres DB. You can integrate Thin Backend with:
- Thin Backend - Instant Postgres Backend for React/Vue/Svelte/... Apps with Realtime, Optimistic Updates & Auto-generated TypeScript Bindings
- Thin Backend
-
Best React Developer Experience?
React for UI TypeScript for Type Safety thin.dev for Data + State management
-
Show HN: PocketBase – open-source realtime back end in 1 file
Check out https://thin.dev/ :) It's similar, supports self-hosting and uses postgres. Quick demo video here: https://www.youtube.com/watch?v=-jj19fpkd2c&t=3s
(I'm founder of Thin)
-
10 Years of Meteor: My experience with a pioneering JavaScript framework
Real-time by default for everything is really a fun way to write web apps. A little bit inspired by Meteor we've build Thin Backend, which provides a real-time API for querying data and writing to a postgres database. If you're interested, check it out at https://thin.dev/ or check the demo video https://www.youtube.com/watch?v=-jj19fpkd2c
-
An Alternative Approach to State Management with Redux
If you're curious, give it a try at thin.dev.
What are some alternatives?
httpaf - A high performance, memory efficient, and scalable web server written in OCaml
pocketbase - Open Source realtime backend in 1 file
pyparsing - Python library for creating PEG parsers
postgrest - REST API for any Postgres database
refute - Refute module.
pg_graphql - GraphQL support for PostgreSQL
angstrom - Parser combinators built for speed and memory efficiency
supabase - The open source Firebase alternative.
parser - String parser combinators
ihp - 🔥 The fastest way to build type safe web apps. IHP is a new batteries-included web framework optimized for longterm productivity and programmer happiness
generator - Generator module.
fastapi - FastAPI framework, high performance, easy to learn, fast to code, ready for production