Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

llioor's avatar

Frontend, Backend, API on different servers

Hi everyone, I want to build a system with these projects: api.example.com admin.example.com payments.example.com example.com

I'm using AWS as my hosting. Each project needs to be hosted in a different server because I want to use "aws load balancer" for each project. The API will be called from an HAProxy server - http://www.haproxy.org because I'm using multiple domains with SSL but it is not supposed to make any problem.

What is the best why to handle it?

  1. Do I need to make one project and split the routes.php file to routes-admin.php, routes-api.php, routes-payments.php in order to avoid duplication of modeling?
  2. Do I need to split the projects, install laravel in any server and to duplicate models if needed?
  3. Do I need to keep all models in the API project and all the rest project will "call" the api in order to get/edit/delete? of course I will need to use authentication before the "edit/delete" calls...

What is recommended? Thank you very much in advanced!

0 likes
1 reply
Helldrain's avatar

Hi. I want to split into different server too. What solution did you go for?

Please or to participate in this conversation.