A demo vacation-rental marketplace made of two independent Next.js apps sharing one Neon Postgres database. The Payload admin app manages stays, locations, property types, stay types and amenities, and is the only writer. The storefront reads the same data directly through a SELECT-only Postgres role. It is a full example project rather than an installable plugin.
0
Stars
0
Forks
0
Open Issues
2 months ago
Last Updated
0
Weekly Downloads
v
npm Version
Dependencies
00 since Sep 20
| Date | Stars |
|---|---|
| Dec 6, 2026 | 0 |
| Dec 5, 2026 | 0 |
| Dec 4, 2026 | 0 |
| Dec 3, 2026 | 0 |
| Dec 2, 2026 | 0 |
| Dec 1, 2026 | 0 |
| Nov 30, 2026 | 0 |
| Nov 29, 2026 | 0 |
| Nov 28, 2026 | 0 |
| Nov 27, 2026 | 0 |
| Nov 26, 2026 | 0 |
| Nov 25, 2026 | 0 |
| Nov 24, 2026 | 0 |
| Nov 23, 2026 | 0 |
| Nov 22, 2026 | 0 |
| Nov 21, 2026 | 0 |
| Nov 20, 2026 | 0 |
| Nov 19, 2026 | 0 |
| Nov 18, 2026 | 0 |
| Nov 17, 2026 | 0 |
| Nov 16, 2026 | 0 |
| Nov 15, 2026 | 0 |
| Nov 14, 2026 | 0 |
| Nov 13, 2026 | 0 |
| Nov 12, 2026 | 0 |
| Nov 11, 2026 | 0 |
| Nov 10, 2026 | 0 |
| Nov 9, 2026 | 0 |
| Nov 8, 2026 | 0 |
| Nov 7, 2026 | 0 |
| Nov 6, 2026 | 0 |
| Nov 5, 2026 | 0 |
| Nov 4, 2026 | 0 |
| Nov 3, 2026 | 0 |
| Nov 2, 2026 | 0 |
| Nov 1, 2026 | 0 |
| Oct 31, 2026 | 0 |
| Oct 30, 2026 | 0 |
| Oct 29, 2026 | 0 |
| Oct 28, 2026 | 0 |
| Oct 27, 2026 | 0 |
| Oct 26, 2026 | 0 |
| Oct 25, 2026 | 0 |
| Oct 24, 2026 | 0 |
| Oct 23, 2026 | 0 |
| Oct 22, 2026 | 0 |
| Oct 21, 2026 | 0 |
| Oct 20, 2026 | 0 |
| Oct 19, 2026 | 0 |
| Oct 18, 2026 | 0 |
| Oct 17, 2026 | 0 |
| Oct 16, 2026 | 0 |
| Oct 15, 2026 | 0 |
| Oct 14, 2026 | 0 |
| Oct 13, 2026 | 0 |
| Oct 12, 2026 | 0 |
| Oct 11, 2026 | 0 |
| Oct 10, 2026 | 0 |
| Oct 9, 2026 | 0 |
| Oct 8, 2026 | 0 |
| Oct 7, 2026 | 0 |
| Oct 6, 2026 | 0 |
| Oct 5, 2026 | 0 |
| Oct 4, 2026 | 0 |
| Oct 3, 2026 | 0 |
| Oct 2, 2026 | 0 |
| Oct 1, 2026 | 0 |
| Sep 30, 2026 | 0 |
| Sep 29, 2026 | 0 |
| Sep 28, 2026 | 0 |
| Sep 27, 2026 | 0 |
| Sep 26, 2026 | 0 |
| Sep 25, 2026 | 0 |
| Sep 24, 2026 | 0 |
| Sep 23, 2026 | 0 |
| Sep 22, 2026 | 0 |
| Sep 21, 2026 | 0 |
| Sep 20, 2026 | 0 |
Trends appear after 7 days of data. Daily snapshots have not started yet.
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1388798370-root)<a href="https://payloaddirectory.dev/plugins/1388798370-root"><img src="https://payloaddirectory.dev/badge/1388798370-root.svg" alt="Payload Directory"></a>README
Short-stays booking marketplace — a Payload CMS dashboard and a read-only Next.js storefront, backed by Neon Postgres
Features • Architecture • Project structure • Getting started • Deployment
A demo short-stays (vacation-rental) marketplace split into two independent Next.js apps that share one Neon Postgres database — and nothing else.
cms-dash is the Payload admin dashboard where every listing and taxonomy value is managed. staybooking_front is the public storefront that reads the same data straight from the database through a SELECT-only role. There is no API between the two apps: the storefront queries Neon directly from React Server Components, so both apps stay simple and deploy independently to Cloudflare.
flowchart LR
A([Admin]) --> C[cms-dash<br>Payload CMS]
C -- "read + write" --> D[(Neon Postgres)]
D -- "SELECT only" --> F[staybooking_front<br>Next.js marketplace]
F --> V([Site visitors])
cms-dash — Next.js + Payload with the Postgres adapter (Drizzle under the hood). It is the only writer. Collections: Stays, Locations, Property Types, Stay Types, Amenities, Users. Everything lives under /admin; the root URL redirects there.staybooking_front — Next.js App Router storefront. Server components fetch data through a read-only Drizzle client built on @neondatabase/serverless, and filter state lives entirely in the URL.locations, property_types, stay_types, amenities), the stays table referencing them by foreign keys, plus Payload-managed child tables for image URLs and amenity relations. The database stores image URLs only — binaries live wherever the images are hosted.[!IMPORTANT] The read-only contract is the core of this architecture.
cms-dashmust be the only writer.staybooking_frontmust never hold credentials withINSERT/UPDATE/DELETE/DDL privileges — not locally, not in production.
.
├── cms-dash/ # Payload CMS admin dashboard (read + write)
│ ├── payload.config.ts # Payload config (Postgres adapter, migrations)
│ ├── src/collections/ # Users, Locations, PropertyTypes, StayTypes, Amenities, Stays
│ ├── src/migrations/ # Postgres schema, owned by Payload
│ └── src/seed.ts # Idempotent seed: lookup rows + sample stays
├── staybooking_front/ # Public marketplace (read-only)
│ ├── app/ # App Router pages (server components)
│ ├── components/ # Marketplace UI (filters, cards) + UI primitives
│ ├── lib/db/ # Read-only Drizzle schema + Neon HTTP client
│ ├── lib/queries.ts # SELECT-only data-fetching layer
│ └── scripts/ # readonly-role.sql + verify-readonly.ts
└── AGENTS.md # Architecture rules & conventions
Prerequisites:
cd cms-dash
npm install
Create cms-dash/.env:
DATABASE_URI=postgresql://<admin-user>:<password>@<host>-pooler.<region>.aws.neon.tech/neondb?sslmode=require
PAYLOAD_SECRET=<any-long-random-string>
# NEXT_PUBLIC_SERVER_URL=https://your-deployed-admin.example.com (optional)
Apply the schema, seed demo data, and start the dashboard:
npm run migrate # creates the tables from Payload migrations
npm run seed # lookup rows (cities, BHK types, amenities…) + 3 sample stays
npm run dev # open http://localhost:3000 → /admin, create the first admin user
[!TIP] Payload's Postgres adapter uses the raw
pgdriver, which occasionally trips over PgBouncer's prepared statements on the pooled endpoint. If a migration fails with a prepared-statement error, temporarily use Neon's direct (non-pooler) connection string, run the migration, then switch back.
Run staybooking_front/scripts/readonly-role.sql in the Neon SQL editor while logged in as the project owner. Replace the placeholder password and the admin role name in the default-privileges clause, then build the pooled connection string for the new staybooking_readonly role.
cd ../staybooking_front
npm install
Create staybooking_front/.env.local:
DATABASE_READONLY_URL=postgresql://staybooking_readonly:<password>@<host>-pooler.<region>.aws.neon.tech/neondb?sslmode=require
Verify the read-only contract — the script should report that reads work and writes are rejected by Postgres:
npx tsx scripts/verify-readonly.ts
npm run dev # http://localhost:3000
| App | File | Variable | Description |
|---|---|---|---|
cms-dash | .env | DATABASE_URI | Neon admin connection string (pooled) |
cms-dash | .env | PAYLOAD_SECRET | Secret used by Payload for auth/crypto |
cms-dash | .env | NEXT_PUBLIC_SERVER_URL | Optional public URL of the deployed dashboard |
staybooking_front | .env.local | DATABASE_READONLY_URL | Connection string of the SELECT-only Postgres role |
cms-dash
| Command | Description |
|---|---|
npm run dev | Start the admin dashboard in dev mode |
npm run build / start | Production build / serve |
npm run migrate | Apply pending Payload migrations |
npm run migrate:create | Generate a migration from collection config changes |
npm run migrate:fresh | Drop and recreate the schema, then re-apply (destructive) |
npm run seed | Idempotent seed of lookup rows and sample stays |
npm run generate:types | Regenerate Payload TypeScript types |
staybooking_front
| Command | Description |
|---|---|
npm run dev | Start the storefront in dev mode |
npm run build / start / lint | Standard Next.js scripts |
npx tsx scripts/verify-readonly.ts | Verify the SELECT-only database contract |
New cities, property types, stay types, or amenities are just data: add a row in the matching Payload collection (or INSERT into the lookup table). The storefront's filter sidebar and card badges read these tables on every render, so new values appear automatically — no code change, no redeploy. Stays always reference lookup rows by foreign key, never by copied strings, so renames and edits propagate everywhere.
Both apps are designed to deploy independently to Cloudflare Workers/Pages via OpenNext / @opennextjs/cloudflare and Wrangler:
fetch, which the Workers runtime supports. Set the read-only role's connection string as a Worker secret.pg-based adapter (raw TCP), which requires Hyperdrive or a compatible TCP proxy in a Worker environment.No Wrangler configs are committed yet; see AGENTS.md for the architecture rules and conventions any deployment should follow.
payload authjs
Sign in to Payload CMS through Auth.js 5 providers and use the Auth.js session as the Payload user
903.1k/wk206v3
payload upstash
Upstash Redis key-value adapter for Payload's built-in KV store
82333/wk7v3 v4
payload kv
Store counters, feeds and expiring data in Redis or KV stores while querying them as normal Payload fields
771.4k/wk0v3 v4
payload cloudflare email adapter
Payload email adapter that sends transactional email through the Cloudflare Email Service Workers binding
661.1k/wk4v3
payload kv cloudflare
Payload KV adapter that stores key-value data in Cloudflare Workers KV
6663/wk0v3 v4
seed
Seed an Atomic Payload database from the admin dashboard with a button and a POST endpoint
6033/wk37v3