@atiqisrak/jerry-pagebuilder-engine
v1.3.0
Published
Express-based backend engine for the Jerry Pagebuilder.
Maintainers
Readme
@atiqisrak/jerry-pagebuilder-engine
Express-based backend engine for the Jerry Pagebuilder.
Install
pnpm add @atiqisrak/jerry-pagebuilder-engineUsage
import express from "express";
import { createPageBuilderRouter } from "@atiqisrak/jerry-pagebuilder-engine";
const app = express();
app.use(
"/pb",
createPageBuilderRouter({
/* db, storage, auth */
})
);
app.listen(3000, () => console.log("PB Engine running on :3000"));License
MIT
PageBuilder Backend (Express + Postgres) — No Docker
MVP backend for an Elementor‑style page builder. No auth. No Docker. Uses your provided DATABASE_URL.
Stack
- Node 18+, TypeScript
- Express
- PostgreSQL (JSONB) via
pg - Migrations:
node-pg-migrate - Validation:
zod - Uploads:
multer(local) - Blocks registry:
/api/v1/blocksreturns all available page‑builder components & defaults
Setup
- Create
.envfrom example and verifyDATABASE_URL:DATABASE_URL=postgres://olaf:Niloy%[email protected]:5432/Jerry PORT=3017 CORS_ORIGIN=http://localhost:3000 UPLOAD_DIR=uploads - Install deps:
pnpm install # or npm/yarn - Run migrations:
pnpm migrate:up - Start dev server:
pnpm dev - Seed sample page:
pnpm seed
Key Endpoints
- Health:
GET /health - Blocks:
GET /api/v1/blocks— list all block types with defaultsGET /api/v1/blocks/:type— details for a block
- Pages (draft & management):
GET /api/v1/pages— list?q=&status=&limit=&cursor=POST /api/v1/pages— create{ slug, title, seo?, tree? }GET /api/v1/pages/:slug— get draftPUT /api/v1/pages/:slug— save draft{ title?, seo?, tree }POST /api/v1/pages/:slug/publish— publish draftGET /api/v1/pages/:slug/snapshots— listPOST /api/v1/pages/:slug/rollback/:snapshotId— rollbackDELETE /api/v1/pages/:slug— delete
- Public render:
GET /api/v1/public/pages/:slug—{ tree, seo }(404 if not published)
- Media:
GET /api/v1/mediaPOST /api/v1/media/upload— multipart fieldfile
Blocks included
root, section, row, column, grid, heading, text, richtext, button, image, video, spacer, divider, list, card, hero, gallery, form, map, tabs, accordion, slider
Use /api/v1/blocks to drive your editor's left panel and right‑panel defaults.
Curl quick test
# Create
curl -X POST http://localhost:3017/api/v1/pages -H "Content-Type: application/json" -d '{"slug":"home","title":"Home"}'
# Save draft
curl -X PUT http://localhost:3017/api/v1/pages/home -H "Content-Type: application/json" -d '{"tree":{"id":"root","type":"root","props":{},"children":[{"id":"h","type":"heading","props":{"level":1,"text":"Hi"}}]}}'
# Publish
curl -X POST http://localhost:3017/api/v1/pages/home/publish
# Public fetch
curl http://localhost:3017/api/v1/public/pages/home
# Blocks list
curl http://localhost:3017/api/v1/blocksNotes
- No authentication; enable CORS only for your frontend origin.
updated_atauto-updates via trigger.- JSONB indices included for future querying.
