Resurf is made of two sites, a wordpress backend, in the wp
folder, and a node/express frontend, located in the site
folder.
The backend is a standard wordpress site, managed by composer, where wordpress is set to be installed in public/wp
(there is an .htaccess file which rewrites the "wp" part of the url away). The wp-graphql plugin is installed which exposes wordpress through a graphql api.
The entry point of the node frontend is site/server.js
. graphql-yoga
is used to set up a graphql server over express. http-proxy-middleware
to proxy parts of wordpress to be exposed throught the frontend (such as wp-admin, etc.). The proxy assumes that wordpress is running on http://wp
Finally, one nuxt nuxt application is setup per theme. The code for each nuxt app is in site/themes
. The app to be rendered is determined based on the hostname. There is a manual mapping of subdomains to the application to render.