Build a Weather App in VueJS | Vue Beginner Tutorial

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • Learn how to make a Weather app in Vue JS, we use the Open Weather Map API to make calls to a restful api to return the current weather data. This uses the Modern Javascript Fetch API along with Vue JS Methods and conditionals.
    A Javascript Project
    Day 12 #31Days31Videos
    // JOIN THE DISCORD
    / discord
    // MY GEAR FOR CODING AND CZcams
    Blue Yeti Microphone: amzn.to/3jr3l7T
    Microphone Stand: amzn.to/35B9LMN
    Chair: amzn.to/3dWds3F
    Thunderbolt Dock: amzn.to/3osBF6u
    Monitor: amzn.to/37I8KoR
    All of these products I own and have tested!
    Source Code: github.com/Tyl...
    FOLLOW ME ON TWITTER!!!
    / tyler_potts_
    LIKE, SUBSCRIBE & SHARE
    Music
    DEAF KEV - Invincible (NCS Release)
    Neffex - Grateful (NCS Release)

Komentáře • 268

  • @edita_gaming
    @edita_gaming Před 3 lety +26

    Wonderful tutorial! Please keep it up, the world needs more of this ❤

  • @aesap_
    @aesap_ Před 2 lety +21

    This was my first vue tutorial and this guy explained everything great

  • @dudzpedra
    @dudzpedra Před 3 lety +11

    just completed my second project of the day thanks to you! such a great feeling of accomplishment!

    • @raphaelaglogg9053
      @raphaelaglogg9053 Před rokem

      Hi there! I have an assignment in school where I need to submit a Vue application. It sounds like you have mastered this task. It's a bit embarrassing for me to ask, but would it be possible for me to have a zip folder of your work?

  • @jeury3012
    @jeury3012 Před 3 lety +4

    Great video!
    for the dateBuilder() method consider using moment.js... you could do something like:
    dateBuilder() {
    return moment().format('dddd D MMMM YYYY');
    }
    cheers
    edit:
    install moment by doing `npm install moment --save`
    then import it in your App.vue file `import moment from 'moment';`

  • @ShadowDragon81621
    @ShadowDragon81621 Před 3 lety +1

    I'm doing this in my website development class and oh my lord I did not understand how to use Vue very well but I really want to say thank you because you made that so much easier then what I was thinking it was going to be. I actually have some understanding of it now and used a lot of what you did in my project and it works and looks so much better. Thank you so much!!

  • @baldbankrupt
    @baldbankrupt Před 4 lety +7

    Hey, great video!!
    Instead of fetching the results and push it with another function to the weather object I'd use an async function for both of it:
    async fetchWeather(e){
    if (e.key == "Enter") {
    let response = await fetch(`${this.url_base}weather?q=${this.query}&units=metric&APPID=${this.api_key}`);
    let json = await response.json();
    this.weather = await json;
    }

    • @TylerPotts
      @TylerPotts  Před 4 lety

      Thanks

    • @alekkendoge
      @alekkendoge Před 2 lety

      .then() call automatically awaits for the prev async function to finis

    • @murtazanoori6414
      @murtazanoori6414 Před 2 lety

      is it possible to change the video background instead of image ? i mean accouding to the weather condation ? if yes can you help me please ?

  • @petipois28
    @petipois28 Před 3 lety

    Used this as a base for my 4th app in my quest to create 30 ionic vue apps in 30 days. I added moment js for the date and used unsplash for my images. Nice Tutorial. Thank you for your good work.

  • @readerrabbit6690
    @readerrabbit6690 Před 4 lety +4

    Please note that removing the &units=metric entirely will return the temperature as Kelvin. To get Fahrenheit use &units=imperial

  • @asishraz6173
    @asishraz6173 Před 3 lety +2

    You made it simple, though not for beginners. I genuinely loved it and will re-visit again for more clarification.
    Thank you so much for making this sharable amongst us.

  • @barnabyhillis974
    @barnabyhillis974 Před 3 lety +1

    Great video, easy to follow style, if people don’t want to see the CSS they can skip through!

  • @larry9556
    @larry9556 Před rokem

    Was not expecting Northampton to get a shoutout in this vid, went from a 9/10 to a 10

  • @zaqueuorlando801
    @zaqueuorlando801 Před 2 lety +1

    This was a great one and supper easy to follow

  • @szebasztianlukity8705
    @szebasztianlukity8705 Před rokem +3

    Hey Tyler. Great project, loved it. I just wanted to point out that you should think about increasing the font size. Keep up the good work!

  • @00el04
    @00el04 Před 3 lety +3

    Just found out your channel, subbed! I hope you can do more of these Vue.js videos in the future Tyler!

  • @DeLvoy1988
    @DeLvoy1988 Před 3 lety +1

    You can first set 'weather' as null, so to display a div you need only v-if="weather", weather will be as a true after fetchWeather method

  • @Gthefray
    @Gthefray Před 4 lety +2

    Thank you! This was really fun to make. I've only just discovered vueJS this week and was eager to find another project to try out. I'll try to include a search icon into the search bar and tinker with the weather box. And whatever else comes to mind.

  • @gboladepopoola4464
    @gboladepopoola4464 Před 4 lety +3

    Thank you! Helped my understanding of Vue. I would also appreciate if you make a video where props are passed between components in Vue

  • @yafigamtina
    @yafigamtina Před rokem

    This guy's tutorials are so clear

  • @carlosmartinezsanchez2144

    what a CSS master

  • @scientist.entity6609
    @scientist.entity6609 Před 4 lety +8

    Thank you so much for doing this lesson also with vuejs

  • @caucasusdweller
    @caucasusdweller Před 2 lety +1

    You are amazing bro, same website different technologies so we understand it better

  • @RodneyKimbangu
    @RodneyKimbangu Před 3 lety +1

    Legendary, my friend! I was looking for reasons not to use Vue js, but you gave me reasons to. Thank you!

  • @anurag3487
    @anurag3487 Před 3 lety +1

    you're very fast and quick in CSS, subbed :)

  • @michelefernandez5893
    @michelefernandez5893 Před 4 lety

    This was my first time playing with Vue. It was fun to have something up and running in less than an hour. Thank you for that!

  • @timetolive4869
    @timetolive4869 Před 3 lety +2

    Man this is just awesome :) you got a new sub to the channel! and honestly I was blown away from the quick styling of the web app!

  • @a_rod1678
    @a_rod1678 Před 3 lety +5

    Where do you get the url_base of openweather?

  • @wagnerfix
    @wagnerfix Před 4 lety +7

    Thank you so much, great example. This help me for to learn vue more.

  • @sanghoonkim339
    @sanghoonkim339 Před 2 lety +1

    I'm Vue beginner and Thank you for your awesome video!! I'm in discord channel also. I like your speed of video. Have a nice day.

  • @mariocalcetin7602
    @mariocalcetin7602 Před 3 lety +1

    Thank you very much Tyler, it's amazing how fast you build. greetings from Chile .

  • @readerrabbit6690
    @readerrabbit6690 Před 4 lety +1

    I suggest you should show how to access the returned json so we can better understand the elements available to be called. I know that's something perhaps considered rudimentary but it really only should take a few seconds to explain.

  • @ahmadfirdaus9423
    @ahmadfirdaus9423 Před 3 lety +1

    the real frond end, good job

  • @alloo12dal
    @alloo12dal Před 4 lety +1

    Great Tutorial! This really helps understand the inner workings of vue with the fetch API

  • @ndrewhas
    @ndrewhas Před 3 lety +2

    Excellent work, thank you! I'm seriously hooked on your channel! I just wanted to add that if we move the checks from the template to the computed properties, then the template looks cleaner

  • @00el04
    @00el04 Před 3 lety +4

    where did you get weather.main? is that on the API response?

  • @k303k
    @k303k Před rokem

    Thanks a lot! Becuase of you i've done created this beautiful weather app.

  • @wixl4700
    @wixl4700 Před 4 lety +2

    nice little method to display the time of each place the user searches.
    curTime (){
    var tdiff = this.weather.timezone;
    var vMili = tdiff * 1000;
    var x = new Date().getTime();
    var z = x + vMili;
    var y = new Date(z).toISOString().slice(11, -8);
    return y;
    }
    just put {{ curTime() }} where you want to display it

  • @benjaminko7812
    @benjaminko7812 Před 4 lety +1

    Thanks for sharing! Please keep doing this tutorial

  • @elicoptericus
    @elicoptericus Před 4 lety +16

    I think you could have skipped the if key == enter by using the @keypress.enter shorthand.
    Edit: Also the entire fetchWeather method could be made a lot less verbose by using async/await.
    const res = await fetch();
    this.weather = await res.json();
    I know it's a beginners tutorial but it would be a nice example of using it for beginners too.

    • @TylerPotts
      @TylerPotts  Před 4 lety +4

      Very true next time I will keep both in mind! I know Asynchronous throughs people off!

    • @incredibleindians4872
      @incredibleindians4872 Před 4 lety

      @@TylerPotts i used keypress.enter :P

  • @anlkavuk9437
    @anlkavuk9437 Před 2 lety +1

    Thanks for your nice Vue.js tutorial. 🙏

  • @ahmedouyahya
    @ahmedouyahya Před 2 lety +1

    Thanks a lot. You just earned another subscriber

  • @rogerpantil9483
    @rogerpantil9483 Před 4 lety

    nice tutorial, had to put it at 0.5 - 0.75 speed to follow up xD

  • @michaeldrexler9822
    @michaeldrexler9822 Před 3 lety +2

    This was one of the best Programming-Tutorials ever. I wish more would be like that one!
    For that great Video i left a subscription to your channel :)

  • @Hijra.ma_
    @Hijra.ma_ Před 3 lety +1

    Thank you so much

  • @jjkelsey1180
    @jjkelsey1180 Před 4 lety +1

    Thank you so much, Tyler. This is a really great tutorial :D

  • @AfolabiJude
    @AfolabiJude Před 4 lety +1

    Nigeria to the world!

  • @hackathon-bestmostar273

    Nice, you really helped me to understand vue.js more clear.

  • @monarchgam3r
    @monarchgam3r Před 3 lety +1

    Love from Nigeria 👍🏾

  • @joylearn2868
    @joylearn2868 Před 3 lety

    Amazing typing skill and sweet language ❤

  • @MissBoom135
    @MissBoom135 Před rokem

    Really enjoyed this tutorial, thank you 😄

  • @amjadal-hallak3145
    @amjadal-hallak3145 Před 3 lety

    thank you Mr.

  • @vladharanich
    @vladharanich Před 4 lety +3

    thank you, it's really good idea for an app. Already subscribed and pushed the like button :)

  • @canerdemircigm
    @canerdemircigm Před 4 lety

    for starting to the vue this is great tutorial. Thanks.

  • @ELGANDUZ
    @ELGANDUZ Před 4 lety +3

    Hello,
    I followed the video (only used different API) and the weather object is always undefined, by doing some testing seems like the method .setResults doesn't get executed.
    Anyone can help me?

  • @swapnilbhojane6922
    @swapnilbhojane6922 Před 4 lety +1

    Really nice app you made...

  • @sampower7887
    @sampower7887 Před 3 lety +1

    Cheers for the refresher :D

  • @nicolasbava3467
    @nicolasbava3467 Před 2 lety +1

    Thank you very much!! very clear and very interesting. have a nice day!! :))

  • @elitedesignhub415
    @elitedesignhub415 Před 3 lety +1

    This tutorial is wonderful 💯🔥🔥🔥❤️

  • @ministersport
    @ministersport Před 3 lety +1

    Thank you bro, so useful video!

  • @faizboy101
    @faizboy101 Před 2 lety

    thank you Tyler. very informative.

  • @dusvirymarin9025
    @dusvirymarin9025 Před 3 lety +1

    wonderful!!!!1 thanks

  • @ranzorethor5295
    @ranzorethor5295 Před 4 lety +2

    Great tutorial! Random question, where did you get that desktop wallpaper? I wanted something just like it but couldn't find one anywhere.

  • @caiojns
    @caiojns Před 4 lety +1

    Brilliant tutorial mate. Really good indeed!

  • @handsomecat7225
    @handsomecat7225 Před 3 lety

    Great tutorial. Thanks Tyler.

  • @rainzeewang
    @rainzeewang Před 4 lety

    Super useful I hope you can come up with more basic tutorials

  • @leonardpalma6483
    @leonardpalma6483 Před 4 lety +2

    Is it safe to put your api key in a data object/method in a Vue application?

  • @mohamedannajar3140
    @mohamedannajar3140 Před 3 lety +1

    Bro I love your tutorials thank you ^^

  • @al_peterson
    @al_peterson Před 3 lety +1

    thanks for the tutorial! great stuff!

  • @atila5974
    @atila5974 Před 3 lety +1

    Can you make a video explaining how to change the background according to the description of the weather? Instead of a ternary with two options, maybe a method calling for many different pictures? Thanks in advance

    • @illestoth9298
      @illestoth9298 Před 2 lety

      You can make a ternary with 3-4 options too

  • @benzemafan67
    @benzemafan67 Před 4 lety

    Really awesome and satisfying to code, thank you !

  • @mostmojo
    @mostmojo Před 4 lety +1

    bangin' m8, thanks for that. Learned a lot :) Wish we could build a game in Vue!

    • @TylerPotts
      @TylerPotts  Před 4 lety

      I have a video on building a game in Vue 😂 can't remember which one it is but it's recent

  • @ram-bk4mu
    @ram-bk4mu Před 3 lety +1

    mad skills man!

  • @dfordemo981
    @dfordemo981 Před 3 lety +1

    its beautiful

  • @rafaeldias7292
    @rafaeldias7292 Před 3 lety +1

    thanks bro

  • @vuejsdev
    @vuejsdev Před 4 lety

    I really appreciate your work, thank you.

  • @parthbhodia
    @parthbhodia Před rokem

    Can you make one video on how to convert this to a PWA ? Amazing video there tho 😮

  • @natarajana.v4262
    @natarajana.v4262 Před 3 lety

    Thankyou So much for this sir.

  • @ayxan3950
    @ayxan3950 Před rokem

    Təşəkkürlər

  • @charljones7266
    @charljones7266 Před 4 lety

    Really helped understand Vue, thanks

  • @Pages_Perfected
    @Pages_Perfected Před rokem

    Nice video and very nice accent !

  • @trojan606
    @trojan606 Před 2 lety

    thank you

  • @750Kviews
    @750Kviews Před 4 lety +1

    Slick Design man

  • @taylorfreeman7782
    @taylorfreeman7782 Před 4 lety

    Great stuff! Thanks Tyler.

  • @quangtampham6003
    @quangtampham6003 Před 3 lety +1

    Sorry,
    May I ask what font color you are using ( One Dark Pro ) ?? Thanks

  • @gauravrajghimire6396
    @gauravrajghimire6396 Před 3 lety

    since the situation with moment js, a better alternative is luxon js, did my date in 3 lines

  • @awreckingball
    @awreckingball Před 4 lety

    Few looks cool.

  • @HansNiemann762
    @HansNiemann762 Před 4 lety +85

    Disclaimer : Half the Video is just CSS

    • @nishantgupta1854
      @nishantgupta1854 Před 4 lety +10

      buy worth it bruh]

    • @TylerPotts
      @TylerPotts  Před 3 lety +6

      @@nishantgupta1854 Thank you! I never know if I should keep the css in or just do the CSS before the tutorial :/

    • @nishantgupta1854
      @nishantgupta1854 Před 3 lety +3

      @@TylerPotts Your videos really good. Thank you so much tyler .Please upload more in vue js

    • @ashleyspianoprogress1341
      @ashleyspianoprogress1341 Před 3 lety +9

      @@TylerPotts I recommend keeping the CSS explanation, but also saying something like "If you're not interested in the CSS you can copy it from GitHub and skip to XX:XX"

    • @aleb687
      @aleb687 Před 3 lety

      @@TylerPotts paste the chunk and quickly go through it explaining the main points. CSS is really tedious for non beginners

  • @dfordemo981
    @dfordemo981 Před 3 lety +1

    how can do autocomplete all the cities in the search bar, how can we do that? 😊😊😊

  • @TheRikyregna
    @TheRikyregna Před 3 lety +1

    Hi, nice tutorial, but I have a question:
    at minute 20:00 you define setResults method with (results) parameter... but three line up of that you call the same method this.setResults without passing any parameters... how it can works.. i'm newby sorry, sorry for my question

  • @brylleclarido
    @brylleclarido Před 4 lety +2

    I used the url_base you used. But it doesn't work for me. Where did you get the part for url_base?

    • @gthotaku339
      @gthotaku339 Před 4 lety

      yes please

    • @tomasvaitkevicius4191
      @tomasvaitkevicius4191 Před 4 lety +1

      make sure your url is correct, url_base has to end with the slash, check the console to see request url

  • @Lamberson_
    @Lamberson_ Před 2 lety

    thank u so much

  • @AustroPower
    @AustroPower Před 4 lety

    Hello Tyler, i want to thank you for these great tutorials! :) Keep up the good job with Vue.js/JS! Got a sub from me :)

  • @CharithJayasanka
    @CharithJayasanka Před 3 lety

    Great and simple tutorial (y) Keep it up

  • @hosseinghahremani1182
    @hosseinghahremani1182 Před 4 lety

    Thanks Thanks Thanks
    for the awesome tutorial.

  • @cubedev4838
    @cubedev4838 Před 4 lety

    Amazing, i found your channel today!!!

  • @blackpelican5205
    @blackpelican5205 Před 4 lety +1

    Nice video and all, but jesus, that intro music belongs to 2014 lol

  • @tuRistst
    @tuRistst Před 4 lety +2

    Awesome design! I want to develope same app!

  • @akashaj4660
    @akashaj4660 Před 4 lety

    Thank you! Awesome Tuts

  • @dimitrisandroid6483
    @dimitrisandroid6483 Před 4 lety +1

    Thank you a lot!
    I have 15.6 inches monitor and the letters of the code seem small and not easy to read. Is it possible to enlarge the fonts or anything other to fix it?
    If not, ok I can zoom my browser.

  • @captainezchord
    @captainezchord Před 4 lety +2

    Awesome work! Do you think you could make one that elaborates on the function that fetches and sets the API data?

  • @SpencerDavis2000
    @SpencerDavis2000 Před 2 lety +1

    great tutorial thank you :-)