How to deploy a MERN Stack App to Heroku

Поділитися
Вставка
  • Опубліковано 17 лис 2019
  • Building a MERN stack app is thing, deploying it can be a nightmare. In this video, we're going to show you exactly step by step on how to deploy a MERN Stack App to Heroku
    🔔 Don't forget to subscribe 🔔
    ua-cam.com/users/EsterlingAc...
    Interested in supporting this channel? Please use this link bit.ly/2Lfuf46
    📚Resources 📚:
    Playlist: • Build a MERN stack app...
    Github Repo: github.com/accimeesterlin/mer...
    Other Related Videos :
    ✅ Set up the Reactjs and Nodejs structure: • Set up the Reactjs and...
    ✅ Run Reactjs and Nodejs in same terminal - Concurrently: • Run ReactJS and Nodejs...
    ✅ Connect to MongoDB Atlas cluster with Mongoose: • Connect to MongoDB Atl...
    ✅ Robot 3t demo, models and routes refactor (code move in separate files): • Robot 3T demo, models ...
    ✅ Create & submit a form in Reactjs and resolved cors policy: • Create & submit a form...
    ✅ Save data to MongoDB with Mongoose: • Save data to MongoDB w...
    ✅ Get/fetch data from MongoDB and display them in Reactjs application: • Get/fetch data from Mo...
    ✅ Apply css styles to a Reactjs application: • Apply css styles to a ...
    ✅ How to deploya MERN stack App to Heroku: • How to deploy a MERN S...
    ✅ Connect MongoDB Atlas to your Heroku application: • Connect MongoDB Atlas ...
    ✅ Enable automatic deployment to Heroku: • Enable automatic deplo...
    🤗Let's connect 🤗:
    👉 LinkedIn: / esterling-accime-324a4181
    👉Twitter: / accimeesterlin
    👉Facebook: / accimeesterlin1
    👉Instagram: / accimeesterlin
  • Наука та технологія

