The difference between the front-end and back-end is generally the following:
The front-end is essentially just the HTML/CSS/JS that the browser gets from a server somewhere. These 3 can “do things” on the browser, and is what the user interacts with.
The back-end is everything else. This could be a server-side language, or program like Wordpress, the database that Wordpress, or the server-side language connects with, or even the operating system that Wordpress, or that server-side language runs on.
So its true you could build something with just a front-end, in regards to using something like React, where you can create something with HTML/CSS/JS, where React manages those 3 for you to manage what the user sees. Those are sent over to the user from a server, where this server doesn’t need to do anything but send over those static files, which then are dynamically managed by React (which runs on JS) to manage the HTML/CSS the user sees. Thats an example of just a front-end app, but even that sort of app needs some sort of software to get to the user’s browser over the internet.
For example, this forum could be done with just server-side languages, where you’d write into an
input field, hit some
button that submits a
form to a server-side endpoint. Then the server-side code would be something like PHP, or Python, or Pearl. That code would then read/update the database such as MySQL, and then dynamically create the HTML and CSS to send back to the user’s browser**. This is then what the user sees after their form submit.
The caveat of this approach is on what the user sees, or can do after they hit submit. In this “server-side” based approach they actually can’t really do anything, as the server needs to do all of those tasks, and then return content back to the user. This was great back when home computing wasn’t as powerful, and bandwidth limited.
Finally, the general purpose of a “server-side” language is to handle all the stuff the client-side can’t. Going back to the forum post example, you need to have an account to post on this forum. This account is yours, and requires some authentication, either with an email+password or using an external service like Github. This authentication requires some “secrets” that the server needs to use to keep track of your private information. It acts as a secured environment. This secured environment can only be done on a server, as sending this sort of information to the client would allow anyone to see it. Its these “keys” or “secrets” that a server is primarily based around, as from those it can then manage private user information coming in from external services, or end user’s browsers.
I wont go into the general details of what sort of “secrets” or “keys” most server’s would need, but just keep in mind server-side code can use them to do things client-side code just can’t due to the client-side being 100% readable, and thus fully exposed to anyone’s prying eyes.