Comments
pieapplekitten t1_j6ai2o5 wrote
As a computer science student, we still make those basic front end websites. Later on, we move up to incorporating databases. Your answer is spot on.
StampedeJonesPS4 t1_j6bpgk5 wrote
Upvotes for the both of ya. The answer was great and your confirmation made it all the better. Cheers.
13lettersinhere OP t1_j6cfvez wrote
Bro forgot to explain like I’m 5
AgentScreech t1_j6crng6 wrote
It's like if you stole a menu from a restaurant. You would know what it was supposed to make, but you don't have the kitchen or the cooks.
When you go to a website, you interact with the frontend (menu in this analogy). The "backend" is the thing that processes your request (kitchen) and returns the result to the frontend to be presented
Accomplished_Bonus74 t1_j6dk1jk wrote
This is an amazing analogy
oldmansalvatore t1_j6clkdi wrote
Any website or app's source code is split into parts that you can access on your computer or browser (aka the client), and other parts that only exist on another large computer that your computer talks to (aka the server).
The parts on your client browser usually only outline what the website should look like, and how your browser should talk to the server computer. The real data you would access, and any calculations or other complicated stuff on your website, is largely stored and done on the server using the source code on the server.
Thrawn89 t1_j6dgvdm wrote
Bro forgot to read rule 4
phiwong t1_j6a9eil wrote
That would be like stealing a menu from a restaurant and thinking that you could recreate the dishes from it.
earlandir t1_j6bswn3 wrote
Iirs way worse than that. It's more like taking a picture of a restaurant and thinking you could go recreate the restaurant and dishes.
Target880 t1_j6a853v wrote
You can steal and make a copy of the HTML and other code that is delivered to the web browser. If only that is stored on the web server you can make a copy of the website, at least all of it you have access too. If you need to log in what you have access to often is in part specific for you. You can access for example access my Reddit chats
​
The problem is most website is not made by just static HTML files stored on a web server. Reddit, for example, uses phyton code that is executed on the server, and it access databases with all the post, comment, user preferences, etc that are used to create the HTML pages you get and your browser display right now. The website does not give you direct access to the phyton code or the database when you browse the website.
So making an exact copy is not as easy as it first looks like.
​
​
Nothing says the code that generates the website can be published too, you do not need to but it looks like at least part of Reddit is available at https://github.com/reddit I am not sure what is included and if it is complete or not. But I doubt that Reddit provides a public copy of the database.
xordos t1_j6a74h2 wrote
Actually if the website mostly is static pages/pictures, you can make 1:1 copy. But if the page doing some backend processing, like searching internal database, processing data, then it is hard to copy the website. For example, weather forecast website
SpiralCenter t1_j6agjwl wrote
You make a site that looked like the original site. But most sites have functionality and forms that are processed by the server.
As an example, I could copy reddit's login page and it would look identical, but I could not actually verify your login, show you your user name, or show you previous messages you posted.
wys15wyg t1_j6anzls wrote
Anything interactive, anything that processes information is done by server-side code, which takes information from what you enter into forms, like a log in, or a profile update, to return with the information you requested, such as your updated profile. That journey from your browser back to the server is encrypted and then sanitised (hopefully) so you cannot send anything malicious. This code sits on the server, and should never be accessible.
It is my job to make it inaccessible to you.
All you can steal, apart from gaining actual access to a server, is the front-end code, which the server sends back to make your browser do what we want it to do. Which is just HTML and CSS and JavaScript and for the most part only operates in the browser.
To complicate matters, there is most often JavaScript running in your browser that talks to the server through Ajax and WebSocket connections, and can perform similar request processing without actually submitting the page back to the server (what happens when you press send on a form). It's utilities like that that do things like autocomplete on search functions. Or live updates on your profile.
The best metaphor is the spinning arrow on your browser tab. When you submit a form in Chrome, it spins anti-clockwise while the request travels to the server. It then gets the processed information, and starts spinning in the other direction as it returns with the processed data.
I'm still amazed though when I meet developers who fail to grasp the difference between the front and back end. And yes, it does happen.
c00750ny3h t1_j6c6j6j wrote
There is front end and back end code. Front end code is like Javascript that gets downloaded to your local machine and it is run using your own computing resources. This part you can steal.
What you can't steal is backend code. Google's search function on their main page sends your text input into their own proprietary servers and returns the results to you, so their searching algorithm is nowhere in the web page source code.
texxelate t1_j6d28mm wrote
It’s like going through the drive through at McDonald’s. You drive up to the window and see a menu, but not how to make any of the items. You ask for a quarter pounder and you get one, but not step by step instructions on how to make it.
Beregolas t1_j6d533v wrote
There are (roughly speaking) 3 parts of most modern websites:
- How it looks (trivial to steal)
- What it does locally (easy to steal)
- What the server does in the background (very hard to steal)
The first is trivial to steal, there are even browser plugins that let you just download the Websites "look" part (HTML + CSS + images + etc).
You can imagine this like going to a theater play and taking a photo: You get a one time still image of the play, but nothing moves / does anything.
​
The second is a little harder, but still possible: All logic that happens in the browser (like pressing buttons, loading comments, writing a response on reddit) are (partially) managed by Code that is running in your browser. (mostly JavaScript) Since this code needs to run locally, you can just go ahead and save that too, but to make it work again, you might need to so a very minor amount of setup.
In our theater analogy, this is like kidnapping the actors. They will keep doing stuff you tell them to, but the scenery in the background doesn't change. So you cannot go on to the next act of the play, you are stuck in the second act (or whenever you took the picture and the actors)
​
The third part is what is normally referred to as "backend". There is a server somewhere, that talks to a database and gets the data to your browser (like a reddit post for example). This server also gets the good looking part ready for you, as well as the logic / code part, and gives it all to the browser to display and run. You cannot take this code, as it does not run on your computer, and only it's output ever reaches you.
In our theater analogy you can think of this, as the set designers and directors. They work in the background and never appear on stage. And since they never appear on stage, you cannot photograph or kidnap them! But they organize that all actors appear at the correct time, and they paint, build, and display the actual set design. Without this part, any reasonably complex play cannot be copied. And the same goes for websites.
[deleted] t1_j6a6yqt wrote
[removed]
RRumpleTeazzer t1_j6aabnp wrote
You can make a copy, and it will look like the original. But it will all be static, and will have basically no functionality. If this is what you are after (a skeleton which you fill out with your own content), you can do that.
IMovedYourCheese t1_j6aetji wrote
- You could copy the design, layout etc. of a website but a bulk of the functionality is usually happening on the server side. You have no way to copy that.
- Though you can copy it, the content is still copyrighted. A company can choose to sue you and get your site shut down if they want.
[deleted] t1_j6bkn68 wrote
[removed]
HyzerFlipr t1_j6c958y wrote
Because the server only returns the HTML, CSS, and JavaScript that is executed in the browser. You are missing a big piece of the puzzle here. The server code - which handles all of the API invocations and database transactions amongst a multitude of other things.
Jrippan t1_j6cfual wrote
Imagine you took a photo of a car and then tried to rebuild it based on that photo, that's pretty much the same. While the frontend (the visible part) of the website and car is available for everyone, its just the facade. The engine, gearbox and electronic is all hidden. While you can guess the inside of the car, its very hard to make a 1:1 copy.
While there is some basic logic in frontend to make sure you enter the correct values in forms etc, most of the actual important things & calculations is happening behind the scenes in the backend and this is not available for the normal user. Frontend & backend keep talking to each other as you use the webpage, but you can only see what the backend allows you to see.
Should also be said that most websites today isn't build with static HTML, CSS & Javscript you see in the source code of the browser. Its generated by javascript libraries like React, Angular & Vue based on conditions. So you only see "the source code" for the website generated just for you. The website may look very different if you had a different role (think admin, publisher etc)
Devil_May_Kare t1_j6cfvab wrote
Most websites these days are like a menu at a restaurant. They're decorated objects that sit in front of you to help you make sensible requests. Then the requests you made are passed along to the kitchen (the backend web server) which does what you asked for and sends you back the result.
Stealing the source code for the website and hoping to duplicate the web service is like making a copy of a restaurant's menu and hoping to duplicate the restaurant. You won't know anything about how their kitchen runs. You might find it useful to have a list of what requests the web service needs to answer, but most of the hard work hasn't been done for you.
SpoonNZ t1_j6cg43b wrote
I mean, you could stick a photo of the Mona Lisa on your living room wall but it doesn’t mean you’ll get tourists paying €17 to visit.
You can make a replica but there’s limited value in doing so.
[deleted] t1_j6cnsh5 wrote
[removed]
TheJamhead t1_j6cq64y wrote
Using only terms from the question (doubt 5 yos know what source code means)...
Sometimes you can, but only in really simple sites.
Most of the time the code you see when you access the website isn't the real source code. Stuff is often happening that changes the code that you can access. Also when the website talks to other websites, they can tell if it's not talking from where it's supposed to be so they won't talk back.
efvie t1_j6credv wrote
While the other answers are correct in that there is typically a 'backend' that you don't have direct access to and is actually responsible for at least putting together the content that is displayed on the page (the 'frontend'), I think it's equally important to understand that what you do see you have full access to* and can copy exactly.
For example, you could take this comment page, save it with all the content, images, and so on, and put it up for yourself. You could even have it update itself to a degree (although there are some ways that sites could try to protect against that.)
The reason this is important to know is that it limits the data you can make available on the frontend. The backend, for example, has access to all Reddit users — the frontend can't be given such access (beyond public information) because if it did, anyone accessing the page could see it. You also can't store 'secrets' like credentials to access services on the frontend directly, and so on and so on.
* There's again ways to protect against some access, mostly by making it very inconvenient, but ultimately for anything to appear on your screen it needs to be transmitted.
masagrator t1_j6cro3f wrote
What you are getting is just a ready to eat dish. You are not getting whole recipe to make it.
whoiskjl t1_j6d09xm wrote
Like cakes, you can eat and taste even share with your fiends but you have no idea how I made it
theGreatWhite_Moon t1_j6d0typ wrote
The reason for stealing the page matters here. If you want to plant a tree it is not a good idea to steal the snow instead of the dirt underneath it to plant it.
Ottos1 t1_j6d1po6 wrote
That's why hackers can make a website that looks like your bank website to steal your credentials
BizarroMax t1_j6d4vlv wrote
The same reason that if you borrow a copy of Star Wars for personal use, you can’t redistribute copies for commercial use. You don’t own the rights to do so and nobody who does gave you permission.
Toger t1_j6dowzd wrote
You can steal the visual portion of it. The portion that makes it actually /do/ anything is on the server and not visible to the client.
SoftDev90 t1_j6dpf4i wrote
Eli5 answer: you see the cake, not all the ingredients that went into said cake, the heat incorporated into it to make all the parts work, etc. You just see the final product.
As a fullstack dev i feel uniquely qualified to answer this question. You only see some of the site. There is lots of code that run server side on the backend that you have no access too. For example, an Ajax call that sends data to the server in order to add or retrieve data from the database. You can't see that code, only what is sent over. Things can get even more complex when you start mixing in APIs and other services outside of the main server.
Also you cannot see the structure of the database either. You can infer, but not copy it exactly. Websites are a lot more than just what you see and is a common complaint of backend devs that don't get as much recognition as front end devs because a lot of there code and contributions are not as visible to non tech people.
ShankThatSnitch t1_j6dwmn4 wrote
Some you can and some you can't. It depends on how the site was built.
The Raw HTML, CSS, and Javascript is visible, and for older websties, that may be all you need. But if a site is made using C#/.NET, PHP, jQuery, Angular, React...etc These things get compiled(converted) from those languages on the server side, and converted into the stuff you see. You can see the end result, but not what goes on behind the closed doors.
So you could steal the code and make something appear the same, but it won't function.
samuarichucknorris t1_j6jkjii wrote
What your browser barfs back is just HTML / CSS.
Unless the website is 100% client side, then no you cannot just copy the HTML source and rip off the website.
There is an entire tech stack / ecosystem behind the scenes that reacts to what data your sending back over the wire and in turn you get a response containing the HTML. Your "abstracted" away from everything that isn't in the presentation layer (source code wise).
mildewey t1_j6ak400 wrote
Websites have three parts that you could steal.
- HTML (hypertext markup language) - this defines the text, links and pictures you see and their general organization.
- CSS (cascading style sheets) - this defines the layout of the HTML pieces and how the look, like rounded/squared, colors, etc
- JavaScript - this defines how the information on the page changes and allows user interactions beyond the basic functionality of the web browser.
HTML is easy to steal, you can copy and paste the content easily.
The CSS is a bit trickier, but the browser allows you to see it if you go into developer mode.
The JavaScript is available like the CSS, but modern developers minify it by replacing the more legible code they work on with difficult to read versions of the same code.
Finally, like others have said, even if you copy the whole website, that doesn't mean you have access to the database and server which can be a large part of the functionality of the website.
squigs t1_j6bqx9o wrote
Nothing technical. Just like you can scan and OCR a book, you can copy the code for a website.
But that's copyright violation, which is illegal.
In practice it will rarely do you a lot of good. Sure, there are some static websites, but most are interactice in some way, and usually rely on server side stuff.
[deleted] t1_j6a6qjp wrote
[deleted]
saintpetejackboy t1_j6a6w26 wrote
Only some code is presented to the client on the front end. A lot of the heavy lifting is done on the backend using code that the browser is unaware of.
In addition, most interactions you have with websites involve databases of information. Without having your own similar mirror of data, the code is largely functionless.
Many years ago, web development classes would often have people build a "pizza ordering website", using HTML and eventually CSS - form fields, etc. - but those are just a facade... They rarely actually did anything tangible or saved data anywhere until you got further.
Copying the source code of most websites is going to give you fairly poor results, go ahead and try it, it is basically just stealing the non-working pizza ordering UI, at best case scenario.