I got tired of rebuilding the same frontend twice, so I built a tool that does it once

php dev.to

If you've ever built a frontend in Astro and then had to rebuild
the same thing in Twig or PHP for a client's WordPress or Symfony
backend — this is for you.

The problem

The workflow looks like this:

  1. You design and build a clean Astro frontend
  2. Client needs it on WordPress. Or Symfony. Or a custom PHP stack.
  3. You spend 2–5 days rewriting the same templates in a different language

Same structure. Same components. Same logic.
Different syntax.

It's not interesting work. It's translation work.
And it eats margin on every project.

What I built

Frontmatter Solo is a CLI tool that transforms a constrained
Astro project into explicit Twig or PHP templates.

npx @withfrontmatter/solo-check  # validate first (free)
frontmatter solo:build --adapter twig
frontmatter solo:build --adapter php
Enter fullscreen mode Exit fullscreen mode

You get clean, backend-ready output:

  • Twig templates for Symfony, Drupal, Craft
  • PHP templates for WordPress and custom stacks
  • A strict data contract: fm.site, fm.page, fm.props

No runtime. No framework lock-in. Just rendering.

How it works

Solo operates at build time only. It scans your Astro project
and generates templates from your components — but only if your
project follows a constrained set of rules:

  • Literal props only (string, number, boolean, null)
  • One layout per page
  • Global CSS only
  • Static images from public/ only
  • No client:* islands, no dynamic imports

This constraint is intentional. Solo isn't a general-purpose
Astro compiler. It's a handoff tool. The constraint is what makes
the output predictable and safe to deploy.

The free validator

Before you buy anything, there's a free OSS CLI to check if your
project is Solo-compatible:

npx @withfrontmatter/solo-check
Enter fullscreen mode Exit fullscreen mode

It runs the same rules as Solo and tells you exactly what needs
fixing. No account, no signup. Just errors and exit codes.

It hit 269 downloads in its first two days without any promotion.
Apparently a lot of people have this problem.

Why Astro

Astro's component model maps cleanly to Twig and PHP templates.
Props are explicit. There's no runtime state to serialize.
The constraint that makes Astro "static-first" is exactly what
makes it translatable.

I looked for prior art before building this. There's one abandoned
GitHub repo (simplegr/astro-to-twig, last commit 2022). That's it.

The stack

  • @withfrontmatter/core — MIT, open source, the JSON IR layer
  • @withfrontmatter/solo-check — free CLI validator
  • Frontmatter Solo — the paid generator, CLI + macOS app (Tauri)

The macOS app is a thin wrapper around the CLI with a clean UI
for teams who don't want to touch a terminal.

Pricing

$49 one-time. No subscription.

If it saves you one day of template work, it's paid for itself.

Try the validator first

npx @withfrontmatter/solo-check
Enter fullscreen mode Exit fullscreen mode

If your project passes, Solo will work.
If it doesn't, the error output tells you exactly why —
and what to fix.

frontmatter.tech/solo

Read Full Tutorial open_in_new
arrow_back Back to Tutorials