Payload-powered website and business profile CMS for building editable public pages while syncing selected business profile sections from Google Maps-derived data.
Built with Payload CMS, Next.js, MongoDB, and Docker.
- Editable website pages - Build public pages with Payload layout blocks, drafts, preview, SEO, redirects, and on-demand revalidation.
- Posts and updates - Publish posts with rich content, media, related posts, search indexing, and draft workflows.
- Business profiles - Store Google Maps URLs, resolved Place IDs, sync status, raw snapshots, popularity data, and linked Payload pages.
- Synced profile blocks - Render business information, hours, popular times, photos, reviews, services, maps, questions, and owner updates as page blocks.
- Business profile jobs - Fetch profile data through Firecrawl or direct fetch, resolve Places API IDs, import photos into Payload media, and refresh linked pages.
- Admin customization - Manage admin branding, login copy, dashboard content, header/footer navigation, index pages, and migration tools.
- Production tooling - Docker image, Compose stack, Payload jobs autorun, Sentry hooks, SMTP email support, reCAPTCHA form validation, Dittofeed tracking, and sitemap/LLM text routes.
- Clone the repo and create a
.envin the project root. Set at least:PAYLOAD_SECRET- secret for Payload auth and JWT encryption.NEXT_PUBLIC_SERVER_URL- public URL of the app, such ashttp://localhost:3000.CRON_SECRET- secret for cron/job endpoints.PREVIEW_SECRET- secret for draft preview requests. Optional:SMTP_*for email,NEXT_PUBLIC_RECAPTCHA_SITE_KEYandRECAPTCHA_SECRET_KEYfor forms,NEXT_PUBLIC_SENTRY_DSNfor Sentry,DITTOFEED_ENABLED,DITTOFEED_WRITE_KEY,DITTOFEED_AUTH_HEADER, andDITTOFEED_API_BASE_URLfor Dittofeed tracking,GOOGLE_MAPS_API_KEY,FIRECRAWL_API_KEY,FIRECRAWL_BASE_URL, andBUSINESS_PROFILE_*settings for profile sync. MongoDB credentials default in Compose; override withMONGO_INITDB_ROOT_USERNAME,MONGO_INITDB_ROOT_PASSWORD, andMONGO_DATABASEif needed.
- Start the stack with Docker Compose using this project's docker-compose.yml:
docker-compose up
- Open
http://localhost:3000/admin, create an admin user, then configure Pages, Posts, Business Profiles, and site globals.
Editable public pages. Pages support drafts, preview, SEO, redirects, hero settings, and a large block library for manually authored sections.
- Title / slug - The public URL and admin title.
- Hero - Configurable page hero content.
- Layout blocks - Content, media, forms, galleries, accordions, tabs, stats, testimonials, business profile blocks, and other reusable sections.
- SEO - Payload SEO plugin fields.
- Drafts - Editors can preview pages before publishing.
Blog posts, news, and synced business profile updates.
- Title / slug - The public post URL and listing title.
- Authors - Related users with population hooks.
- Published at - Publication timestamp.
- Content and blocks - Rich text plus page-style layout blocks.
- Related posts - Manual editorial relationships.
- SEO and search - SEO plugin metadata and search plugin indexing.
- Drafts - Posts can be drafted, previewed, scheduled, and published.
Source records for profile-page syncing.
- Name - Label shown in the admin.
- Enabled - Whether the profile is included in sync runs.
- Page - Linked Payload page. If omitted on create, a page is created automatically.
- Google Profile - Google Maps URL, resolved Place ID, and geocoded coordinates.
- Sync status - Status, transport, last synced time, and error output.
- Sync limits - Optional per-profile limits for photos, reviews, and updates.
- Snapshots - Latest normalized profile data, owner updates, popular times, wait times, and time-spent data.
The sync job refreshes only business-profile-owned sections on the linked page, leaving manually authored page content intact.
Upload collection for images, video, and other assets used by pages, posts, admin branding, and synced business profile photos. Business profile photo imports are stored here when available so public pages render local Payload media instead of only remote URLs.
Admin role records used by the custom access-control helpers. Ensure required roles exist before changing role-based collection, global, or admin visibility rules.
Auth-enabled admin users. User roles are used by access control to separate full admins from restricted manager roles.
Controls Payload admin branding and operations.
- Business profile sync - Runtime overrides for sync enablement, transport, Google cookie, Firecrawl wait/timeout, raw HTML logging, run limits, photo/review/update limits, and auto-publishing synced updates.
- Admin panel icon - Navigation icon and admin favicon source.
- Login screen - Login logo and welcome content.
- Dashboard welcome banner - Extra dashboard content.
Navigation data rendered by the public site header.
Footer navigation and public footer content.
Configuration for generated listing pages, including posts index content, hero slider settings, blocks, and SEO metadata.
System global used by admin migration utilities.
- Public content - Published pages and posts are readable publicly.
- Draft and admin content - Authenticated users can manage content according to role restrictions.
- Business Profiles - Restricted to authenticated non-content-manager users.
- Roles and system controls - Managed by authenticated admins and hidden from restricted manager roles where configured.
- Jobs - Can run for logged-in users or requests with
Authorization: Bearer <CRON_SECRET>.
Local API calls that pass a user should set overrideAccess: false, and nested Payload operations inside hooks should pass req so access and transaction behavior remain correct.
- Send an authenticated
GET /api/pages/:id?draft=true&depth=0with the default field selection. - Copy the response
ETagif it starts with"profile-draft-. Include both quotes. - Send it as
If-MatchonPATCH /api/pages/:id. For a draft save, add?draft=true&depth=0. - For a publish, send
PATCH /api/pages/:idwith"_status": "published"in the body. - On success, store the new
ETagfrom the PATCH response. - If the response is
409or412, fetch the draft again and review the changes before retrying.
If the response has no Profile revision tag, stop the conditional edit or publish. The API accepts one exact revision tag. Wildcards and tag lists receive 412. Normal Payload access, validation, and document lock rules still apply.
Conditional writes work on standalone MongoDB, including the bundled Docker Compose database. Page saves, autosaves, publishes, and restores advance the revision, including updates without If-Match. On a replica set, the Payload adapter uses transactions when DATABASE_URL includes replicaSet=<name>.
Stop old Profile instances before you start the new version. Back up the database before the upgrade. Use the same Profile version on every app instance that writes to this database.
On startup, Profile creates the profile_page_versions MongoDB view. The database account needs permission to create and read this view. Existing pages keep their IDs and version history. The first write to each page records which version IDs are current. Each subsequent write saves the revision and version IDs together on the parent page.
Each standalone autosave writes a new version ID. If the preceding version was also an autosave, Profile retires that version. An interrupted write can leave an unreferenced version in MongoDB. After its first write, a page shows only referenced versions in the history and restore API.
Older Profile releases cannot read drafts saved with this storage. For a rollback to an older release, use the database backup from before the upgrade. After a database restore or a change to the MongoDB deployment, fetch a fresh revision tag.
- sync-business-profiles - Fetches enabled business profiles, resolves Google Place IDs, retrieves profile data through Firecrawl or direct fetch, imports synced photos to Media, updates linked page business blocks, and syncs owner updates to Posts.
Payload job schedules are driven by jobs.autoRun. The Docker image enables Payload jobs autorun with:
PAYLOAD_JOBS_AUTORUN=truePAYLOAD_JOBS_AUTORUN_CRON=* * * * *
The business profile task uses BUSINESS_PROFILE_SYNC_CRON or defaults to 0 */15 * * * *. Business profile sync is disabled unless BUSINESS_PROFILE_SYNC_ENABLED is set to a true-ish value (true, 1, yes, or on). Compose also defaults BUSINESS_PROFILE_SYNC_CRON to 0 */15 * * * *.
For multiple app replicas, enable jobs autorun on only one instance to avoid duplicate sync work.
pnpm dev- Start the Next.js dev server with Payload admin at/admin.pnpm build- Build the production app.pnpm start- Run the production server.pnpm generate:types- Regenerate Payload types after schema changes.pnpm generate:importmap- Regenerate the admin import map after adding or changing admin components.pnpm test:int- Run Vitest integration/unit tests.pnpm test:int tests/int/pageRevision.int.spec.ts- Run page revision tests withPROFILE_PAGE_REVISION_TEST_MONGODB_URLset to a test server.pnpm test:e2e- Run Playwright tests.pnpm test- Run integration and e2e tests.
Use .env.example as the local starting point. For local development without Docker, provide a reachable DATABASE_URL; for Docker Compose, the app service builds its own MongoDB connection to the mongo service.
After schema, collection, global, or admin component changes, regenerate types/import maps as needed before typechecking.
The repo includes a production Compose setup that runs the app and MongoDB:
- Set required env in
.env:PAYLOAD_SECRET,NEXT_PUBLIC_SERVER_URL,CRON_SECRET, andPREVIEW_SECRET. Optionally set SMTP, reCAPTCHA, Sentry, Firecrawl, Google Maps, andBUSINESS_PROFILE_*variables. - Run:
docker-compose up
- Open
http://localhost:3000/adminand create your first user.
The app image is built from the project Dockerfile; Compose uses ghcr.io/transformable-app/transformable-profile:latest by default. Override with TRANSFORMABLE_PROFILE_IMAGE.
Images are published to GitHub Container Registry:
ghcr.io/transformable-app/transformable-profile
docker run --rm -p 3000:3000 \
-e DATABASE_URL='mongodb://<host>/transformable_profile' \
-e PAYLOAD_SECRET='<secret>' \
-e NEXT_PUBLIC_SERVER_URL='https://your-domain.example' \
-e CRON_SECRET='<cron-secret>' \
-e PREVIEW_SECRET='<preview-secret>' \
ghcr.io/transformable-app/transformable-profile:latestSet these only when profile syncing should run:
BUSINESS_PROFILE_SYNC_ENABLED=trueBUSINESS_PROFILE_SYNC_CRON='0 */15 * * * *'GOOGLE_MAPS_API_KEYfor Place ID resolution.FIRECRAWL_API_KEYand optionallyFIRECRAWL_BASE_URLfor Firecrawl profile scraping.BUSINESS_PROFILE_FETCH_TRANSPORT=firecrawlordirect.BUSINESS_PROFILE_GOOGLE_COOKIEwhen Google Maps scraping needs a cookie header.BUSINESS_PROFILE_SCRAPE_REQUEST_DELAY_MSto space Firecrawl scrape requests. Defaults to30000.BUSINESS_PROFILE_MEDIA_IMPORT_TIMEOUT_MSto tune photo import timeouts.
- Set
DATABASE_URL,PAYLOAD_SECRET,NEXT_PUBLIC_SERVER_URL,CRON_SECRET,PREVIEW_SECRET, and any SMTP, reCAPTCHA, Sentry, Firecrawl, Google Maps, or business profile sync env required by the deployment. - Build and start with
pnpm build && pnpm start, or use the Docker image. - For cron, rely on in-process
PAYLOAD_JOBS_AUTORUNor call the Payload jobs endpoint on a schedule withAuthorization: Bearer <CRON_SECRET>. - For business profile sync, keep profile sync disabled until required credentials and scraper settings are configured.
For Payload CMS: Discord or GitHub discussions.