Build a Single Page Application with JavaScript (No Frameworks)

597,561
0
Published 2020-08-24
View the Code & GitHub Repository:
dcode.domenade.com/tutorials/build-a-single-page-a…

In today's video I'll be showing you how to build a Single Page App using JavaScript without the need for any front-end frameworks. We'll be implementing client-side routing ourselves from the ground up.

This is perfect for any small-to-medium sized website or app.

LINK TO PART 2 📺:
   • Adding Client Side URL Params - Build...  

🏷️ THE ULTIMATE JAVASCRIPT DOM CRASH COURSE 👇
www.udemy.com/course/the-ultimate-javascript-dom-c…

Support me on Patreon:
www.patreon.com/dcode - with enough funding I plan to develop a website of some sort with a new developer experience!

Follow me on Twitter @dcodeyt!

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

#dcode #javascript #webapp

All Comments (21)
  • @alexandre3932
    The reason why i don't use framework like React and others is because i was waiting for this kind of tutorial to understand how it works under the hood.Thank you very much
  • @ryugavegeta5734
    These JS projects which you have uploaded is art.People dont watch this stuff thinking they would be reinventing the wheel but actually we are just trying to customize the rims. If that makes sense these projects teach you everything from scratch i.e debugging,internal working which many people are unable to understand .Kudos to you mate.
  • @dcode-software
    *IMPORTANT:* Use port 3000 over 5060 As many have pointed out in the comments, it's recommended you go with a port number other than 5060 as referenced in this video.
  • I am a full stack web developer for 4 and a half years now and been doing project throughout the entire time. I can tell you from everything that I learned , this is by far one of the best and most simplefied explanation , I wish I learned Javascript this way when I just started as it would save me so much time and help me understand the main ground and the "how" and not the "why". Great video and straight to the point
  • @seth111yta1
    *here are the basic points*: # Server: Restrict responses: - return requested file for static/* requests - return index.html for everything else # Browser 1) Override default navigation behavior: - Single click handler "up high" on the body. - If the event target is "one of the navigation links": prevent default and push history. 2) Listen for history changes: - Create a lookup table that couples routes with markup. - When the route changes, find a best match in the table and dump its markup into the dom. congratulations you just saved 40 minutes of your time.
  • @TomasMisura
    This tutorial is one of the most useful for those who wants to do front-end development for his living as this is one the common question during interviews meaning how to make single page web app using javascript with no framework.
  • @GamesForDays2
    As a student working on creating an SPA for the first time, this was extremely helpful and straightforward. Allowed me to understand what I was working on while giving me a foundation of what the JavaScript was doing, helping me follow what I was making and actually understand the code! You're a lifesaver!
  • @netty7263
    in case other people have issues...I was only able to see the app running on port 3000 not 5060 (not sure why) , so just change 5060 to 3000 in server.js
  • Bravo! I just love this video. It is clean and using the tools the way they were intended to be used without loading unnecessary frameworks and modules. All real web browsers now support ES6. There is no need to use all these tools that dumb JavaScript down to the lowest common denominator. Thanks!
  • @dcode-software
    If you enjoyed remember to Like and Subscribe for more web development projects and tutorials! 🙂
  • @fabian3411
    I don’t usually leave comments, but this is exactly what I was looking for. Very easy to follow, thank you!
  • @tmibtruemakers
    That was so much value in 30 minutes for someone that understands basic js but not it's practical use. Thanks a lot
  • @gregoryam
    While I have dabbled in web development for a while now (10+ years). I've been looking for a way to create Single Page Applications for an idea that came to me and couldn't find an easy-to-follow tutorial that used only Vanilla JS. A lot of them used React or another Frontend and Backend Framework that was a bit too confusing for me to follow. I've been searching the internet for the last few days for a tutorial and just came across this video! Honestly, I can now say "I have finally found a tutorial that matches exactly what I need". Thank you, Dom. Your tutorials are awesome! P.S. I've just watched 3 of them because I genuinely enjoy your teaching style. Edit: If there isn't a tutorial already on your channel (besides your PWA tutorial). I think you should create one for creating a PWA + SPA, allowing for offline caching and installability for a Single Page Application.
  • @robwatson826
    "No frameworks"... installs npm with express. Perhaps the "server side" could have been separated a bit better so it's clear that's all you were doing. After watching the entire video, though, it was really interesting. I particularly like the data-link and global click handler, I use that frequently for all sorts of interactions with dynamic html.
  • @sirnawaz
    I really loved this small demonstration of the building blocks for single-page applications. I got some basic ideas as to how frameworks like React, Vue and Angular actually work under the hood.
  • @jogoeire
    I'd better amend my comment. It's a great tutorial. Yes the first 11.30 mins are setting up Express Framework routing to serve the HTML... but then it gets down to business and explains the client-side part really clearly -- better than other material ive read. I can see how the first 11 mins are useful for context. Watch this tutorial
  • @aelfar7533
    I watched this video back in 2020 and understood nothing, watched it now again and have had like 20 WOW-moments haha XD! AMAZING WORK!
  • @swrv_sounds
    Backend developer here trying to learn some basic front end stuff. I started with React, learned a little about redux and routers, and got so tired of writing and learning so many different things, so I just gave up and thought, lets do it the old fashioned way. Tried and tested. Thank you!
  • @morgan3692
    I work with node js since 2016. One of the best tutorial I've ever seen.