{"id":27191,"date":"2022-05-06T15:49:38","date_gmt":"2022-05-06T13:49:38","guid":{"rendered":"https:\/\/www.wbscodingschool.com\/?p=27191"},"modified":"2025-05-12T15:33:53","modified_gmt":"2025-05-12T15:33:53","slug":"how-to-start-learning-backend-development","status":"publish","type":"post","link":"https:\/\/www.wbscodingschool.com\/blog\/how-to-start-learning-backend-development\/","title":{"rendered":"How To Learn Backend Development: A Guide To Get Started"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This guide is meant as a thorough but accessible introduction to backend development, both the theory half and the practical coding half. It is aimed primarily at readers who are familiar with frontend web development and who are considering expanding their skills, but anyone should be able to follow.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our article is divided into four parts.<br><br><strong><u><a href=\"#part1\">Part 1<\/a><\/u><\/strong> will be dedicated to the <strong><em>theory<\/em><\/strong>. We will explore what \u2018backend\u2019 really is and how it differs from frontend, and we will lay out its essential concepts and key terminology.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"#part2\"><strong><u>Part 2<\/u><\/strong><\/a> serves as a quick preface to the technology and languages that we\u2019ll use in part 3.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"#part3\"><strong><u>Part 3<\/u><\/strong><\/a> is a <strong>practical introduction<\/strong> to making a backend. We will get a backend program to print \u201cHello world!\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><u><a href=\"#part4\">In part 4<\/a><\/u><\/strong>, we finish up with some final pointers and advice about continuing your learning.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is a guide to a specific topic and not to programming in general &#8211;\u00a0 which is why, in case you noticed,<a href=\"https:\/\/www.wbscodingschool.com\/web-app-development-bootcamp\/\"> <\/a><a href=\"https:\/\/www.wbscodingschool.com\/web-app-development-bootcamp\/\">the curriculum of our bootcamps in web and app development<\/a> looks different!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">New programming topics can be confusing. If you are totally new to \u201cbackend\u201d, do yourself a favour, give the article some time, and maybe read it more than once. And by all means google a lot!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"part1\"> <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Part 1 &#8211; Let\u2019s look at some ideas and confusing words.<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I\u2019d like to start by trying to draw some lines between different ideas and terminology. All this technical language can be confusing, and even senior developers will mix these terms up.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As front-end developers we are usually boxed in&#8230; in this box. The browser. We write our HTML files and they show up in here.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.wbscodingschool.com\/wp-content\/uploads\/2022\/05\/1.-pic1.webp\" alt=\"\" class=\"wp-image-27153\" style=\"width:529px;height:286px\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Other front-end \u201cboxes\u201d exist too though, right?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There\u2019s Android apps, iOS apps, Windows apps etc. and they all have frontends too.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"367\" src=\"https:\/\/www.wbscodingschool.com\/files\/2.-AdobeStock-by-mast3r_384959898-1024x367.jpeg\" alt=\"mix race web developers creating program code development of software and programming concept portrait horizontal copy space vector illustration\" class=\"wp-image-27155\"><figcaption class=\"wp-element-caption\">Adobe Stock \/ mast3r<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">While developers making Windows or Android apps might be using different programming languages in different boxes, not writing in HTML and CSS, they\u2019re still all frontends.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">So, what is frontend? <\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u201cThe things that the user can see, hear and interact with\u201d.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I thought it worthwhile to clarify this point. <strong>The frontend isn\u2019t just a web thing.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">More often than not, a frontend usually needs something <em>more<\/em>, some extra information, be it to download a video, or a user\u2019s new unread messages (and even confirm if that user is authorised to read messages in the first place).<br><br>All of this happens somewhere else. We typically call that somewhere else the \u201cBackend\u201d (or API, or server, we\u2019ll untangle that confusion later).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In a very broad sense, the backend is the stuff we don\u2019t see directly as users. The data and logic behind the visual experience. It could be getting data from a weather service for the weather widget.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/www.wbscodingschool.com\/files\/3.-AdobeStock-by-Andrey-Popov_122911027-1024x683.jpeg\" alt=\"Close-up Of Senior Woman Holding Smartphone With Colorful Application Icons At Home\" class=\"wp-image-27157\"><figcaption class=\"wp-element-caption\">Adobe Stock \/ Andrey Popov<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The phone itself has no way of knowing what the current weather is like, so it talks to a \u201cbackend\u201d to get that data and show it to the user.<br><br>When you boot up a computer game and it remembers your name and what level you are currently playing, it\u2019s reading that data from a file saved on your computer that contains all that information.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/www.wbscodingschool.com\/wp-content\/uploads\/2022\/05\/4.-pic4.webp\" alt=\"\" class=\"wp-image-27159\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">When you push control+P in the browser, a little \u201cfrontend\u201d window pops up, and that window can talk to the printer plugged into your computer, behind the scenes (the backend!).<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"492\" src=\"https:\/\/www.wbscodingschool.com\/files\/5.-pic5-1024x492.png\" alt=\"\" class=\"wp-image-27161\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So these are all examples of frontends working with backends to provide a useful service or experience to the user.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">So, what is backend?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u201cA program (or a file) that <em>a frontend <\/em>program can interact with to get additional information or functionality for the user\u201d.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s zoom back in to what this means in practice, and specifically for a web developer. The backend of a website is usually a \u201cserver\u201d, that we talk to via its \u201cAPI\u201d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you go to youtube.com, your browser communicates with the YouTube server which will then send back an index.html file, which is the YouTube website. Your browser will then show that html file on the screen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then, when you click on a video on the website, the webpage will send a request to a YouTube \u201cAPI\u201d asking it to start sending the video to your webpage.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br>An API &#8211; or <strong>Application Programming Interface<\/strong> &#8211; is like the \u201cmenu\u201d part of a server program, and is how one computer program makes specific requests to another.\u00a0 Another way of thinking about the API is that it is the \u201cdoorway\u201d into the server.<br><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">APIs are pretty simple code &#8211; YouTube.com\u2019s server looks like this:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>\/<\/strong> -&gt; \u201cI\u2019ll send them the index.html file\u201d<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>\/about<\/strong> -&gt; \u201cI\u2019ll send them the about.html file\u201d<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>\/watch?v=dQw4w9WgXcQ<\/strong> -&gt; \u201cI\u2019ll send them the video with ID <strong>dQw4w9WgXcQ<\/strong>\u201d<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><br>You see this API usage all the time right? It\u2019s the URL!<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">URLs are like a universal language, used all over, in desktop apps, across the internet, in the web, in gaming, in blockchains, to make clear requests from one program to another to find resources and ask for things.<br><br>This one\u2019s asking wikipedia.org\u2019s API to return an HTML file to us with information about a Cyclone:<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Cyclone_Batsirai\" target=\"_blank\" rel=\"noopener\">https:\/\/en.wikipedia.org\/wiki\/Cyclone_Batsirai<\/a><br><br>And this URL is asking google\u2019s search API to give us matches for our query \u201ceasy recipe ideas\u201d!<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <a href=\"https:\/\/www.google.com\/search?q=easy+recipe+ideas\" target=\"_blank\" rel=\"noopener\">https:\/\/www.google.com\/search?q=easy+recipe+ideas<\/a><br><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">APIs are made up of <strong>ROUTES,<\/strong> like the \u201c\/wiki\/\u201d and \u201c\/search\u201d above, which are like little URL-stubs leading to different places in the server with different features. This is how APIs are organised.<br>A bit more on this later.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(You can see the webpage you\u2019re on making all these API requests by typing CTRL-SHIFT-J and then clicking on the network tab. If you reload the page you\u2019ll see all the different resources for the page being requested).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">So a backend is typically communicated with through its \u201cAPI\u201d, which is like a menu made up of \u201croutes\u201d. But where does the backend practically exist? Usually in a\u201cserver\u201d..<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The web, and many apps that you use daily, follow what is called the \u201cclient-server\u201d architecture pattern.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s try to see how the words are all related. You will hear people mixing \u201cclient\/frontend\u201d and \u201cserver\/backend\u201d together as their meanings are quite similar.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/www.wbscodingschool.com\/wp-content\/uploads\/2022\/05\/6.-pic6.webp\" alt=\"\" class=\"wp-image-27163\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The frontend is a reference to the HTML app that you made, but might also be used more generally to reference your HTML, or the browser that is showing your HTML, or even your computer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br>The backend is the \u201cserver\u201d part. The word \u201cserver\u201d can be used to reference the computer program \u201cserving\u201d the html \/ data to your frontend over the internet, but the word server also refers to the physical hardware, the computer running the server program. You know, these big computer things.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/www.wbscodingschool.com\/files\/7.-AdobeStock-by-.shock_37429195-1024x683.jpeg\" alt=\"network server room with computers for digital tv ip communications and internet\" class=\"wp-image-27165\"><figcaption class=\"wp-element-caption\">Adobe Stock \/ .shock<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Software people don\u2019t think about this hardware side of things much though..<br><br>So what\u2019s the difference between \u201cbackend\u201d and \u201cserver\u201d?<br>The backend of an application could be many server programs combined, for example one server for pictures, one for HTML files, one for logging-in\/out, one for sending\/retrieving messages etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So \u201cbackend\u201d is more of an umbrella term for one\/many servers generally.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">So once again, because this is confusing stuff\u2026<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An API is the system through which your program talks to a server. APIs are how computer programs make requests to each other.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A server is a computer program that is usually running 24\/7, waiting for client applications to make requests. You communicate with servers through their APIs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The backend refers to everything behind a frontend app (like a webpage) that helps the frontend function. The backend could consist of a single server, or 25 different servers!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, in the case of youtube.com, the frontend (the webpage) is probably communicating with the <strong>authentication API<\/strong> to log you in, the <strong>search API<\/strong> to search through all the videos in the database, the <strong>video streaming API<\/strong> to start streaming the video to your browser, etc. Those APIs are all most likely running on their own special servers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Without turning this into an article about databases, <em>the database is also part of the backend<\/em>, and usually one particular server will be responsible for communicating with the database, asking it to find \/ create \/ update \/ delete documents on behalf of the client.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/www.wbscodingschool.com\/wp-content\/uploads\/2022\/05\/8.-pic8-1.webp\" alt=\"\" class=\"wp-image-27167\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Okay! That\u2019s enough confusing theory and new words. Part 1 is complete!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"629\" src=\"https:\/\/www.wbscodingschool.com\/files\/9.-AdobeStock-by-Andrey_451069748-1024x629.jpeg\" alt=\"On a light background, wooden cubes and a wooden block with the text Take a deep breath. View from above\" class=\"wp-image-27185\"><figcaption class=\"wp-element-caption\">Adobe Stock \/ Andrey<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"part2\"> <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Part 2 &#8211; Notes about Python, JavaScript and technology<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">What is the best language for backend development?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Which programming language to use? There are literally hundreds of them out there, but for the majority of newcomers the choice should not be very difficult.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I\u2019d recommend only looking at JavaScript or Python, which, trust me, will help you sidestep many other steep learning curves with other languages. These two languages are light and won\u2019t get in your way as much as others.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(A common misconception is that the language of a server matters in relation to the front end. This is not true. Your frontend can be sending messages in JavaScript to a server that is written in C#, Swift, Rust, whatever. The requests themselves are commonly written in HTTP, URLs and JSON, which most programming languages can understand.)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are a frontend web developer already, or have an interest in also learning web development, <strong>I strongly recommend just focusing on using JavaScript in the frontend and backend<\/strong>. There\u2019s no reason to split your brain in half between languages at this stage. And speaking from experience (I\u2019m regularly working in a bunch of different languages, which can be a pain) no other language beats the flexibility or practicality of using a very modern non-compiled language that lets you write both front and backend.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is NodeJS and how does it relate to backend?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To run JavaScript code outside of the browser, we use a program called \u201cNodeJS\u201d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hot Take: People put too much emphasis on NodeJS needlessly, as if it were some magical thing, but the truth is that every programming language has some tool to run its code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, to run Python code, you type \u201cpython filename.py\u201d, \u201cpython\u201d being the tool which runs python files!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For Clojure programs you type \u201clein filename.clj\u201d, \u201clein\u201d being the tool that runs Clojure files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For JavaScript you type \u201cnode filename.js\u201d, and \u201cnode\u201d will run your Javascript file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">NodeJS isn\u2019t a \u201cserver\u201d or a \u201cframework\u201d or whatever people are calling it these days, and it\u2019s unfortunate that people call it that, because it confuses everyone about JavaScript. NodeJS is just a tool to run your JavaScript files, like any other programming language has. That\u2019s the most helpful way of thinking about it in my opinion.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"part3\"> <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Part 3 &#8211; Let\u2019s make a server program<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"444\" src=\"https:\/\/www.wbscodingschool.com\/files\/10.-AdobeStock-by-Mykola-Mazuryk_339806569-1024x444.jpeg\" alt=\"abstract lines with dots over dark background. connecting or big data concept\" class=\"wp-image-27187\"><figcaption class=\"wp-element-caption\">Adobe Stock \/ Mykola Mazuryk<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">First, how to make a server program in JavaScript.<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Check if your computer already has NodeJS installed, by opening up<br>\u201cGit Bash\u201d \/ \u201cCommand Prompt\u201d on Windows or \u201cTerminal\u201d on Mac\/Linux, and type \u201cnode -v\u201d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you don\u2019t see a node version number popping up, download and install NodeJS for you computer: <a href=\"https:\/\/nodejs.org\/en\/download\/\" target=\"_blank\" rel=\"noopener\">https:\/\/nodejs.org\/en\/download\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you save this JavaScript file as \u201cindex.js\u201d\u2026<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.wbscodingschool.com\/wp-content\/uploads\/2022\/05\/code1-1.webp\" alt=\"\" class=\"wp-image-27169\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can then run it from your terminal (go to the correct folder with \u201ccd\u201d command first) with \u201cnode index.js\u201d. Cool! You can now talk to that server program from any other program on your computer, like the browser for example. Go to http:\/\/localhost:8080\/<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In your browser, it should say \u201cHello, World!\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Congrats!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Next, how to make the same server in Python.<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s try the same thing in Python. There\u2019s a good chance your computer has Python installed, but if \u201cpython -v\u201d doesn\u2019t give you a Python version number, download and install it from here: <a href=\"https:\/\/www.python.org\/downloads\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.python.org\/downloads\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The same simple server in Python, save it as index.py :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.wbscodingschool.com\/wp-content\/uploads\/2022\/05\/code2-1.webp\" alt=\"\" class=\"wp-image-27171\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can then run it from your terminal (go to the correct folder with \u201ccd\u201d command first) with \u201cpython index.py\u201d. Now, if you go to http:\/\/localhost:8081\/ you should see \u201cHello, World!\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Wow, that was quick! Now you\u2019re a JavaScript and Python backend developer! There is no further \u201chidden knowledge\u201d, no secret handshake&#8230; Just keep practising!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These servers could in theory serve files (html, png, css, etc.) or deliver data from a database, let users log in, log out, deliver a user\u2019s calendar information, anything a server does.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frameworks &#8211; for more structured APIs.<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Typically, developers try to avoid \u201creinventing the wheel\u201d. If you\u2019re making 2-3 new products a year, or a month, then you don\u2019t want to write everything from scratch. You\u2019re going to waste lots of time and probably make lots of unnecessary mistakes if you write everything from nothing each time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For people making APIs there are API frameworks! These API frameworks make it easy to create and manage lots of different API routes, handling errors, dealing with permissions etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>ExpressJS <\/strong>is easily the most popular JavaScript API framework.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your next task is to install express and make a simple API with it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Please make an API with these routes and return values:<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>\/<\/strong> -&gt; serves an index.html file<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>\/about<\/strong> -&gt; serves an about.html file<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>\/users\/1<\/strong> -&gt; sends back some JSON {\u201cid\u201d:1, \u201cusername\u201d: \u201cbob\u201d}<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Every other route -&gt; \u201c404 sorry this resource does not exist\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Google \u201chow to install expressJS\u201d, \u201cexpressJS example\u201d, \u201cexpress send JSON\u201d, \u201cexpress send HTML file\u201d, or \u201cexpress serve static\u201d to start getting to grips with what it can do.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(If you\u2019d like to do this framework step in Python, the simplest Python framework to use would be <strong>Flask<\/strong>. See how far you get!)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">I\u2019m not giving you the code for this final step with a framework intentionally.<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you haven\u2019t heard this before, the reality of programming is spending 90% of your time googling keywords, finding and fixing weird bugs, or simply trying to get a clear picture of the task or problem at hand.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s not your job to memorise and write code all day, but to become an adaptable and resourceful person that can find useful answers and good solutions to problems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Memorising everything perfectly about your preferred language \/ framework might come as a <em>side-effect<\/em> of experience, but I would never say it\u2019s the goal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So get to it! Start practising your problem solving skills, and make the router with 4 routes as described above, using expressJS (or Flask for Python). This will involve 99% googling for examples and trying to fix bugs!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This concludes the practical part of the article! Congrats.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"part4\"> <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Part 4 &#8211; Some final notes and pointers<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/www.wbscodingschool.com\/files\/11.-AdobeStock-by-auremar_51533969-1024x683.jpeg\" alt=\"Relieved man\" class=\"wp-image-27189\"><figcaption class=\"wp-element-caption\">Adobe Stock \/ auremar<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Wow this has been a long guide. To avoid writing an infinitely long article, I\u2019ll instead leave some final notes and pointers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You don\u2019t need to immediately read through this section, but if you\u2019ve got the energy, go for it!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Try googling these phrases to build your overview of technology!<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li>\u201cHTTP status codes\u201d<\/li>\n\n\n\n<li>\u201cDynamic routing express\u201d<\/li>\n\n\n\n<li>\u201cWhat are express sessions\u201d<\/li>\n\n\n\n<li>\u201cMicroservice architecture vs Monolith\u201d<\/li>\n\n\n\n<li>\u201cHow to use mongoDB with express\u201d<\/li>\n\n\n\n<li>\u201cWhat is Postman\u201d<\/li>\n\n\n\n<li>\u201cWhat is netlify\u201d<\/li>\n\n\n\n<li>\u201cWhat is AWS S3\u201d<br><br><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Make a real app!<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019ve got the basic tools and knowledge to make a server, so keep going! As backend overlaps with other fields of programming, your choice on what to create is quite wide.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019re looking for ideas on what kind of backends you can build, here is a<a href=\"https:\/\/learn.vonage.com\/blog\/2021\/03\/15\/the-ultimate-list-of-fun-apis-for-your-next-coding-project\/\" target=\"_blank\" rel=\"noopener\"> list of useful examples<\/a> by Cory Althoff.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pursue your own interests, think of the sort of projects that attracted you to backend in the first place, and don\u2019t be afraid to experiment. If you\u2019re feeling short of ideas, we recently published<a href=\"https:\/\/www.wbscodingschool.com\/how-to-find-website-ideas\/\"> an article on where to go look for them<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Putting your server program on the internet<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019ll eventually want to put your server on the internet for other people and programs to communicate with (we call this \u201cdeploying\u201d). I would recommend Heroku to start. Heroku is a \u201chosting\u201d service for running applications on the internet. You can upload your server code and it can run there for free (We call this \u201chosting\u201d. Heroku will \u201chost\u201d your program).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A \u201cbackend\u201d app VS a regular app<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Just because a program is not frontend doesn\u2019t make it a server or backend.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u201cBackend\u201d implies a relationship with a frontend that will consume data and talk to the backend. \u201cServer\u201d implies that you are delivering data to some other program.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You <em>can<\/em> just write programs that run, do calculations, transfer files around a computer, clean up the harddrive, that don\u2019t have a frontend counterpart at all. Keep that in mind.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Not all APIs are URL-based<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are other types of APIs. For example, localStorage in the browser is an API built right into the browser that you can talk to with your javascript code. You don\u2019t use a URL to talk to it, but it is still a service that you communicate with in a specific way. localStorage.setItem(\u201cusername\u201d, \u201cbob\u201d) is asking the localStorage service of the browser to store some information. We would call this also an API.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Web developers, don\u2019t forget about CORS!<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">It is common in modern web development to host your website(s) and server(s) separately, instead of serving the HTML files from the same server that handles data requests and database interactions. After all, the server might be serving data to a bunch of different apps. The server doesn\u2019t necessarily have anything to do with your website specifically.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For browsers, servers normally enforce a security policy called <strong>Same Origin<\/strong> <strong>Policy<\/strong>. This means if you are trying to talk to a server\u2019s API at http:\/\/localhost:8080 from your webpage which is on http:\/\/localhost:3000, then the server will probably reject any message that you send to it.<br><br>This <strong>Same Origin Policy<\/strong> is to protect consumers and companies against scammers, who could otherwise copy a bank\u2019s HTML website files, put it on the internet on a different server, and then trick people into logging in to the bank\u2019s real server from the fake website!<br><br><strong>SOP<\/strong> means that the https:\/\/my-bank.com\/login API route can only be spoken to from a HTML page that was also served from that same \u201corigin\u201d, from https:\/\/my-bank.com\/<strong> .<\/strong>This is a very good default behaviour I would say.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In order to let your website communicate, if it\u2019s on a different server (aka origin) to your actual \u201cbackend server\u201d, you need to enable <strong>CORS <\/strong>(<strong>Cross-Origin Resource Sharing<\/strong>) on your server so the website can talk to the backend API.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To solve this issue in Express, just add 2 lines!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.wbscodingschool.com\/wp-content\/uploads\/2022\/05\/code3-1.webp\" alt=\"\" class=\"wp-image-27173\"><\/figure>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">***<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This ends our dive into \u201cbackend\u201d. I really hope it helped paint a picture in your mind, on where all the pieces go and what some of the different terms mean.<br><br>Have fun coding! Now read the article again!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Christopher Shelley is a <a href=\"https:\/\/www.wbscodingschool.com\/instructors\">Senior Instructor<\/a> for the <a href=\"https:\/\/www.wbscodingschool.com\/web-app-development-bootcamp\/\">Web &amp; App Development bootcamp<\/a>.<\/em> <em>If you enjoyed his article on backend development, check out <a href=\"https:\/\/www.wbscodingschool.com\/blog\/how-to-start-learning-data-science\/\">our introduction to Data Science too<\/a>, or take a look at <a href=\"https:\/\/www.wbscodingschool.com\/courses\/\">our list of bootcamps<\/a>!<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>An accessible, practical guide to start learning backend programming.<\/p>\n","protected":false},"author":4,"featured_media":46371,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[42,101],"tags":[],"class_list":["post-27191","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-coding","category-software-development"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.wbscodingschool.com\/de\/wp-json\/wp\/v2\/posts\/27191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wbscodingschool.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wbscodingschool.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wbscodingschool.com\/de\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wbscodingschool.com\/de\/wp-json\/wp\/v2\/comments?post=27191"}],"version-history":[{"count":1,"href":"https:\/\/www.wbscodingschool.com\/de\/wp-json\/wp\/v2\/posts\/27191\/revisions"}],"predecessor-version":[{"id":60810,"href":"https:\/\/www.wbscodingschool.com\/de\/wp-json\/wp\/v2\/posts\/27191\/revisions\/60810"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wbscodingschool.com\/de\/wp-json\/wp\/v2\/media\/46371"}],"wp:attachment":[{"href":"https:\/\/www.wbscodingschool.com\/de\/wp-json\/wp\/v2\/media?parent=27191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wbscodingschool.com\/de\/wp-json\/wp\/v2\/categories?post=27191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wbscodingschool.com\/de\/wp-json\/wp\/v2\/tags?post=27191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}