A batteries-included starter framework for bootstrapping full-stack web applications with Payload CMS, deployed on Vercel with Neon PostgreSQL. Fork this repo, configure your environment, choose a theme, and ship.
- Framework: Next.js 16 (React 19)
- CMS/Backend: Payload CMS 3
- Database: PostgreSQL 17 (Neon recommended)
- Auth: Auth.js (next-auth v5) with Google and GitHub OAuth
- Styling: Tailwind CSS 4, shadcn/ui, VS Code theme import system
- Storage: Vercel Blob
- Language: TypeScript
- Node.js 22.x or 24.x
- pnpm 9.x or 10.x
- A PostgreSQL 17 database (Neon, Supabase, or local)
- A Vercel Blob store
# Clone and install
git clone <your-fork-url>
cd hackerlab
pnpm install
# Copy the example env file
cp .env.example .envFill in the required values in .env (see Environment Variables below), then:
# Start the dev server
pnpm devOpen http://localhost:3000 for the frontend and http://localhost:3000/admin for the admin panel.
The first user to sign in is automatically promoted to admin.
Create a .env file from .env.example and fill in the required values:
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
Yes | PostgreSQL connection string |
DEV_DB_PUSH |
No | Set true to auto-sync schema without migrations (dev only) |
PAYLOAD_SECRET |
Yes | Encryption secret for Payload CMS |
BLOB_READ_WRITE_TOKEN |
Yes | Vercel Blob storage token |
BLOB_PREFIX |
Yes | Key prefix for blob storage (e.g. hackerlab_dev) |
AUTH_SECRET |
Yes | Auth.js session encryption secret |
AUTH_URL |
Yes | Base URL (e.g. http://localhost:3000) |
GOOGLE_CLIENT_ID |
No | Google OAuth client ID |
GOOGLE_CLIENT_SECRET |
No | Google OAuth client secret |
GITHUB_CLIENT_ID |
No | GitHub OAuth client ID |
GITHUB_CLIENT_SECRET |
No | GitHub OAuth client secret |
Generate secrets:
# Payload secret
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
# Auth secret
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"OAuth providers are optional and conditional — only providers with both their CLIENT_ID and CLIENT_SECRET configured will appear on the login page. You can run with just one provider, both, or none (email/password only via the admin panel).
Hackerlab supports Google (GCP) and GitHub OAuth out of the box. Configure one or both depending on your needs.
- Go to the Google Cloud Console
- Create a new project (or select an existing one)
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Select Web application as the application type
- Add authorized redirect URIs:
- Local dev:
http://localhost:3000/api/auth/callback/google - Production:
https://your-domain.com/api/auth/callback/google
- Local dev:
- Copy the Client ID and Client Secret
- Add them to your
.env:
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secretNote: You may also need to configure the OAuth consent screen under APIs & Services > OAuth consent screen. For development, set it to "External" with test users. For production, submit for verification.
- Go to GitHub Developer Settings
- Click New OAuth App (or Register a new application)
- Fill in:
- Application name: Your app name
- Homepage URL:
http://localhost:3000(or your production URL) - Authorization callback URL:
http://localhost:3000/api/auth/callback/github
- Click Register application
- Copy the Client ID
- Click Generate a new client secret and copy it
- Add them to your
.env:
GITHUB_CLIENT_ID=your-client-id
GITHUB_CLIENT_SECRET=your-client-secretFor production: Create a second OAuth App with your production URL as both the homepage and callback URL, or update the existing one. GitHub OAuth Apps only support one callback URL per app.
- Email is the canonical identity — the same email from different OAuth providers links to one user account
- The first user to sign in is automatically promoted to admin
- Non-admin users redirect to
/after login; admins go to/admin - Both login pages (frontend and admin) dynamically show only the providers you've configured
Hackerlab includes a VS Code theme import system that lets you restyle the entire app using any VS Code color theme. Themes map VS Code color tokens to shadcn/ui CSS variables at build time.
# List bundled themes
pnpm import-theme --list
# Apply a bundled theme to both light and dark modes
pnpm import-theme --file src/themes/dracula.json --both
# Preview the mapping without writing
pnpm import-theme --file src/themes/tokyo-night.json --both --dry-run
# Restore the original palette
pnpm import-theme --restore| Theme | Type |
|---|---|
| Dracula | Dark |
| GitHub Dark | Dark |
| Monokai | Dark |
| Nord | Dark |
| One Dark Pro | Dark |
| Solarized Light | Light |
| Tokyo Night | Dark |
| Rosé Pine Moon | Dark |
# Search and download interactively
pnpm import-theme --vscode "Catppuccin"
# Import from a raw JSON URL
pnpm import-theme --url https://raw.githubusercontent.com/.../theme.json --both| Flag | Description |
|---|---|
--file <path> |
Import from a local JSON file |
--url <url> |
Import from a URL (raw JSON) |
--vscode <name> |
Search VS Code marketplace and download |
--mode <light|dark> |
Write to a specific CSS block (auto-detected if omitted) |
--both |
Write to both :root and .dark blocks |
--dry-run |
Print the color mapping without writing |
--list |
Show available themes |
--restore |
Restore globals.css from backup |
--name <name> |
Select a specific theme from multi-theme extensions |
VS Code themes are single-mode. To have different light and dark themes:
pnpm import-theme --file src/themes/solarized-light.json --mode light
pnpm import-theme --file src/themes/dracula.json --mode darkVisit /admin/theme in the admin panel to browse all available themes with visual previews. Click any theme to see its color palette, then use the CLI commands shown on the page to apply it.
- Find a VS Code theme JSON file (from a GitHub repo, VSIX, or the marketplace)
- Save it to
src/themes/<name>.json - Apply it with
pnpm import-theme --file src/themes/<name>.json --both
Theme JSON files follow the VS Code theme format:
{
"name": "My Theme",
"type": "dark",
"colors": {
"editor.background": "#282c34",
"editor.foreground": "#abb2bf",
"button.background": "#4d78cc",
...
}
}src/
├── app/
│ ├── (frontend)/ # Frontend routes
│ ├── (payload)/ # Payload admin routes
│ └── api/ # Standalone API routes
├── collections/ # Payload collection configs
├── components/
│ ├── admin/ # Custom admin panel components
│ ├── icons/ # Icon components
│ └── ui/ # shadcn/ui components
├── lib/
│ ├── auth/ # Auth.js + Payload auth bridge
│ └── theme/ # Theme import system
├── themes/ # Bundled VS Code theme JSONs
├── migrations/ # Database migrations
└── payload.config.ts # Main Payload config
| Command | Description |
|---|---|
pnpm dev |
Start development server |
pnpm build |
Production build |
pnpm start |
Start production server |
pnpm lint |
Run ESLint |
pnpm check:types |
TypeScript type check |
pnpm test |
Run all tests |
pnpm prep |
Generate types and migrations |
pnpm codegen |
Regenerate import map and types |
pnpm import-theme |
Import and apply VS Code themes |
pnpm add:ui <name> |
Add a shadcn/ui component |
Hackerlab is designed for Vercel deployment with Neon PostgreSQL:
- Push your repo to GitHub
- Import into Vercel
- Set all environment variables in the Vercel dashboard
- Deploy
For the database, create a Neon project at neon.tech and use the connection string as DATABASE_URL.