One config, whole stack. laxative conducts poops (frontend) and septic (backend) into a single MVP β from one poops.json.
It's a conductor, not an engine. poops bundles and renders; septic serves the API, generates the forms, and feeds the static build. laxative just runs them together, on one origin. It reimplements nothing.
You already have the organs:
- poops β the bundler + static-site generator.
- septic β config β SQLite + REST API + generated forms + the poops build bridge.
They already share poops.json. What was missing: running them as one thing β the API and the static site on the same host, so a generated <form> POSTs to /api on the origin that served the page. That's laxative.
npm i -D poops laxative
laxative init # scaffold poops.json (markup + styles + scripts + septic + a form) + the pages
laxative dev # site + /api on one origin; poops watches + live-reloads behind it
laxative build # septic build (DB β markup + forms) β poops compile β dist/
laxative serve # production: serve dist/ + /api + /uploads from one processEvery command takes -c <path> (a config file other than poops.json), -p <number> (the port, over PORT and the 3000 default) and -q (hide the info lines β warnings and errors still print), spelled the way poops spells them.
septic comes along as laxative's own dependency β you never install it separately. poops is an optional peer you install yourself.
Full reference: stamat.info/laxative.
laxative serve/dev boots septic's app (mounting /api/*, /uploads) and serves the poops-built site behind it. Same host, same port:
GET / β dist/index.html (poops output)
GET /api/messages β septic REST (JSON or, for HTMX, HTML)
POST /api/messages β the generated form's target
GET /uploads/β¦ β septic media
A frontend-only project (no septic block) still works β laxative just serves the static site.
Define a resource once in poops.json β septic makes the table + API + form partial, poops renders the page that includes it, laxative serves both together. Define messages β get a working, validated contact form on a static page, wired to its own endpoint.
Yes, still a fan of toilet humor. π©π½π
MIT Β© Stamat