Combine Hasura (automatic GraphQL on top of PostgreSQL) with React Admin (low code CRUD apps similar to Forest) and you can build an entire back office admin suite or form app (API endpoints and admin front end) in a matter of hours.
This adaptor connects react-admin with Hasura: https://github.com/Steams/ra-data-hasura-graphql
Here's a reference application I put together: https://github.com/cpursley/react-admin-low-code
And we're taking a step further and using Elixir to listen to Postgres table changes for an "Event" style architecture: https://medium.com/hackernoon/get-notified-of-user-signups-a...
Thanks to gavinray also for the help with this!
What we're doing in our production version of this is using Postgres and Hasura for auth following this approach in order to reduce external dependencies: https://github.com/sander-io/hasura-jwt-auth
It's really amazing how far you can get with just Postgres. Writing business logic with code in application middleware always felt hacky to me when we have these powerful and performant relation databases.
For anyone looking for a self-hosted solution that can be more easily whitelabeled, highly recommend cpursley's work.
You should pop by the server chat more often =D
Getting as far as you can modelling a new problem domain with just models.py and the Django admin is pretty fun.
FWIW I just reproduced an API that took me 3 days to build (while learning Django rest framework) in about 5 minutes.
My time would have been much better spend modeling the domain. As a happy benefit apibakery taught me a bit about DRF permissions I didn't know.
It feels like we're finally getting back to the 90's level RAD tools like NeXT enterprise object framework, and Delphi.
Metabase was a game changer in my last company, it was so nice to just be able to drop a 50+ line custom SQL query in there with parameters and let users pull what they want. We'd also setup queries to be loaded via Google Sheets cron jobs. That enabled live dashboards most any spreadsheet user could create (pivot, lookups, transforms, etc.).
I'm always scared to call when I hear this.
The idea is for most users to be on the free / open tier and then monetize off of enterprise users with specific demands and less cash sensitivity.
"The pricing depends on your team/org: what features you’re using Hasura and the uptime/response SLA that you need. If you have something running with Hasura already feel free to setup a chat with the team to get a sense of the pricing. However we will have something launching for self-serve style pricing soon for a managed HA / auto-scalable Hasura with Pro features."
I believe it's priced on a per-feature basis, so they're likely to work with you depending on what your particular needs are.
I just use Discord because it's immediate feedback.
more info: https://sneak.berlin/20200220/discord-is-not-an-acceptable-c...
The number of people that consider Discord part of their threat model or an actual privacy risk is incredibly tiny compared to the number of users that get inconvenience by mass bot raids & people bypassing IP bans.
I help manage a medium-sized Discord guild and we were randomly targeted by a bot raid whereby ~100 bots joined in the span of 1 minute and proceeding to spam various channels and the DMs of our users. Enabling Discord's requirement for a verified phone number stopped the raid in its tracks and allowed us to clean up without further issue.
In the same way, Discord's automatic content scanning is designed to protect the large percentage of minors on the platform & proactively deal with potentially exploitative material + guilds (per https://blog.discordapp.com/discord-transparency-report-apri...)
Removing these features & restrictions in order to appease your extreme edge-case privacy views does not help the average Discord user in the slightest.
It seems that you believe that you benefit from Discord's gatekeeping. I'm glad it seems to be working out for you. If it wasn't, however, how would you know?
You don't agree with Discord's practices and lack of privacy, something which, by the way, I agree with you, and as such, decide not to use it. They are not discriminating against you, you're the one deciding not to use their service. To me, it sounds the same as if you don't like McDonalds because it's unhealthy, then accuse them of discriminating against you because they won't serve you some lean chicken salad.
They are excluding all users who can’t get Discord accounts, such as those who can’t agree to the Discord TOS, for example. Free software projects and other public benefit groups should not be discriminatory.
They’re also banning political cartoons within their group’s communications, by implicit inclusion of the Discord TOS which bans several common, normal, reasonable types of communication.
I’m a paying member of a local nonprofit organization; they use Discord exclusively to communicate. I am excluded from all of the discussions as a result of my not being able to safely get a Discord account. That’s discrimination whether you like to acknowledge it or not.
The presence or absence of threats against one’s person does not legitimize or delegitimize their insistence upon personal privacy.
The difference, in this case is that you're not being forced out of participating in conversations because you're, let's say, black. Instead, you, on your own, are opting out of communication channels because of your own beliefs.
We’re way down in the weeds here. If you’d like to continue this discussion further, please just email me.
My first account I was able to get was via a number I rented on dtmf.io. The account was suspended (across all "servers" in Discord) in a few minutes when I linked a few of my IRL friends in a Discord chat to that Discord article on my own website. I've not been able to sign up again since, despite having blown something like 40EUR on numbers from different countries/providers trying to get a new one.
Even when it works, it's at least 10 minutes of solving CAPTCHAs to log in, each and every time, and sometimes the Google CAPTCHA hits some other exit node rate limit and just tells you to fuck off entirely, making login impossible even with a working account.
When we were looking to extend our spreadsheet functions that read/write to/from databases, we considered integrating Hasura as a backend.
Commendable work by the Hasura team, I think really worth checking out what they've done.
-
[1] Caveat: founder of MintData (https://mintdata.com) here, where we read/write from databases both directly via our flow editor and via spreadsheet functions which wrap things like Hasura.
Have you tried it / do you have comparison points? I only poked around in Hasura a bit before deciding it wasn't worth the switching cost atm, but the out of the box upserts are compelling to me.
Graphile (https://www.graphile.org/) seems to be very similar, although I discovered it just a week ago (also on HN), and haven't had a chance to explore it yet.
In that case, you'd just build the front-end as usual, but use Hasura to bang out your whole backend and then autogenerate the type-safe query components with graphql-code-generator.
When I do products myself, I typically pick a pre-made template/UI kit (Vue is my preference) and then just modify it from there to suit my needs.
TailwindUI also looks really nice and I've seen several people build beautiful looking UI's with it for smaller SaaS products in a few days (though given that they're familiar with TailwindCSS and have a knack for this type of thing already):
Hasura also has a lot of community examples for different front-ends. Ranging from web apps in React/Vue/Angular/Elm to mobile clients in Flutter or Android/iOS:
They have several dozen example apps built in all sorts of tech here:
https://github.com/hasura/graphql-engine/blob/master/communi...
That sounds kinda nifty, but does it then allow you to write custom code to add business logic? Glancing through the documentation, that part wasn't clear to me.
While it CAN expose an existing Postgres database, where it really shines (in my opinion) is when you're starting a brand new product. Because you can create your whole database and all the relationships, foreign-keys, triggers, permissions, etc through the web console UI incredibly rapidly.
And yeah, it takes care of all CRUD and provides an aggregation/statistics API (sum, median, standard deviation, count, mean, variance, etc), and it leaves the pieces of custom business logic up to you to write. It's entirely agnostic to what you use to write these, so long as they expose an HTTP endpoint.
If only Hasura supported some king of Prolog / Datalog instead of their ad-hoc JSON language, then you'd be able to write nearly any possible use cases. Until then, I'll stick to building and maintaining my own backends... manually :(
One of the biggest pain points I found was modeling Organization/Team/Multi-Tenant based permissions.
Generally, the advice is to use a session variable like X-Hasura-Organization-Id to filter in permissions, but recently through a Discord conversation a means to do this without a session variable was found out and I took some time to publish it as a Gist:
https://gist.github.com/GavinRay97/d7b8805078a47e00001e58eb8...
I would be interested in hearing what problems you had and seeing if there isn't some way around it, just for my own curiosity.
Can you also explain how locked in you are, if you decide you want to migrate away from Hasura, or in general want more flexibility that the use-case of Hasura + ForestryAdmin?
About lock-in... it's open source software, so you're as locked in as you'd be with, say, Rails or Django. It doesn't do anything special to PostgreSQL so you can always rewrite the API later from scratch, or build something else on top of its GraphQL API.
What benefits would be using the DB over a GraphQL API?
Also, Hasura has some bells and whistles that would be a bit of a PITA to implement using traditional MVC frameworks, like per-column authorization, and, of course, the GraphQL to SQL translator.
> What benefits would be using the DB over a GraphQL API?
And I'd say that the biggest advantage of GraphQL is allowing customized payloads.
Say you need a list of users ids + emails in one page, and a list with ids + names + emails in other. In REST you either need to waste some bytes, have two endpoints, or use some conditional to show/hide the field.
With GraphQL you just have to ask for the fields you want.
The same applies to joins: you either add extra endpoints, extra logic, or the user has to make multiple requests. With GraphQL you can have custom joins.
Btw, if you still don't think that GraphQL is an advantage to you, I recommend checking its cousin-project PostgREST :)
Yes! Like gavinray said, you can create HTTP services in any language of your choice. Hasura can then be configured to call HTTP endpoints when something changes in the DB. And your services can call Hasura anytime of course.
Remember that Hasura handles all the authorization for you, so there's no need to "proxy" requests made to it.
You end up writing very little compared to traditional frameworks.
Firebase does provide unlimited password logins for free, which mitigated my personal concerns about Auth0. The advantages of a SaaS auth provider compared to a roll-your-own have been documented elsewhere, and I personally found them compelling.
What are the reasons you 'don't like' something like Auth0?
I don't think I'd be allowed to entrust users passwords to an external entity, despite the fact that they would probably do a much better job than I would at securing them. Also despite the fact that we trust every other external provider to store passwords...
I've been looking into keycloak.
Firebase does allow you to integrate with other OAuth providers (e.g. Google/Facebook/Linkedin etc.), so you could perform some kind of validation on the google account, ensuring it comes from your company's mail domain? Just a thought.
Set up of these security schemes is not easy (took me a shamefully long time to get Firebase working with React-Admin and Hasura). I'd personally try and get a SaaS provider to work within your company's constraints before trying to roll your own.
https://github.com/GavinRay97/hasura-ultimate-starter/tree/m...
The sign-up Action bcrypt hashes the password and saves it by sending a mutation to Hasura, and the login Action queries for the user by their email and tries to bcrypt compare their password against the stored one and then return a spec-compliant token if they match.
It's fairly simple to implement your own Auth in Hasura, you just need to return a signed JWT that matches the spec:
https://hasura.io/docs/1.0/graphql/manual/auth/authenticatio...
I have a starter kit that includes a ton of stuff including pre-made JWT auth configured as Hasura Actions, a standard monolith-style Node REST API skeleton, and OpenFaaS serverless handler examples in every major language (Node, Python, Ruby, Java, Go, C#, PHP) you can find here:
https://github.com/GavinRay97/hasura-ultimate-starter
And really comprehensive docs about setup and architecture + how everything works here:
Hasura connects to a read replicas and manages connection pooling across the database cluster.
Hasura itself is stateless so it doesn't do the database replication.
Can you share some samples for these things if available. I will be glad to look at it.
1. During the lifetime of a websocket connection, bytes should be routed to the same Hasura instance. This most service routers / load balancers should take care of automatically.
2. Subsequent connections from different clients to Hasura need not go to the same instance! This makes horizontal scaling painless.
(Is this what you meant?)
https://hasura.io/
I've been able to build in a weekend no-code what would've taken my team weeks or months to build by hand, even with something as productive as Rails. It automates the boring stuff and you just have to write single endpoints for custom business logic, like "send a welcome email on sign-up" or "process a payment".
It has a database viewer, but it's not the core of the product, so I use Forest Admin to autogenerate an Admin Dashboard that non-technical team members can use:
https://www.forestadmin.com/
With these two, you can point-and-click make 80% of a SaaS product in almost no time.
I wrote a tutorial on how to integrate Hasura + Forest Admin, for anyone interested:
http://hasura-forest-admin.surge.sh
For interacting with Hasura from a client, you can autogenerate fully-typed & documented query components in your framework of choice using GraphQL Code Generator:
https://graphql-code-generator.com/
Then I usually throw Metabase in there as a self-hosted Business Intelligence platform for non-technical people to use as well, and PostHog for analytics:
https://www.metabase.com/
https://posthog.com/
All of these all Docker Containers, so you can have them running locally or deployed in minutes.
This stack is absurdly powerful and productive.