I am constantly starting side projects, and like so many, I try to get the product out the door as quick as possible. I previously thought I have touched nirvana with Next.js + Supabase, but after so many projects you have to start paying Supabase the big bucks!
After two projects you need to pay Supabase 25 dollars a month, and each project you add is an additional 10 dollars a month. Pricey for side projects that are yet to make any money.
nicholasoxford / pocketwatcher
π Production-ready Next.js template with PocketBase and shadcn/ui. Includes authentication, beautiful UI components, and one-command deployment.
PocketWatcher
Overview
A modern full-stack template that combines the power of Next.js, the simplicity of PocketBase, and the beauty of shadcn/ui. Perfect for quickly bootstrapping production-ready web applications with authentication and a polished UI.
Features
- π Next.js 15+ App Router
- π¦ PocketBase backend with built-in authentication
- π¨ Beautiful UI components from shadcn/ui
- π Server-side rendering and client-side interactivity
- π Form handling with React Server Actions
- π Complete authentication system with email/password
- π³ Production-ready Docker setup
- βοΈ One-command deployment to Fly.io
- π Secure cookie-based authentication
- π‘οΈ Type-safe development with TypeScript
- β‘ Bun for fast package management and running scripts
Getting Started
Prerequisites
- Bun runtime
- Fly.io CLI (for deployment)
Local Development
- Clone the repository:
git clone https://github.com/yourusername/pocketwatcher.git
cd pocketwatcher
- Install dependencies:
bun install
- Start the development servers:
In one terminal, start PocketBase:
./pocketbase serve
In another terminal, start the Next.js development server:
bun run dev
- Access the applications
- Next.js: http://localhost:3000
- PocketBase Adminβ¦
I was deploying so many Supabase projects I created a cli to self host Supabase on fly.io, Supafly
Side projects live and die by annoying blockers, the things that are getting in your way that shouldn't. After 10, 15, 20 or so side projects you might start to get a feel for what platform to reach for when.
What if we could host our entire app, in a familiar fashion, on one machine? Our database, API, and frontend. We should also be able to host this and have easy local development. Local development is classically a bit annoying with Supabase.
This gives you Authentication, a SQLite database (based), a self deploy next.js app, which is also your api layer, and the ability to do file upload + email easily.
Deploying Your Stack to fly.io
Getting your app live is surprisingly straightforward. Unlike traditional deployments where you're juggling multiple services, this is all handled in one go.
First-Time Setup
Install the Fly.io CLI if you haven't already
curl -L https://fly.io/install.sh | sh
fly auth login
The Launch Process
bun run launch
When you run this, you'll hit two prompts:
"Do you want to tweak these settings before proceeding?"
β Just hit enter (the defaults work great)
"Would you like to allocate dedicated ipv4 and ipv6 addresses now?"
β Type Y (you'll need this)
Getting Your Admin Access
Here's the crucial part that often trips people up. Your PocketBase admin setup needs a special URL, but it's easy to find:
fly logs | grep pbinstal
This will show you something like:
Copyhttp://0.0.0.0:8090/api/admins/confirm-password-reset?token=YOUR_TOKEN_HERE
Replace http://0.0.0.0:8090 with https://your-app-name.fly.dev:8091"Important: Modifying the URL"
You'll need to change this URL before using it:
Keep the rest of the URL path and token exactly the same
Once you're set up, you can access your app at:
Main App: https://your-app-name.fly.dev
Admin Panel: https://your-app-name.fly.dev:8091/_/
Pro Tips If you don't see the pbinstal log right away, wait a minute and try the logs command again
"Deployment Troubleshooting"
Keep that initial admin URL safe until you've set up your account
Once you've set up your admin account, that initial URL won't work anymore (this is a security feature)
Check out more of my writing at nicholasoxford.com
Project made with this: domainbobber.com
Top comments (0)