Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A Next.js boilerplate demonstrating PocketBase auth, server actions, and typed clients.

A full-stack Next.js TypeScript template focused on functionality over UI, featuring Zustand, TanStack Query, and ESLint 9 support.
pocketbase-nextjs-auth is an open-source Next.js boilerplate that shows developers how to wire PocketBase as a self-hosted backend for authentication, server actions, and mixed rendering strategies. The project is built on Next.js and pairs it with a Dockerized PocketBase server, so the whole backend can be started with a single docker compose command. It is distributed as a GitHub repository and is intended as a learning resource and starter kit.
pocketbase-nextjs-auth is a sample Next.js application that integrates the PocketBase backend as its database and authentication layer. It takes no input beyond a browser request, and it produces a running web app with registration and login pages, protected routes, and server action examples. The repository runs on Next.js (App Router implied by the use of server actions and middleware) and provides a typed PocketBase client generated by pocketbase-typegen. The author is not stated on the page; it is a public repository with 24 stars.
docker-compose.yml file starts a PocketBase instance with one command, docker compose up --detach, so no manual backend installation is needed.pocketbase-typegen to generate TypeScript types for the PocketBase schema, giving autocompletion and type safety.src/lib/pocketbase/middleware.ts is where server-side auth checks happen; the README reminds developers to adjust it to allow public access to specific pages.docker compose up --detach to launch PocketBase, then npm run dev to start the Next.js app on localhost:3000.pocketbase-typegen against the PocketBase schema to keep the client in sync with the database.The setup workflow is three steps: start the PocketBase server with Docker Compose, install dependencies, and run the Next.js development server. The middleware file runs before requests reach page components and checks whether a user is authenticated, allowing routes to be protected or public as configured. Server actions in the app handle data mutations directly from React components.
pocketbase-typegen generates TypeScript types, catching schema mismatches at compile time.Yes, the repository is publicly available on GitHub with an open-source license (implied by the public repo; the exact license is not stated in the README). You can clone it and use it as a starting point for your own Next.js and PocketBase project.
PocketBase is an open-source backend that bundles a SQLite database, file storage, admin UI, and authentication API into a single binary. In this template, it is run inside Docker and used as the data store and auth provider for the Next.js app.
Run docker compose up --detach from the project root. This starts the PocketBase container in the background. Then start the Next.js dev server with npm run dev (or yarn/pnpm/bun) and open http://localhost:3000.
pocketbase-typegen is a tool that generates TypeScript types from your PocketBase collection schema. This template uses it to produce a typed client, so your code gets autocompletion and compile-time checks against the database structure.
Yes, the README explicitly lists "techniques for both server-side and client-side rendering" as a feature. The middleware handles server-side auth, while regular Next.js components can be client-side.