https://github.com/Pierstoval/php-js-boilerplate.git
Default JAMStack project ========================
Contains:
Makefile that self-documents a lot of commands to run on the projectThere are two solutions:
git clone https://github.com/Pierstoval/php-js-boilerplate.git && cd php-js-boilerplate && rm -rf .git/ && git init && git checkout -b main && git add . && git commit -a -m "Init project"
curl -sSL "https://github.com/Pierstoval/php-js-boilerplate/archive/refs/heads/main.zip" -o main.zip && unzip main.zip && rm main.zip && cd php-js-boilerplate-main && rm -rf .git/ && git init && git checkout -b main && git add . && git commit -a -m "Init project"
wget "https://github.com/Pierstoval/php-js-boilerplate/archive/refs/heads/main.zip" && unzip main.zip && rm main.zip && cd php-js-boilerplate-main && rm -rf .git/ && git init && git checkout -b main && git add . && git commit -a -m "Init project"
Run make install.
Then, you can visit the different parts of the app:
The application is served through several endpoints:
backend/public/Check also the Caddyfile for details about HTTP routing.
The backend app exposes only two endpoints:
/api endpoint, and it is defined with Api Platform./admin, configured with EasyAdmin.The frontend is served via SvelteKit, and is only a fallback after all other HTTP routes (static files, websocket and API).
So basically, everything that is not a file in the backend/public/ directory and that does not begin with /api or /admin will be served by SvelteKit.
The API is defined in the Api Platform schema, and exported to OpenAPI.
This OpenAPI export is then used by the frontend app, with the help of the orval CLI tool, to generate an HTTP client with endpoints, structs/classes and axios as HTTP client.