16 ms·
Hasura by far, lets you point-and-click build your database and table relationships with a web dashboard and autogenerates a full GraphQL CRUD API with permissi
by gavinray 7y ago
Hasura by far, lets you point-and-click build your database and table relationships with a web dashboard and autogenerates a full GraphQL CRUD API with permissions you can configure and JWT/webhook auth baked-in.
https://hasura.io/ 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/ 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 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/ 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://www.metabase.com/
https://posthog.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.
- dahdum 7y agoI can't agree more about Hasura, I made the jump to GraphQL for my current application and it's been a dream. Their documentation is excellent, helping me get setup with auth0 jwt auth and apollo client despite being new to both. 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.).
- chris_st 7y agoAre you hosting your own Postgres, or using a db-as-a-service? If so, which one?
- gavinray 7y agoFor Dev and Staging, I use a Postgres Docker container, in Production I use a managed Postgres service. 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 https://github.com/GavinRay97/hasura-ultimate-starter And really comprehensive docs about setup and architecture + how everything works here: http://hasura-ultimate-starter.surge.sh/#/ http://hasura-ultimate-starter.surge.sh/#/
- damidekronik 7y agoThe tutorial looks great. Thank you for a great work!
- gavinray 7y agoAppreciate the kind words! I just wanted to share these tools because I feel they're undervalued and underused, and I reach for them for every new project I start.
- jimbokun 7y agoSo hasura just exposes a Postgres database through GraphQL? 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.
- gavinray 7y agoThat's one of the most common misconceptions about Hasura. 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.
- simplify 7y agoI really want to like Hasura, but very quickly you'll run into limitations of its permission system. Especially when dealing with logic across relationships. 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 :(
- gavinray 7y agoMight I ask what limitations/issues you ran into? 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/d7b8805078a47e00001e58eb8b1027b9 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.
- cpursley 7y agoThis is similar to what we're doing! Hasura + AutoCRUD framework + Metabase is a great stack for putting together a solid business application in no time. 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 https://github.com/Steams/ra-data-hasura-graphql Here's a reference application I put together: https://github.com/cpursley/react-admin-low-code 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-and-plan-changes-automatically-using-postgres-phoenix-pubsub-e67d061b04bc https://medium.com/hackernoon/get-notified-of-user-signups-a...
- gavinray 7y agoHey man, really cool to see you comment here! We've chatted in the Hasura Discord briefly, love your work with the React Admin adapter. RA requires more manual work to set up and the aesthetics are different (Material UI), but it also gives you more flexibility. 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
- dvasdekis 7y agoI've taken your stack one step further, with a completely dockerised solution that uses Firebase as an authentication solution (authentication is missing from the current low-code example). It can be run locally or on a cloud provider that runs containers (e.g. GCP Compute Create-With-Container). See here: https://github.com/dvasdekis/react-admin-hasura-firebase/ https://github.com/dvasdekis/react-admin-hasura-firebase/ Thanks to gavinray also for the help with this!
- deleted 7y ago[deleted]
- pricci 7y ago
- diericx 7y agoWhat are you using to create a customer facing UI/frontend? It sounds like Hasura is just for backend
- gavinray 7y agoWhatever you like. Depending on the nature of your work, you may be a startup or working for an organization that has mockups and design assets for what your frontend needs to look like. 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): https://tailwindui.com/ https://tailwindui.com/ https://tailwindcss.com/ https://tailwindcss.com/ 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: https://hasura.io/learn/ https://hasura.io/learn/ They have several dozen example apps built in all sorts of tech here: https://github.com/hasura/graphql-engine/blob/master/community/sample-apps https://github.com/hasura/graphql-engine/blob/master/communi...
- arisa_a 7y agoCheck out https://internal.io/ https://internal.io/. We're big fans of Hasura and work really well with it. Full disclosure, I'm one of the founders.
- xupybd 7y agoWhat are you using for your authentication adapter? I've been looking at picking up hasura but don't like the idea of using something like Auth0. So I've been hunting on the best tool for auth.
- gavinray 7y agoI have an example of JWT Auth using Bcrypt as Node.js functions in my starter kit, you can extrapolate from there: https://github.com/GavinRay97/hasura-ultimate-starter/tree/master/app/services/openfaas/node 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/authentication/jwt.html#the-spec https://hasura.io/docs/1.0/graphql/manual/auth/authenticatio...
- dvasdekis 7y agoI've set up a working example with Firebase Authentication (which is admittedly 'something like Auth0') here: https://github.com/dvasdekis/react-admin-hasura-firebase/ https://github.com/dvasdekis/react-admin-hasura-firebase/ 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?
- xupybd 7y agoI really need a self hosted solution. Ideally it would have an LDAP adapter so it could get login info from our internal active directory. If I were building public facing apps Auth0 would be perfect. 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.
- mycall 7y ago> Hasura Pro Pricing: Talk to Us I'm always scared to call when I hear this.
- gavinray 7y agoTanmai, their CEO, gave a response in the Discord on this question a few weeks ago: "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.
- sneak 7y agoThat’s a double whammy. I and many others are prevented from creating a Discord account.
- gavinray 7y agoTanmai is on email 24/7, you've honestly got a better chance of reaching him there than on Discord: tanmaig@hasura.io I just use Discord because it's immediate feedback.
- splike 7y agoI agree that Discord seems like an odd place to find this information, but I'm curious to know what prevents you from creating a Discord account?
- sneak 7y agoYou can’t create a Discord account without doxxing yourself. Signups not from an IP that discloses your location demand a dozen captchas and a telephone number. Using a burner number is not supported, and your carrier number is reversible to name/address/location just as your IP is. more info: https://sneak.berlin/20200220/discord-is-not-an-acceptable-choice-for-free-software-projects/ https://sneak.berlin/20200220/discord-is-not-an-acceptable-c...
- denster 7y agoWe've [1] been fans of Hasura for some time -- it's a terrific piece of work. 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 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.
- gavinray 7y agoAre you guys Postgres-centric, out of curiosity? Really interesting product, sort of in the same ballpark of Spinoff and other Sheets-based low-code SaaS but an approach more unique than I've seen before.
- golergka 7y agoAwesome, never heard of it! Graphile (https://www.graphile.org/ 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.
- micimize 7y agoI'm a big user of graphile - they've also got a pretty good starter boilerplate with auth, etc baked in: https://github.com/graphile/starter https://github.com/graphile/starter 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.
- rattray 7y agoHas anyone ever hooked graphile up to a point and click schema editor, for iterating without writing code?
- ravikapoor101 7y agoWhat about Strapi https://strapi.io/ https://strapi.io/? I see strapi has everything hasura has but with more user friendly UI. Am I missing something?
- hafeyang 7y agoI am using strapi ,it is good!
- chimen 7y agoI have this feeling that hasura is still "onboarding". I had this experience with Netlify that offered some amazing deals and waited for everyone to onboard then started hammering them hard. I got up to $150/mo really fast for a static site that receives only about 900req/day. Every single month they were limiting more features and shifting them on to some "premium" offering that was used to lock you in. I'm still waiting on Hasura to do the same. Forest admin is no different. I'm always tempted to try them out for new projects but I always find myself back to Django, it will be here 10 years down the road.
- insin 7y agoIs there a similar point-and-click tool which can output Django models with all the relationship fields wired up correctly? Getting as far as you can modelling a new problem domain with just models.py and the Django admin is pretty fun.
- cdrx 7y agoThere is https://apibakery.com https://apibakery.com on the basic end of the scale
- spitfire 7y agoThis and Hasura are excellent. What's on the more sophisticated end of the scale? Is there anything that will generate user/company role systems and bake those into the generated API? Generate client side SDK's from the API? 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.
- kennydude 7y agoForest Admin looks really nice, but I wish you could host the admin UI yourself. Not a fantastic impression for clients if Forest (for whatever reason) suddenly stops offering it's service and your admin panel vanishes into thin air :(
- benhizak 7y agoCherre.com uses this stack. Hasura + postgres in particular. We love it.
- antoaravinth 7y agoDoes hasura supports database replication? When I looked last time, it wasn't. Also I feel these tools are not enterprise ready, IMHO.
- tango12 7y ago(I'm from Hasura) 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.
- antoaravinth 7y agoThanks for the reply. Also, when I run in an microservice architecture, how does hasura handles say for example websocket across the services? Do we need to depend on any other library? Can you share some samples for these things if available. I will be glad to look at it.
- tango12 7y agoThat works automatically! 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?)
- pitchups 7y agoWould be interested to know if you can do all this by using their open-source conmmunity edition, or would you need to use their paid / Pro version. Since the pricing for the paid version is not given, not sure but assuming it would be fairly expensive to use / deploy? My preference is for an open source tool so we are not locked in to a propreitary platform for the long term.
- johnx123 7y agoFWIW, Hasura seems to be having some rough edges with their permissions and performance https://github.com/hasura/graphql-engine/issues/4307 https://github.com/hasura/graphql-engine/issues/4307
- bnchrch 7y agoHey Gavin, I’m really interested in this setup. Would you happen to have an example of this somewhere? Specifically the docket setup?
- bberkgaut 7y agoJust tried to figure out why Hasura has lambda on it's logo, and hey, it's written in Haskell!