Blitz.js Now in Beta (Batteries Included Framework Built on Next.js)
blitzjs.com
blitzjs.com
Lastly, thank you for working on this project/problem, definitely a lot of potential here. I've also seen that you really care about the community around the project, which is awesome!
The biggest difference between Blitz and Redwood is that Redwood makes the API layer easier with conventions and APIs, whereas Blitz abstracts away the entire thing into a compile step. So working with Redwood requires working with APIs like normal. But with Blitz you can almost forget an API is even there.
How does it work for clients using an old version of the app? I.e. if I change the db schema and update it for new clients, what will happen to older clients?
I'd also like to go even further and add some type of detection to the build that would notify you of potential issues.
"Hi, we can't handle any version skew so please interrupt what you are doing to click this button and reload the app."
As for the redwood vs blitz, I think I get what you're getting at but still not fully grok what _exactly_ it means/looks like (and what are the tradeoffs). I'll experiment with it, so I can develop the intuition myself :).
Frameworks built upon frameworks upon frameworks is bad, because you lose stability and reliability, because you depend on libraries and frameworks. Better choose a good framework and spend time on it.
I respectfully disagree with this. Next.js is extremely stable and reliable, so no issue there.
Now without Blitz you would be cobbling together libraries on your own. What do you think will be more stable and reliable, your own homegrown thing or Blitz which has a sizable and growing community that's always making it better?
2 questions:
1. How the docs read right now, I'm cautious about the "recipes" concept. It's not clear why I'd need to use a recipe to install Tailwind instead of installing Tailwind via NPM. I'd love the docs to explain what "coupling," if any, occurs with Blitz <> a recipe's dependencies, so I can better understand what I'm opting into by choosing the framework.
2. Is there a roadmap for API-only implementation, like Rails? If I want to use some of my Blitz endpoints from another client is that possible?
Thanks!
> Re: recipes
You don't have to use recipes. Recipes simply package a number of manual steps into a single automated command. Recipes let you install a library without looking up the install docs.
Recipes are roughly "install dependencies + codemods". So for example the `chakra-ui` recipe installs the needed dependencies and adds the theme provider to your app root.
There's currently zero coupling with recipes. The end result is exactly the same as if you did everything manually.
> Re: API-only
Currently you can do that. You can use the API routes (which give you direct access to Node req, res objects. And don't add any pages (or just a few, as you want).
Once I Googled a little and found out what it was doing it looked awesome, but it was very noisy if you don't know the components of Blitz.
Compare it to this code from early in the ActiveRecord guide:
"class Product <
ApplicationRecord
end"Congrats on the beta!
I've been developing my app with Blitz. It has been an extremely productive framework to work with.
The following are a few of the productivity boosts that I like:
1. It includes authentication plus there's a good library for authorization (blitz-guard) so auth is a breeze.
2. The generator is helpful when I started with Blitz, but use it less now.
3. The community is friendly and helpful. ex. Check out this post on skeleton loaders https://andreas.fyi/engineering/nextjs-auth-skeleton-loaders
4. The integration with Prisma is buttery smooth. In your UI code you call a function that has the database access. Blitz converts the function calls into API calls and runs your database code on the server. When Prisma is not enough you can drop to `db.$queryRaw` to write SQL directly.
5. Personally, I dislike fiddling with 800 libraries to get a project up and running. Blitz includes Jest, Prettier, and everything else you need so on so that you're productive from day 1.
Our boilerplate generation is currently optimized for folks building real production apps.
We'll be adding a minimal boilerplate option here at some point (PRs welcome!)
I'm going to enjoy playing with this! well done
To logout the token just invalidate or change the `jwt_id`
You might set the jwt to expire in 15 minutes, for a 5-10 minute session allowing for clock drift - and just eschew the black list.
But now you need a longer lived "refresh token" and a service endpoint that handles that, along with a black list.
It is "simpler" in the sense that: your app have two separate auth/clients - one is very simple - gets a jwt token and renews every ten minutes - the rest of your app simply uses the jwt.
On your server side, you can have a dedicated/simple service that only renews jwts given a refresh token (checks refresh token blacklist) - and your other apps blindly trusts the jwt (checks signature and the short timestamp).
You've now reimplented half of kerberos - along with "pass the hash" - and at least you can reason about the trade-offs you've made...
Interesting to see where it go, +1 for a batteries included RoR like framework for JS/TS.
This is one of the main reasons I'll continue to pick Django as a back-end. Django + DRF does pretty much everything you would ever need from a framework with the added bonus of a fully working and customizable admin straight out the box.
Currently I’m using an instance of Prisma studio in production as an admin interface for the database.
Learn more: prisma.io/studio
The only thing that is holding me back is that as far as I understand Prisma doesn't support cascading deletes.
Meaning that if I have to delete a user, then I have to manually delete all his projects, comments, posts, etc... which is not nice.
https://www.prisma.io/docs/guides/general-guides/database-wo...
Workers does not support Node APIs (https://developers.cloudflare.com/workers/learning/how-worke...)
There is documentation of deploying a NextJS app (https://developers.cloudflare.com/pages/how-to/deploy-a-next...)
Just saw that they have links to "Made with blitz" on their wiki in case anyone is interested: https://github.com/blitz-js/blitz/wiki#-made-with-blitz-incl...
This was surprising to me, I thought it would be focused on SSR.
May I ask why particularly rails?
It’s been a while since I’ve used Rails but that interactive environment was my favorite way to get familiar with activerecord models.
So something like creating an instance of an existing model definition and trying out its methods instead of CLI for running a database migration or generating a stubbed model definition.
Now I’m certainly going to be trying Blitz.
Will have to give this more use on something beyond "Hello World" soon.
Then this is my dream framework
How does this compare with Supabase?
In general, I'm way more in favor of owning your entire stack, like Ruby on Rails and Laravel vs relying on a third-party service for the core of your app.
I'm not too well-versed in the JS world.