Ship your full-stack React application as a single executable! This project combines the power of PocketBase as a backend with a modern React frontend, all compiled into one easy-to-deploy binary.
- Single Binary Deployment: Package your entire full-stack application into one executable
- Built-in Database: PocketBase includes an embedded SQLite database
- Auto-generated TypeScript Types: Automatic type generation from your database schema
- Modern React Frontend: Built with Vite for blazing-fast development
- Type Safety: Full TypeScript support throughout the stack
- Automated Migrations: Database migrations are automatically applied during deployment
- Node.js (v20 or higher)
- Go (v1.18 or higher)
- pnpm (recommended package manager)
- Clone the repository
- Install dependencies:
pnpm install
pnpm dev
- Starts all development services concurrently:dev:types
- Generates TypeScript types from your PocketBase schemadev:client
- Starts the Vite development server for Reactdev:server
- Runs the PocketBase server in development mode
pnpm build
- Creates a production build:build:client
- Builds the React frontendbuild:server
- Compiles everything into a single binary namedpocket-react
pnpm format
- Formats code using Biome
.
├── frontend/ # React frontend code
├── pb_data/ # PocketBase data directory
├── pb_migrations/ # Database migrations
└── main.go # Go entry point
When making changes to the database:
- Always make changes in your local PocketBase instance first
- PocketBase will automatically generate migration files in the
pb_migrations
directory - Commit these migration files to your repository
- Migrations are automatically applied when the application starts
- The deployment process will execute all pending migrations in order
- Never modify the production database directly; always create migrations locally first
PocketBase is an open source backend consisting of:
- Embedded database (SQLite)
- Built-in authentication
- Real-time subscriptions
- Dashboard UI
- File storage
- Convenient REST API
Why PocketBase is great for this project:
- Zero-dependency backend
- Single binary deployment
- Auto-generated API and admin UI
- Built-in authentication and file storage
- Great developer experience
- Active community and regular updates
To create a production build:
pnpm build
This will create a single executable named pocket-react
that contains your entire application. To run it:
./pocket-react serve
During development, you can run all services concurrently using:
pnpm dev
This will start:
- The PocketBase server
- The Vite development server
- Type generation in watch mode
MIT