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

yo81's avatar
Level 4

info frontend / backend / api structure

Hi guys I would like to try to make a website through laravel/api

frontend example.com

backend admin.example.com

my two questions are these: the api controller have to stay on the frontend or backend? example.com/api/ecc or admin.example.com/api/ecc

I would like no one to know the address of the backend

the other question is about file storage. Which of the two domains should it be in?

if i had to have a mobile app tomorrow, should i use amazon s3?

0 likes
3 replies
aurawindsurfing's avatar

@yohannes81

I feel your pain as you try to make sense of all of it ;-)

Ok one by one:

  1. What is front end - this is what users see and interact with. It should hold no logic and only display data to users and get data from users.

  2. What is backed? It is something like an admin panel where you do "stuff" with what users expect you to do eg. moderate, generate etc.

  3. Your code. Now this is where magic happens. The code you write will in the end generate frontend, generate your backend if needed and also handle API.

  4. Ok so what is API then? Well, imagine it is a front end but without all those nice html and css. In fact if you go to any of the functions in your app and at the end instead of

return view('welcome');

you do this or any other data you want:

return User::all();

You will get proper json response which is exactly what you expect from API.

5 Address of the backend - everyone can know it. You just secure it with something like Laravel Fortify.

6 File storage - look at answer 3.

7 S3 - nothing to do with any of it. You can use it or not, it has nothing to do with mobile apps or your app.

Hope that points you in the right direction!

1 like
martinbean's avatar

my two questions are these: the api controller have to stay on the frontend or backend? example.com/api/ecc or admin.example.com/api/ecc

@yohannes81 An API is neither front-end or back-end.

I would like no one to know the address of the backend

That’s not going to be possible if your “front-end” is consuming your API. All someone has to do is open the dev tools in any modern browser and they can see what URLs your application is making requests to, including any APIs.

the other question is about file storage. Which of the two domains should it be in?

if i had to have a mobile app tomorrow, should i use amazon s3?

Why would file storage be in any particular domain? I assume files will be consuming in both the front-end and back-end. So yes, S3 would be an appropriate location, especially if you’re planning to support other, non-web apps such as mobile apps.

Please or to participate in this conversation.