Host React.js App for FREE in 5 mins with GitHub Pages

Поделиться
HTML-код
  • Опубликовано: 13 окт 2024

Комментарии • 231

  • @einnorw
    @einnorw 3 года назад +17

    Every time I redo my portfolio website it's such a pain to get it deployed again. This video was so helpful. thank you so much!!!!

  • @gabrielossamumaeda2091
    @gabrielossamumaeda2091 2 года назад +3

    Nice video man!!
    If someone is running into the problem where the site displays some React Learn page or whatever, make sure you marked "gh-pages" on the page setup of GitHub pages settings.

    • @ernestosrf
      @ernestosrf Год назад

      Thank you so much! I was looking for a solution for this

  • @DevinDT99
    @DevinDT99 4 месяца назад +1

    For those using Vite, npm run build will by default use a "dist" folder rather than a build folder, so deploy won't recognize it. You can instead add the following to your package.json scripts!
    "predeploy": "npm run build",
    "build": "vite build",
    "deploy": "gh-pages -d dist"

  • @SaroshAbdullah
    @SaroshAbdullah 3 года назад +7

    You're awesome man! you explained everything in such a simple manner!

  • @Tracer73866
    @Tracer73866 2 года назад +5

    1:58 before pushing you need to create "main" branch by typing "git branch -M main". I received an error until i wrote that command

  • @ameybairolu3688
    @ameybairolu3688 2 года назад +6

    Thanks a lot for this video lol. Crisp explanation and hence an absolute time saver. Couldnt ask for anything more! 😀

  • @RohanPaul-AI
    @RohanPaul-AI 2 года назад

    This was tremendously helpful. Wish you all the growth in RUclips.

  • @flux2956
    @flux2956 2 года назад +1

    DUDE!!! I am a beginner and this stressed me out for days!! Glad I bump into your video!! The other ones are super hard to follow but yours is AWESOME!! I LOVE YOU MAN!!!(No homo)

  • @pickitupgolf276
    @pickitupgolf276 2 года назад +1

    Very helpful vid James!
    Appreciate the simplicity and easy to follow steps.

  • @nidhishettigar6981
    @nidhishettigar6981 2 года назад +1

    Thanks that worked for me. After many tries finally I hosted my react app.

  • @brandongibson7050
    @brandongibson7050 2 года назад +2

    I thought ctrl C was to copy? why would I copy the url then go to the cmd line and hit ctrl C again?

  • @JoshLearningFrontend
    @JoshLearningFrontend Год назад

    Don't Quit Your channel, Your content are fantastic❤, please create regular content🙏

  • @dewann99
    @dewann99 Год назад

    Thank you so much, I was really hoping that I don't run into issues the night before the big career fair day at my university, so I can show them my react-app portfolio.

  • @delighteke9948
    @delighteke9948 7 месяцев назад

    wow this video saved me from constant head ache, thanks bruv

  • @27isagamer98
    @27isagamer98 Год назад +1

    Thanks a lot for this clear explanation. You saved my day!

  • @nfireOSX
    @nfireOSX 2 года назад

    Thats very cool! My question: how to deploy an app with a database and link it? Can I do it in github pages or should I just rent a server with mysql installed or something?

  • @fredrick2017
    @fredrick2017 2 года назад +12

    Hey! I followed everything in the tutorial minus creating a repo (my repo was already set up). Everything ran successfully with no errors but I'm getting a 404 error on the page. Any ideas? I'm not using routing or anything like that.

    • @teenaja3340
      @teenaja3340 2 года назад +2

      same

    • @rizkialimaulana6193
      @rizkialimaulana6193 2 года назад +6

      Yeah me too. But in my case, the website turns into readme

    • @JacobAuthier
      @JacobAuthier 2 года назад

      @@rizkialimaulana6193 Same :(

    • @chandangr9033
      @chandangr9033 2 года назад

      @@JacobAuthier Make sure ur username doesnt have any space or capital letters. If it has capital letters or space, then it will cause that issue

    • @jessehuang4955
      @jessehuang4955 2 года назад

      @@chandangr9033 so you mean even though your user name has uppercase you just type lower case?

  • @tamimdewan1847
    @tamimdewan1847 3 года назад

    This channel deserves a million subscribers

  • @sanish_49
    @sanish_49 2 года назад +1

    Thank you so much, deployed my app without any problem. That was smooth 😃

  • @Febiuzz
    @Febiuzz Год назад +1

    Doesn't work to me, when i write npm run deploy it's starts building but in the end it gives me this error: ENOENT: no such file or directory, stat 'C:\Users\fabio\Desktop\fabio-psd\build'. Idk how to fix it and when i open the web page it gives me site not found. Help

    • @nirajraut1511
      @nirajraut1511 4 месяца назад

      Hey, I am facing same issue, so how did you solve this problem

  • @ShravanKumar147
    @ShravanKumar147 2 года назад +2

    Wonderful 5 mins
    Brilliantly explained

  • @YannCedrick
    @YannCedrick 2 года назад

    Thank you for the video. You deserve more subscribers

  • @roodyg5352
    @roodyg5352 Год назад

    Thank you! This video was extremely helpful.

  • @aryanaryamusic
    @aryanaryamusic 2 года назад +2

    I'm getting this error
    Error: spawn git ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
    Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

    • @shahidlandge9876
      @shahidlandge9876 2 года назад +1

      I m getting the same error . Did you find the solution?

  • @thomasmeta2711
    @thomasmeta2711 2 года назад +1

    Hey thanks for the video but I can't see the entirity of the website that I see locally on github pages. Do you know why?

  • @JulietteReacts
    @JulietteReacts 3 года назад

    This was super helpful and I love your style of teaching (and it's always nice to hear another Northern accent) ...but I'm having an issue. My gh-pages is just displaying my README. :( I'm guessing that has to do with it not finding my homepage?

  • @yashaskirito
    @yashaskirito 2 года назад

    I might be just missing something here but it's bugging me so I'll ask anyway.. when you are CLEARLY running the deploy script.. how is npm also running the predeploy script??

  • @Lokoislive
    @Lokoislive 3 года назад +1

    I have a problem with this. I did all the steps but I only get a blank screen, and when I inspect the console it tells me for the scripts enable javascript to run app, and I've done this several times and also for the website do I need to be in branch gh-pages or in master branch to make the website?? bc when I go masters i get the instructions file if I go to gh-pages branch I get the white page with enable js, nvm it worked idk how but at least it works so another question if I make some changes to my app all I need is to just do the same as before add the changes commit to it and then push it , but do I push it to my masters branch or gh-pages branch?

    • @jamesgrimshaw
      @jamesgrimshaw  3 года назад

      When you want to push changes, all you need to do is commit all your files like you did in the first step (except add origin, you only need to do that once), and then run “npm run deploy” as you did in the video. It is the exact same process, you don’t push to the gh-pages branch directly :) Hope this helps

    • @Lokoislive
      @Lokoislive 3 года назад

      @@jamesgrimshaw ok that worked but when I modified some more now I'm getting the blank page again with saying enable js, when I first made a push it did change what I pushed but when I pushed some files and deployed it that when it went to the blank screen. here's my github if you want to see it github.com/pablovisual/pabloarmandosandoval

    • @Lokoislive
      @Lokoislive 3 года назад

      nvm i found the problem, so with the route path I set to empty my website couldn't configure where the homepage was so it didn't show anything. but when i changed the route path to the actually path itself it was able to find it

    • @jamesgrimshaw
      @jamesgrimshaw  3 года назад

      @@Lokoislive great, glad to hear you figured it out. Just visited your website and it looks great!

    • @Lokoislive
      @Lokoislive 3 года назад

      @@jamesgrimshaw thanks its still a working progress but ill get there

  • @md.dilshadulislam9113
    @md.dilshadulislam9113 Год назад

    thanks a lot to put a sense of humor around it

  • @sebastianelustondo
    @sebastianelustondo 2 года назад

    Thanks you James, you help me a lot with this github pages!!

  • @rkscp7711
    @rkscp7711 5 месяцев назад

    Your video is really helpful 🙌🙌

  • @sahinurislam7247
    @sahinurislam7247 2 года назад

    Thanks a lot sir, after watching more than 10 videos i got the right solution.

  • @RiteshNEVERUNIFORM
    @RiteshNEVERUNIFORM 3 года назад +2

    Sad to see such less subs :(
    I have a doubt though, I made a login page using firebase authentication. now i want to deploy that app on github but the problem is i don't want the apikey to be exposed what do i do

    • @jamesgrimshaw
      @jamesgrimshaw  3 года назад +1

      This is only for static frontend apps, all code will be exposed. If you need something on the server side, this is not the solution for you I'm afraid. Try something like AWS, they have a free tier so it will likely cost you nothing for the first year.

    • @RiteshNEVERUNIFORM
      @RiteshNEVERUNIFORM 3 года назад

      @@jamesgrimshaw okay, Thanks!. I think deploying on netlify is good Idea for my project. And the public fikes can be shared on github

    • @jamesgrimshaw
      @jamesgrimshaw  3 года назад

      @@RiteshNEVERUNIFORM Sounds great 😄

  • @jonathanadel3831
    @jonathanadel3831 3 года назад +1

    Thanks Bro, It Worked
    Can You Please Tell Us The Name Of Your VS Code Theme And The Folder Icons Theme Name?

  • @ts8960
    @ts8960 2 года назад

    when I run npm run deploy , will it remove files from github too if I remove them in my project? or do I have to do everything manually

  • @adamdurrant
    @adamdurrant Год назад

    This didn't work for me. How does an app in a fresh repo get added to a separate gh pages repo? I already have a gh pages repo with stuff inside it.

  • @blackchristiangeek
    @blackchristiangeek 2 года назад

    Awesome, thanks for the tips, you were answering questions that I didn't know how to ask 😅 Thanks again and God bless

  • @SarathChandran96
    @SarathChandran96 2 года назад

    Superb presentation. quick and easy . very usefull

  • @fatesteyneit2990
    @fatesteyneit2990 2 года назад

    can we use a domain bought somewhere else? If so, care to do a little tutorial XD

  • @notyourtypicalteenager4651
    @notyourtypicalteenager4651 3 года назад

    hey! when I upload my website it only shows some part of it, like for example I am deploying the whole thingbut when I click the link it only shows the navbar part and none of the links work on the navbar

  • @zenragez
    @zenragez 3 года назад +3

    That was beautifully scripted! Very thorough and quickly explained

    • @jamesgrimshaw
      @jamesgrimshaw  3 года назад +1

      Man like Zenny 😍 nothing makes me happier than seeing you here

    • @zenragez
      @zenragez 3 года назад

      @@jamesgrimshaw I will be coming to you a lot for your RUclips when I need information! Maybe I could make some requests?

    • @jamesgrimshaw
      @jamesgrimshaw  3 года назад +1

      @@zenragez of course! DM me I’m always looking for new video ideas :)

    • @Felix-dh9tl
      @Felix-dh9tl 2 года назад

      @@jamesgrimshaw How do I choose my home tab, to load it when I click the link? Now it sends me to a blank page, I can only see my navbar and footer atm, but when I click home tab etc, it works properly...

  • @nakedsnake_2128
    @nakedsnake_2128 2 года назад +1

    Didn't get it to work - probably something I did wrong. But I want to say that the video was spot on. No bullshit, just straight to the point and very clear. Subscribed!

  • @ratansen4542
    @ratansen4542 2 года назад

    Hey! my react app is inside frontend folder of my repo.. What additional steps do i need to perform?

  • @shourovfoisal
    @shourovfoisal 2 года назад +3

    Excellent tutorial. Short and to the point! 💥💥

  • @soumyadeepchatterjee2189
    @soumyadeepchatterjee2189 2 года назад

    Thank you. If everything is fine please if possible upload some other project videos. You were great at making us understand.

  • @romimaximus
    @romimaximus 2 года назад

    Well ...perfect !! ..and straight to point !! Thank you very for sharing it !! 😁👍

  • @sfafsashfdh6589
    @sfafsashfdh6589 2 года назад

    How can I do this if I used some sort of API, and in JS file there is my private API key, shouldn't API key be private?

  • @tobiastejeda4694
    @tobiastejeda4694 3 года назад

    Excellent video helped me deploy my first react app ❤

  • @minhazrabbi531
    @minhazrabbi531 2 года назад

    Thanks a lot. ❤❤ I finally deployed my frist react app.

  • @VishalPatel007
    @VishalPatel007 2 года назад

    Awesome bro!! 💥💥

  • @lgon9977
    @lgon9977 2 года назад

    Man, you are amazing! Thanks a lot :)

  • @tan5771
    @tan5771 2 года назад +1

    Very easy tutorial..aaaaaa it helps me a lot to deploy my react project. I can go to sleep now 😂

  • @Msterken1
    @Msterken1 Год назад

    Good job, thank you for clean explanation and help.

  • @ralphkapgang3687
    @ralphkapgang3687 2 года назад

    Awesome tutorial but it doesn't work for me, my main file is in a sub folder, please ca you help me?

  • @nathancwatkins
    @nathancwatkins 2 года назад

    ty for the concise guide!

  • @CompoFriend
    @CompoFriend 2 года назад

    Thanks for the excellent video it helped me & I deploy my first react app.

  • @harshkureel3829
    @harshkureel3829 Год назад +2

    It's showing blank page

  • @aviroxi
    @aviroxi 2 года назад

    thank you so much :) you got new sub and new github follower ;)

  • @kenzafilali9115
    @kenzafilali9115 2 года назад

    my application is pubished yet directly it displays my 404 pages configured by the route /* what to do ?

  • @artenisalija
    @artenisalija 2 года назад

    How many projects can we publish using this method?

  • @andriikniaziev9242
    @andriikniaziev9242 Год назад

    Thanks man, it works!

  • @TheLongAndNarrowPath
    @TheLongAndNarrowPath 2 года назад

    Excellent DUDE!

  • @mikkys5374
    @mikkys5374 Год назад

    how do you fix a "ENOENT: no such file or directory, stat" error?

  • @shaokhan-i8k
    @shaokhan-i8k Год назад

    your'e a life saver bro... thanks so much...

  • @aietal.1596
    @aietal.1596 2 года назад

    That helped a looot. Massive thanks.

  • @aris13pat1
    @aris13pat1 2 года назад

    Nice tutorial. Thank you!

  • @Felix-dh9tl
    @Felix-dh9tl 2 года назад

    If your page works but if you try to refresh it and says 404 error, change your:
    ReactDOM.render(




    ,
    document.getElementById('root')
    );
    to this one below
    ReactDOM.render(




    ,
    document.getElementById('root')
    );

  • @johnconnor9787
    @johnconnor9787 2 года назад

    Thank you. That is what exactly I needed

  • @_.Mustafa._
    @_.Mustafa._ 2 года назад

    ohh man !! Thanks a million. You saved my life.

  • @ash__borne
    @ash__borne 2 года назад

    Subscribed in less than 10 secs :)

  • @jprescottirl
    @jprescottirl 2 года назад

    I uploaded it up GH pages but now my images arent showing. Any idea why? thanks !

    • @shaneharris8363
      @shaneharris8363 2 года назад

      I use process.env.PUBLIC_URL + "/assets/image.png" and also set the variable to match the homepage used in package.json.

  • @mohitnamdev3622
    @mohitnamdev3622 2 года назад

    thanks a lot man, this was really helpful

  • @dominiclapitan8466
    @dominiclapitan8466 2 года назад

    You are insane. Thanks so much brooooo

  • @Swagmaster4000
    @Swagmaster4000 3 года назад

    When I do this, it uploads my build folder to the github repo. Is there any way for it to also push the src and public folders/files? Basically I want to still upload everything, not just the build folder.

    • @jamesgrimshaw
      @jamesgrimshaw  3 года назад

      push your entire codebase to GitHub using the normal git commands, in addition to using the deploy commands

    • @Swagmaster4000
      @Swagmaster4000 3 года назад

      @@jamesgrimshaw So on my page, I have two branches: one is the master branch with my entire codebase and one for the gh-pages. After force pushing my main codebase to github using normal commands, I then ran the deploy commands to see if anything changes, but my website instead now shows the readme page again. Am I supposed to do anything with the two branches?

    • @jamesgrimshaw
      @jamesgrimshaw  3 года назад

      @@Swagmaster4000 the master branch is where your entire code base lives, that’s where you push to, and the gh-pages branch is for the hosted website, you don’t have to manage that branch. The predeploy script will create a build folder, and the deploy script sends that to the gh-pages branch which is where the hosted website gets its data from. Hope this makes sense :)

    • @Swagmaster4000
      @Swagmaster4000 3 года назад

      @@jamesgrimshaw Makes a lot of sense. Another thing I learned is that sometimes you might need to go into github pages settings in the repo and toggle the right branch to make everything work out

  • @ANKITKUMAR-ih3yk
    @ANKITKUMAR-ih3yk 2 года назад

    I have done all thing similar like in this video but still my site is live showing 404 error?

  • @steffqing
    @steffqing 2 года назад

    I couldn't get my React website setup
    I followed through the instructions but it renders the site without the content

    • @Felix-dh9tl
      @Felix-dh9tl 2 года назад

      use hashrouter instead of router

  • @אילןלוי-ק9ד
    @אילןלוי-ק9ד 2 года назад

    תודה רבה 1000 פעם! תבורך מפי עליון!!!

  • @awesomedragon6367
    @awesomedragon6367 2 года назад

    bro. how do you host react js frontend with backend. my backend login is not working. how do you do it??

  • @shanmukh5590
    @shanmukh5590 3 года назад +1

    Only readme file is showing 😭😭😭😭😭😭😭😭.. pls help 🙏🙏🙏🙏

  • @CSEngineerInsider
    @CSEngineerInsider Год назад

    I love free content. Nice video love it

  • @indranilnaskar2373
    @indranilnaskar2373 2 года назад +1

    Awsome 🔥

  • @s7s_space
    @s7s_space 2 года назад

    I can't see the images in my project why ? after publish and what the benefit from predeploy?

    • @shaneharris8363
      @shaneharris8363 2 года назад

      Try setting the PUBLIC_URL to your GitHub page URL then use process.env.PUBLIC_URL + "/..." to reference your images.

  • @punitdixit861
    @punitdixit861 2 года назад

    its really awesome....thanks James

  • @thevipinmishra
    @thevipinmishra 3 года назад

    Very straightforward and easy to follow tutorial. 👍
    Just Subscribed.

  • @yatut4467
    @yatut4467 2 года назад

    Thanx for such useful content :)

  • @siruxsolutions
    @siruxsolutions 2 года назад

    Great content!

  • @enigma9445
    @enigma9445 2 года назад

    Thank you bro, really help me 👏

  • @InternetMadeCoder
    @InternetMadeCoder 2 года назад

    This does not work

  • @kirstengrimshaw563
    @kirstengrimshaw563 3 года назад

    This is a fantastic video!!

  • @Saad1379
    @Saad1379 2 года назад

    0:01 "World's greatest react app" 😀😀😀

  • @528nandini9
    @528nandini9 Год назад

    After npm run deploy..I'm getting error..please help me out

  • @jakubkurdziel2407
    @jakubkurdziel2407 3 года назад

    Great video, thanks!

  • @dewasembiring7286
    @dewasembiring7286 2 года назад

    is this work when the code in github are private?

  • @felixriddle
    @felixriddle 2 года назад

    Make a tutorial to get your terminal design

  • @andrewkorsten2423
    @andrewkorsten2423 2 года назад

    great video!

  • @SuboptimalEng
    @SuboptimalEng 3 года назад

    What?!
    James Grimshaw is evolving!?

    • @jamesgrimshaw
      @jamesgrimshaw  3 года назад +1

      A tutorial that is less than an hour, what?! 😂 Going to be experimenting with various formats and lengths (as an excuse to play around in my video editing software), so would love any suggestions you have!

    • @SuboptimalEng
      @SuboptimalEng 3 года назад

      ​@@jamesgrimshaw Your video is well edited and got the point across nicely! Only advice I got is to upload consistently and pray to the RUclips algorithm 🙏

  • @nunez.rv3
    @nunez.rv3 2 года назад

    Wooww you make it so simple

  • @druashley
    @druashley 3 года назад

    EZPZ thank you for this. Just deployed a soundboard on git

    • @jamesgrimshaw
      @jamesgrimshaw  3 года назад

      So happy to hear you found it useful!

  • @nani4027
    @nani4027 2 года назад

    When I tried I'm just getting the read me file displayed.