A beautiful, modern blog platform built with Next.js 15, PocketBase, and shadcn/ui. Features a clean design, theme switching, and a powerful content management system.
- 🎨 Modern Design - Clean, professional UI with shadcn/ui components
- 🌙 Theme Switching - Light, dark, and system theme support
- 📱 Responsive - Works perfectly on all devices
- ⚡ Fast Performance - Built with Next.js 15 and Turbopack
- 🗄️ PocketBase Backend - Self-hosted database and API
- 📝 Rich Content - Support for images, tags, and rich text
- 🔍 SEO Optimized - Server-side rendering and meta tags
- 🎯 TypeScript - Full type safety throughout
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS, shadcn/ui
- Backend: PocketBase
- Icons: Lucide React
- Theme: next-themes
-
Clone the repository
git clone <your-repo-url> cd nextjs-blog-pocketbase
-
Install dependencies
pnpm install
-
Set up environment variables
# Quick setup - creates .env.local from template pnpm run setup-env # Or manually copy the template cp env.example .env.local
-
Configure your environment
Edit
.env.localwith your actual values:- Update
NEXT_PUBLIC_SITE_URLto your domain - Set your contact information
- Configure PocketBase URL if different
- Add analytics IDs when ready
- Update
-
Start PocketBase
# Make sure pocketbase.exe is in the root directory ./pocketbase.exe serve -
Start the development server
pnpm dev
-
Open your browser Navigate to http://localhost:3000
Go to http://127.0.0.1:8090/_/ and create an admin account.
- Name:
authors - Fields:
name(text, required)email(email, required)bio(text, optional)avatar(file, optional)
- Name:
blog_posts - Fields:
title(text, required)content(editor, required)excerpt(text, required)slug(text, required)featured_image(file, optional)published(bool, optional)author(relation to authors, required)tags(json, optional)
Set all collection rules to public (empty) for both list and view operations.
Create some authors and blog posts through the PocketBase admin interface.
The blog supports three themes:
- Light - Clean, bright interface
- Dark - Easy on the eyes for night reading
- System - Automatically follows your OS preference
Users can switch themes using the theme toggle in the header.
src/
├── app/ # Next.js app directory
│ ├── blog/ # Blog pages
│ │ └── [slug]/ # Dynamic blog post pages
│ ├── about/ # About page
│ ├── contact/ # Contact page
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Homepage
├── components/ # React components
│ ├── ui/ # shadcn/ui components
│ ├── BlogCard.tsx # Blog post card
│ ├── BlogList.tsx # Blog posts list
│ ├── Header.tsx # Site header
│ ├── Footer.tsx # Site footer
│ ├── theme-provider.tsx # Theme provider
│ └── theme-toggle.tsx # Theme switcher
└── lib/ # Utility functions
├── blog.ts # Blog-related functions
└── pocketbase.ts # PocketBase client
pnpm dev- Start development serverpnpm build- Build for productionpnpm start- Start production serverpnpm lint- Run ESLint
This project uses shadcn/ui for components. To add new components:
npx shadcn@latest add [component-name]The project uses Tailwind CSS with shadcn/ui design tokens. All styling follows the design system for consistency.
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables if needed
- Deploy!
The app can be deployed to any platform that supports Next.js:
- Netlify
- Railway
- DigitalOcean
- AWS
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is open source and available under the MIT License.
- Next.js - The React framework
- PocketBase - The backend
- shadcn/ui - The component library
- Tailwind CSS - The CSS framework
- Lucide - The icon library
Built with ❤️ using Next.js and PocketBase