КОМЕНТАРІ • 240

  • @hirahasan6837
    @hirahasan6837 3 роки тому +10

    Couldn't find either the add-on service or the add-on plan of
    ▸ "mongolab:sandbox".

  • @mircast0
    @mircast0 3 роки тому +34

    Guys, don't forget. The terminology of "master" changed last year for git and other big tech companies. It means, 'master' is changed to 'main', so you have to type "git push heroku main" as I experienced, Heroku isn't giving a note for that.

    • @antoniofuller2331
      @antoniofuller2331 2 роки тому

      I noticed that just this morning wow

    • @Array_of_objects
      @Array_of_objects 2 роки тому

      I get this error when doing git heroku push main.......error: src refspec main does not match any
      error: failed to push some refs to

    • @nobody-my5yv
      @nobody-my5yv 2 роки тому

      @@Array_of_objects same .. did you figure this out?

    • @srikarthickk6807
      @srikarthickk6807 Рік тому

      Just rename the main branch in your git to master

  • @alexandermayorga2918
    @alexandermayorga2918 4 роки тому +7

    This tut was a life saver. Ive been learning Node and React but I was having trouble figuring out how to put the two together. Was able to push a test to heroku today and it works!

  • @HeatherLeigh44
    @HeatherLeigh44 2 роки тому +1

    I absolutely love how clearly you explain everything step-by-step. This was so helpful. Thank you!

  • @boba6225
    @boba6225 3 роки тому +2

    This is the most comprehensive video tutorial on this topic I've come across so far.
    Hope this will work for me. Thank you, Esterling! Subscribed!

  • @dougiehawes916
    @dougiehawes916 3 роки тому +2

    This video is a game-changer in my career. Deployment is one of the biggest dragons I need to slay.

  • @mayanksikarwal5921
    @mayanksikarwal5921 4 роки тому

    i spent one full day on a wrong tutorial. your 15 minute video did the job. Thanks a lot brother.

  • @oimiyazaki1
    @oimiyazaki1 3 роки тому

    I struggled to do this until I followed your videos. It worked perfectly!

  • @gabrielejenobo5327
    @gabrielejenobo5327 2 роки тому +2

    Thank you so much, following you tutorial was of great help in solving a build bug while deploying to heroku.

  • @ducktelepathy8352
    @ducktelepathy8352 4 роки тому +6

    Thank you so much for such a clear, in-depth tutorial for a MERN stack app! I'm currently in a React course for a CS degree, and I was completely lost and in over my head until I found these tutorials. I finally feel like I understand, and after following these videos, my app works great!!

    • @Array_of_objects
      @Array_of_objects 2 роки тому

      Hope your react journey is going well, Its a great language, useMemo is lifesaver

    • @accimeesterlin
      @accimeesterlin  2 роки тому

      Thanks for sharing Duck. Glad I was able to help

  • @ahmedboutaraa8771
    @ahmedboutaraa8771 4 роки тому +11

    and by the way, you have a great content and the intro is crazy bro i like it. keep going

  • @appleforth
    @appleforth 4 роки тому +1

    Thank you Esterling! Super helpful and clear

  • @omarghamgui6664
    @omarghamgui6664 3 роки тому +4

    Couldn't find either the add-on service or the add-on plan of
    ! "mongolab:sandbox".
    Any Solution plz ????

  • @ezevalentine7610
    @ezevalentine7610 3 роки тому +1

    This is one of the greatest help i ever got in my life

  • @taheraalam5156
    @taheraalam5156 Рік тому

    Thank you! This is the best tutorial on this subject!!

  • @kennzau4854
    @kennzau4854 3 роки тому +1

    Thank you! Great explanation, finally it works!

  • @riexrickgaming
    @riexrickgaming 4 роки тому +1

    hi Ester, great video series! i follow it through the end...!
    please continue to build register and login system! :D

  • @klpx7691
    @klpx7691 2 роки тому

    I've implemented the concepts to my project and it worked...

  • @carlosbenavides670
    @carlosbenavides670 3 роки тому +1

    Simple and to the point.
    Thanks Sr.

  • @adithyakamath8225
    @adithyakamath8225 4 роки тому +1

    Thank you sir. Worked perfectly!

  • @Ensomniac.brrrdy
    @Ensomniac.brrrdy 3 роки тому +1

    Thank you so much! I just deployed my first mern app.

  • @zeinakittaneh
    @zeinakittaneh Рік тому

    Great explanation! Thank you!

  • @byVezro
    @byVezro 3 роки тому +1

    If anyone is having issues with a 404 error when running 'heroku local'...
    Make sure the following code snippet is ABOVE your routes in server.js-
    if (process.env.NODE_ENV === 'production') {
    app.use(express.static('client/build'));
    }
    //// PUT ROUTES HERE ////
    app.use('/api', routes);
    Hope this helped someone, thanks for the great video!

  • @shahzaibarshad9945
    @shahzaibarshad9945 3 роки тому +1

    impressive teaching style. Really nice. I like it.

  • @number1neek
    @number1neek 3 роки тому +4

    Yes! Yes! Yes! Finally got it working thanks to you. Esterling, you da man! 🙌
    Another thing that had me tearing my hair out for a while was that I had a default "homepage" property in my root package.json. You don't need that but if you do want to include it, make sure you set the value to the URL of your actual heroku app. Hope that helps someone out there :)

  • @vijaykumarmanvi2576
    @vijaykumarmanvi2576 3 роки тому

    Thank you so much for clear explanation using Heroku platform.. It helped and saved a lot of time

  • @Praxis_by_tanay_pingalkar
    @Praxis_by_tanay_pingalkar 3 роки тому +1

    Thank you so much. I tried so much hard to host mern app by hosting frontend on netlify and backend on Heroku. But unfortunately, I was blocked by cors. I tried StackOverflow but it was not also working. But I got you like a god and you saved my life. Thank you soooo ssooooo much.

  • @RegalRegex
    @RegalRegex 2 роки тому

    This was very helpful and concise, thank you! Rad intro btw love its energy

  • @alexandrv41
    @alexandrv41 2 роки тому

    Thank you! It is very good content! Keep going!!!

  • @cherriepie
    @cherriepie 3 роки тому +1

    Great tutorial bro! Nice voice--Good mic quality 🤣

  • @iba001
    @iba001 2 роки тому

    really well explained, thanks!

  • @jackendycherenfant3929
    @jackendycherenfant3929 3 роки тому

    Thank you, new subscriber this is awesome!

  • @kingstondavid8956
    @kingstondavid8956 4 роки тому

    thankss a lot man i was wasting more days now finally this vedio was sooo helpful

  • @cherulast7998
    @cherulast7998 3 роки тому

    Whats up folks 😁😁 the way u explained this was awsom

  • @gimnathperera3008
    @gimnathperera3008 2 роки тому

    Very helpful!

  • @thecraftycoder
    @thecraftycoder 4 роки тому

    thank you for this video!

  • @aaroncurtisyoga2
    @aaroncurtisyoga2 3 роки тому

    Awesome, thank you!

  • @sebmonti5904
    @sebmonti5904 2 роки тому +1

    That’s really well explained. Thanks! Would you have a tuto explaining the same but with typescript on top of it? I am so confused about where to put tsc - w and whether I need one or multiple typescript confit file for front and backend .

  • @slimyelow
    @slimyelow 3 роки тому

    wow this really helped me a lot!!!

  • @AdamElMou
    @AdamElMou 2 роки тому +1

    BEST TUTORIAL ON DEPLOYMENT thank u

  • @loic4059
    @loic4059 3 роки тому

    Super usefull, thanks!

  • @imranbappy
    @imranbappy 3 роки тому

    Thank you so much for video

  • @gagansharma7831
    @gagansharma7831 3 роки тому

    thank u very much dude.... it helps me alot...

  • @paolo-1283
    @paolo-1283 4 роки тому +2

    Nice and straight to the point tutorial, how do you do this with yarn?

  • @sebastianpapanicolau7917
    @sebastianpapanicolau7917 3 роки тому

    You are the best, I couldn't find this easly. Btw i would remove the intro for this kind of tutorial. Thanks!

  • @eddiechen6389
    @eddiechen6389 3 роки тому

    !!!!THANK YOU SO MUCH

  • @vamshikrishna2277
    @vamshikrishna2277 3 роки тому

    thanks...learnt alot

  • @kripkekelos9002
    @kripkekelos9002 4 роки тому +1

    excellent!

  • @Deep_880er
    @Deep_880er 3 роки тому +1

    Question: I am also using express cors where I have hard coded that the request will come from localhost:3000 and in Reactjs I am using axios in that I have defined that the backend is running on localhost:3001 and if port is allocated dynamically how should I change that in react and express

  • @leandromtoto
    @leandromtoto 4 роки тому

    Excelente! Thanks!

  • @boswellorendain9666
    @boswellorendain9666 2 роки тому

    thank you good sir ^.^

  • @emanmohamed4827
    @emanmohamed4827 2 роки тому

    Thank you so much, really helpful .
    I have a question ,I applied all of these steps but when heroku opened I found that only the backend part is deployed but not my frontend app so what thing causes this problem ? I appreciate your help!

  • @orensampson
    @orensampson 2 роки тому

    Thanks alot :)
    what about the the api request in the front? we need to adjust them as well

  • @user-py8uj1wc9f
    @user-py8uj1wc9f 3 роки тому

    Second time here, best video. Orrrrrr my memory sucks)))

  • @okey1317
    @okey1317 3 роки тому

    Hi, how are the dependencies in client folder getting installed? I coundt see you mentioning about npm intall inside the client folder

  • @mwibutsafloribert2439
    @mwibutsafloribert2439 4 роки тому

    Hi, How Do I add that fire cursor to my vs code??

  • @tube-rp1nb
    @tube-rp1nb 2 роки тому

    thank you .fantastic

  • @pedrosanchezroca181
    @pedrosanchezroca181 4 роки тому

    watching this video on March 2020 and got a question....around minute 6:00, when you talk about the deploy process and the build scripts to run post-deploy....i think this days, when you deploy to heroku, it runs build of your application automatically, so, is all that process with the "build" + "install-client" still needed?. Thanks!

  • @itechnolab8836
    @itechnolab8836 4 роки тому +1

    Amazing sir

  • @maidul13
    @maidul13 3 роки тому

    thank you so much

  • @rickvian
    @rickvian 4 роки тому +1

    hi ester, nice video
    is the folder name "client" is the standard name, or name it for my project name?

  • @nightrideryt990
    @nightrideryt990 4 роки тому +3

    believe it or not ladies and gentlemen, this is a great tutorial

  • @omkararora
    @omkararora 4 роки тому +1

    I am getting 404 Not Found on all paths when trying to run with heroku local. What could be the reason ?

  • @saurabhdeshpande8450
    @saurabhdeshpande8450 4 роки тому

    what if my client-side only contains index.html and some javascript and not react?
    then how should I change my scripts?

  • @VincentOldMark
    @VincentOldMark 4 роки тому

    what should i set my PORT to ?? in the config folder..??

  • @RahulGupta-pj1ux
    @RahulGupta-pj1ux 4 роки тому

    hello, as per your instruction i created gitignore file in my base folder, but node modules in my client are not getting ignored.. is it meant to be that way?? should i just upload it with node modules folder?

  • @abdallahmohamed4591
    @abdallahmohamed4591 3 роки тому

    there is no words discover the greatness of this content , thank you .
    -----
    here a question please, I got "Invalid Host Header" ?

  • @PabloPellegrini
    @PabloPellegrini 4 роки тому +2

    Works!!!

  • @jamesavakian7761
    @jamesavakian7761 4 роки тому

    I downloaded the mernapp_youtube-master, cd into client dir, and ran npm run build and could not find a /build subdir in the /client area ?
    My file stack has “node server.js” in the start script that is inside package.json
    Do I need a procfile, what information needs to be in that file in the root directory?

  • @kunalbose33
    @kunalbose33 3 роки тому

    What happens if I use ejs instead of react for my front end, then how to do it

  • @remu851
    @remu851 2 роки тому

    thank you

  • @alimongi2892
    @alimongi2892 3 роки тому

    how do i fix an NGINX 404 error post deploy (is react router an issue) ?

  • @sumanpokharel1718
    @sumanpokharel1718 3 роки тому

    the flames tho lol!!

  • @PabloPellegrini
    @PabloPellegrini 4 роки тому

    I have one problem, when a deploy the APP all works fine, but when a make a request the APP still making the request from localhost, how can i fix this?

  • @malmossa
    @malmossa 3 роки тому

    what is the extension for the flam?

  • @vishnups9793
    @vishnups9793 Рік тому

    thanks macha

  • @yonnicruz6218
    @yonnicruz6218 4 роки тому +4

    Awesome content!
    Question - when I uploaded my app to heroku, my reactApp is still trying to go to my localhost routes(localhost/5000) and hence can't get the data from my mongoDB dbase. Should I reroute all my reactJS axios routes? I though static.JSON would have solved this but it didnt.
    Looking forward to your reply and thanks!

    • @accimeesterlin
      @accimeesterlin  4 роки тому

      Hey Yonni, do you have a link to your source code on GitHub that I can take a look at it?

  • @jumbo999614
    @jumbo999614 3 роки тому +1

    So you put both frontend React and backend Express Server into Heroku? You can't put the whole stack with Netlify right? Is Heroku free?

  • @vipuldev1283
    @vipuldev1283 3 роки тому +1

    hey I have followed the tut . but running the Heroku local runs my. backend server I am not seeing the react app , can someone help

  • @dishant930
    @dishant930 4 роки тому

    do I have to upload .env file to Heroku?

  • @rohanthakran4225
    @rohanthakran4225 3 роки тому +2

    Couldn't find either the add-on
    ! service or the add-on plan of
    ! "mongolab:sandbox".

  • @eldinedy6837
    @eldinedy6837 3 роки тому

    Hey. Related to heroku deployment, does heroku keeps images after is deployed or it have to be paid so we can keep images. What is price for deployment mern app?

  • @firewatermoonsun
    @firewatermoonsun 3 роки тому

    What is the port number in PORT in .env?

  • @adarshrathi4038
    @adarshrathi4038 3 роки тому

    Heroku only displaying the backend of MERN app. How can I fix this?

  • @yunusfirat8860
    @yunusfirat8860 3 роки тому

    I always see my backend json file even though I have front end app for it. What would be the reason?

  • @stephenselvaraj8960
    @stephenselvaraj8960 2 роки тому

    Super :)

  • @stefansokolowski
    @stefansokolowski 3 роки тому

    I followed every step of this tutorial but my deployed app which has the frontent says 505 service unavailable when trying to call /api. When I do heroku local then nothing appeaears. Do you have any advice? I've been through so many MERN stack tutorial series on youtube and I think I'm just never going to get it

  • @Stockanalysisshorts
    @Stockanalysisshorts 3 роки тому

    This worked For Heroku and now my backend servers the frontend, however when I try to run npm run dev locally, I am getting a:
    Could not Proxy request from localhost to localhost to localhost5000,
    Also for the (If process.Node.ENV ===production) statement, do we need to add a configuration variable in the DOTENV?
    Please help ive been stuck

  • @iamkiddilam
    @iamkiddilam 4 роки тому +1

    Thanks a lot. I have a quick doubt
    Can we use the Mongo Atlas URI we used in the first as the URI without using the addons?

    • @ColdColdColdGround
      @ColdColdColdGround 3 роки тому

      Yeah this is my question, as when I tried the Heroku Addon for MongoDB:Sandbox it asked me to verify card.

    • @iamkiddilam
      @iamkiddilam 3 роки тому +1

      You can check the next video in this playlist, he explains it there. It's easy. 😅

    • @ColdColdColdGround
      @ColdColdColdGround 3 роки тому +1

      @@iamkiddilam ye i'm all set now.
      thanks again for the great video

  • @achigbueuche1637
    @achigbueuche1637 2 роки тому +1

    Hi, I deployed my app to heroku, it's working locally when I run heroku local but when I push to heroku and open it's show application error

  • @kyahAndoy
    @kyahAndoy 2 роки тому

    Hi, I already deployed my server with frontend connected to the server. But I also have another frontend that needs the server how can I connect my another frontend?
    2 frontend 1 server

  • @einarlopez9059
    @einarlopez9059 4 роки тому +3

    Great tutorial!
    I have a question. When my app gets deploy the connection with the database does non get establish. I belive this happens because the command "node server.js" does not run. With heroku local works because as in the video the connection gets established. Is there a way to run node server.js once so that the connection stays open as it deploys?
    Thank you very much :)

    • @accimeesterlin
      @accimeesterlin  4 роки тому

      Make sure you add “node server.js” in the start script that is inside package.json

    • @einarlopez9059
      @einarlopez9059 4 роки тому

      @@accimeesterlin It is but still does not work. I belive the problem is that the script npm start never runs when I push it to heroku. The connection with the database never establishes. I have tried npm concurrently to run npm start and the rest of the scripts but it does not work, the heroku build never ends and I get an exit code 0.
      github.com/Einar-Lop/test2100original?files=1
      Here is my code.
      I would appreciate your help.
      Thank you very much :)

  • @SHREYATIWARI-lk5rc
    @SHREYATIWARI-lk5rc 3 роки тому

    sir, on runing heroku local it is only showing the backend !! can you please help me

  • @ashutoshkhajuria6741
    @ashutoshkhajuria6741 3 роки тому

    what if you don have a addons in your heroku ?

  • @j.foontb.1113
    @j.foontb.1113 4 роки тому +1

    How to deploy mern stack if i have 2 separate folders: server and client? These 2 folders are inside another folder with app_name?

  • @zorbak5090
    @zorbak5090 Рік тому +1

    They removed mLab and Object Rocker do not have a free version so now what to do?

  • @syedsibteali5761
    @syedsibteali5761 Рік тому

    Thanks for the tutorial i am running my heroku local and its connects with data base and also runs on server but i do not see my app when i visit localhost:500 and instead only see api routes for root i.e. Api is running. I am attaching my github code kindly take a look

  • @ahmedboutaraa8771
    @ahmedboutaraa8771 4 роки тому +2

    can you please tell us what is the extension for that fire effect when writing

  • @nobody-my5yv
    @nobody-my5yv 2 роки тому +1

    when i enter the addons command it says no addons for your app

  • @ratnabhkumarrai5594
    @ratnabhkumarrai5594 4 роки тому +8

    I cloned your repository and as i did heroku local it shows server starting at 5000..but when i go there i get message "cannot GET /"

    • @longsyee
      @longsyee 4 роки тому +2

      if heroku i get this problem by hands on at the end. Npm run dev work but not heroku local (test fail)

    • @aplombsunny
      @aplombsunny 4 роки тому +2

      I am getting the same issue... is there any solution for this.