Skip to content
Documentation

Memeh Web Engine (PHP MVVM)

The Web Engine is an optional runtime that helps you ship websites and portals in simple PHP hosting environments (including shared hosting) — while still keeping your frontend in real HTML/CSS/JS.

Overview

A simple runtime for real frontends

The Web Engine helps teams that want the simplicity of “drop-in hosting” without giving up control over layout. You build the frontend. MemehCMS stays the content hub behind it.

MVVM, not magic
Controllers build explicit ViewModels. Templates stay clean and predictable.
Your HTML stays yours
Mustache templates render your markup—no lock-in theme “box.”
Why it exists

Because deployment reality is messy

Not every institution can run a modern app platform on day one. The Web Engine gives you a “practical first step”: ship a solid public website today, then evolve your frontend over time (or consume MemehCMS APIs directly when you’re ready).

Best fit

Shared hosting, simple VPS deployments, quick rollouts, and teams who want clean HTML output with a stable rendering flow.

Request flow

Controller → ViewModel → Mustache View

Keep controllers thin. Make ViewModels explicit. Render clean Mustache views. That’s the whole philosophy.

GET /services

routes/web.php
  → ServicesController@index

ServicesController
  → $vm = ServicesViewModel::fromApi(...)
  → View::render('services.mustache', $vm)

layouts/layout.mustache
  → {{> pages/services.mustache }}
Folder structure

A predictable layout teams can learn fast

Keep the runtime boring and stable. Put your creativity in the frontend templates and assets.

app/
  Controllers/
  ViewModels/
  Services/
resources/
  views/
    layouts/
    pages/
    partials/
public/
  assets/
routes/
  web.php
public/
  index.php
Templates

Layouts, pages, partials — clean and reusable

Use a base layout for your header/footer and shared UI. Use pages for route-level templates. Use partials for reusable components (cards, lists, navigation).

Layouts
Your global shell: head, header, footer, scripts, main container.
Partials
Reusable slices: hero blocks, list items, CTA bars, navigation.
ViewModels

ViewModels are your contract

Don’t push raw API responses straight into templates. ViewModels reshape data into a stable, template-friendly structure. This keeps themes maintainable and avoids accidental coupling.

// Example ViewModel output (plain array)
[
  "pageTitle" => "Services",
  "items" => [
    ["title" => "Birth Certificate", "url" => "/services/birth-certificate"],
    ["title" => "Trade License", "url" => "/services/trade-license"],
  ],
]
MemehCMS APIs

Fetch content from MemehCMS, then render your UI

The Web Engine is headless-first: your ViewModels fetch content from MemehCMS endpoints and map it into your templates.

GET /api/zones/{zone}/v1/pages/{slug}
GET /api/zones/{zone}/v1/news?limit=25
GET /api/zones/{zone}/v1/articles?limit=25
Tip: keep your UI consistent by mapping API content into a small set of reusable blocks/components in templates.
Deployment

Choose what’s practical

MemehCMS doesn’t force one deployment path. Pick what your team can support.

Consume APIs directly
React/Vue/Laravel/anything. Full frontend freedom.
Use Web Engine
Simple PHP hosting environments and fast rollouts.
Static export
Publish HTML/CSS/JS for maximum simplicity.
Developer pool

Need engineers to ship fast?

If you’re deploying a Memeh Zone (managed) or running your own Zone, we can connect you with vetted developers to build portals, implement templates, integrate APIs, and deliver production rollout.

Next steps

What to do next

1) Download the starter
Skim the folder structure, routes, and one example page.
2) Build one page end-to-end
Controller → ViewModel → Mustache template.
3) Map content cleanly
Keep ViewModels stable; don’t leak raw API into templates.
4) Ship your first rollout
Then expand across institutions and brands.

Want us to implement your first portal?

Bring your design. We’ll ship the first implementation and set your team up to scale across institutions.