Blitz picks up where Next.js leaves off, providing battle-tested libraries and conventions for shipping and scaling world wide applications.
// ---- ON THE SERVER ----
// app/projects/mutations/createProject.ts
import { resolver } from "@blitzjs/rpc"
import db from "db"
import * as z from "zod"
// This provides runtime validation + type safety
export const CreateProject = z
.object({
name: z.string(),
})
// resolver.pipe is a functional pipe
export default resolver.pipe(
// Validate the input data
resolver.zod(CreateProject),
// Ensure user is logged in
resolver.authorize(),
// Perform business logic
async (input) => {
const project = await db.project.create({ data: input })
return project
}
)
Build and iterate on features 10x faster with Blitz RPC than REST, GraphQL, or vanilla API routes. Read and write data from the client with full typesafety and without messing with HTTP or serialization.
Powerful, flexible, and battle tested authentication and authorization for Next.js. You get more control with simpler APIs than alternatives. Easily add social third party integrations like Google, Github, and Auth0.
Set up a new app in 2 mins instead of 2 weeks. Everything will be set up for you including auth, user signup, forgot password, and your form library of choice.
Our community is warm, safe, inclusive, and fun!
Please read our Code of Conduct.
We are all in this together, from the youngest to the oldest. We are all more similar than we are different. We love to work together.
We invite you to help make Blitz the best JavaScript application layer we've ever had!
Blitz authentication is super easy and secure. Works with any identity provider, including self-hosted username and password and third-parties like Auth0.
You can use any database you want. Prisma is the default database client, but you can remove that and use anything else like Fauna or DynamoDB.
One command to install code and/or packages into your blitz app. Examples: `blitz install tailwind` or `blitz install chakra-ui`. Recipes can be created by anyone.
Blitz is set up for server intensive tasks like sending emails, cron jobs, background processing, generating PDFs, etc. Currently we have minimal backend guides, but are working on developing more patterns and adding more docs.
Blitz is built with TypeScript and the Blitz data layer is fully end-to-end typesafe. All types are completely static without needing a separate type generation process!
Blitz code scaffolding is great for both prototyping and for building real apps! You can override templates with your own.
Your financial contributions help ensure Blitz continues to be developed and
maintained! We have monthly sponsorship options starting at $5/month.