#
#
#yamynginx2019-12-12 14:56:51
Backend
#yamynginx, 2019-12-12 14:56:51

How do you combine front-end and back-end?

Hello.
I plan to write a completely non-commercial project - photo hosting. Well, I just want everything.
I know that there are a lot of them, but:
1) Now I'm in my 3rd year at a technical school, and the teacher saw that I was doing the web and said that I could start doing the project now, so as not to wait for the 4th year.
2) I want to create something like "my brainchild". And I repeat - not for the purpose of getting rich. I just want to work with data, with pictures, create logic, API and all that. I even found HH, which determines whether a photo is 18+, so as not to publish it.
Now I only have a layout. I type a little, in my free time from work and study, but I gave myself a conditional deadline - to do it in a month. No, not because it is super difficult for me, but because I do it for my own pleasure in my free time. Nobody is chasing me.
So, I apologize for such a watery introduction. Actually, a question.
What is the best way to combine backend and front?
1) Is it better to write PHP code directly in HTML markup?
2) Is it better to get data via API via ajax?
The first option doesn’t really sympathize with me, because well, I don’t want to embed logic in fact into statics. But with the second option, not everything is so simple either - the content loading time will increase, despite the asynchrony. It seems to me that it is better to give a ready-made HTML page right away, but this idea contradicts the suggestion above.
These are the things, I sit with myself thinking. I don't understand what to do.
PS I want to do everything in pure HTML, CSS, there is also a framework in which I edited the styles for myself. I would not like to do it on Vue, Angular, because I don't do the front as much as the back end. I'm typing on UIKit and everything suits me, it's like assembling a constructor. And if you write on the same Vue, then it will no longer bring such pleasure.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yermek, 2019-12-20
@muxui

In my humble opinion, the project should be fundamentally divided into 2 parts:
You configure the backend by the url host/api/ to which you send the parameters (keys, identifiers) with
a post request
or test them separately.
The development cycle is something like this:
and so on for each of the functions of the site

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question