Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

45 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Š laxative npm version ci license mit

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.

Why

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.

Use

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 process

Every 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.

The one-origin server

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.

The whole loop

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

About

πŸ’Š One config, whole stack: conducts poops (frontend) + septic (backend) into one MVP.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages