u/Ok-Nerve7307

▲ 6 r/webdev

I Stopped Building “WordPress Sites” and Started Building API-First Backends

I’ve been rethinking how I build WordPress projects as a solo developer and I’m curious how other people here are approaching this.

For context:

I build websites for animal shelters and rescues. Originally I was building traditional WordPress sites with themes tightly coupled to the backend. The more projects I built, the more I noticed the same problem over and over:

* backend logic stays mostly the same

* frontend requirements constantly change

* every redesign becomes a partial rebuild

So I started experimenting with treating WordPress less like “the website” and more like an application backend.

Current architecture:

* TrueNAS server

* Docker + Docker Compose inside a jail

* One global Traefik instance for routing

* Every project isolated in its own repo + compose stack

* VS Code Remote SSH from my Mac (home + on the go via Tailscale)

* WordPress acting as a headless/API-first backend

* React/Next.js frontends consuming a custom REST API

Instead of exposing raw WP post structures, I’m building a dedicated API layer:

/wp-json/shelter/v1/animals

/wp-json/shelter/v1/animals/{id}

The plugin contains:

* CPTs + taxonomies

* lifecycle/business logic

* transformers/view models

* query layer

* REST controllers

The frontend only consumes stable JSON contracts.

That means:

* I can swap frontends without touching backend logic

* build multiple frontend designs for the same backend

* eventually evolve the plugin into a SaaS/API product

I’m also separating repos aggressively now:

```txt

/workspace/projects/

├── animal-shelter-plugin/

├── shelter-backend/

├── shelter-next-frontend/

├── client-a/

└── client-b/

```

The reusable plugin lives independently from client projects.

What surprised me most:

WordPress actually becomes much cleaner once you stop treating it like the rendering engine and start treating it like infrastructure.

Curious:

* Are other people here using WP this way?

* How are you structuring multi-project Docker dev environments?

* Would you stay REST-first or move toward WPGraphQL immediately?

* Any major pitfalls you hit going API-first with WordPress?

Would genuinely love feedback from people further down this path.

reddit.com
u/Ok-Nerve7307 — 5 days ago

Shelter api

I'm trying to build out an API for animal shelters based on wordpress custom post types and it's meta fields...

The front end will be based on node.js and tailwind css and react or something like that...

So that the backend can stay the same for every client but the frontend is interchangeable.

Any ideas or thoughts?

reddit.com
u/Ok-Nerve7307 — 5 days ago