Deploy NodeJs, MongoDB on Cyclic for Free - Detailed Guide

Поділитися
Вставка
  • Опубліковано 8 січ 2025

КОМЕНТАРІ •

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

    LOVE the video! it was quick, concise, and you werent constantly going back, like "oh, i think i have an error somewhere. im gonna spend 30mins looking for it and refuse to cut ahead".

  • @abdukayumsotvoldiev3432
    @abdukayumsotvoldiev3432 Рік тому +3

    Thanks a lot Raddy. This tutorial is awesome! You showed us how to easily deploy MongoDB and expressJS on Cyclic together. Looking forward new productive videos.

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

    Thanks so much for tutorial, since Heroku no linger free, it was great to find someone who shows how to use another platform

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

    Was stuck for a while and found your tutorial. It worked. Thanks a lot!

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

      Glad it helped!

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

      @@RaddyDev Hey, I have been tinkering around with the API and I'm trying to call it with a React frontend. I'm stuck. I can call up the books data with a browser, but not with my frontend (which I'm hosting on Netlify). I checked your website, but couldn't find anything: do you have a tutorial that makes a React frontend that calls an API hosted on Cyclic (which then gets data from a MongoDB database... i.e. a MERN application)?

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

      I only have a few tutorials on React, but I would like to start creating some. Saying this I just started a personal project that uses the same stack, excerpt I use Firebase for the front end. Since you have your API working, in React you only need to use Fetch or Axios to get and display your data. I used Axios on mine. Look into your browser console when you fetch data with React and see the error. You will most likely encounter a CORS error. This would mean that your API cannot be accessed via another Domain. In NodeJs, is super easy to allow CORS. Download the package and use the basic functionality to set it up. Then you'll most likely be able to get the data. After that you can make it better and maybe make your API only accessibly from your front end application domain hosted on Netlify. That's so nobody can abuse your API. Always happy to help, let me know how it goes. I am looking forward of making React and NodeJs tutorials

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

      Hey@@RaddyDev , I've been tinkering around some more. I was researching how to allow CORS, got sidetracked and found this solution:
      Add this route on the backend in index.js:
      app.all('*', (req, res, next) => {
      res.header("Access-Control-Allow-Origin", "*");
      next()
      });
      Then, on the frontend, add this in the src/App.js file:
      axios
      // accessing Raddy's api
      .get("[raddy's api]/books", {headers: {'Content-Type': 'application/json'}})
      .then((response) => {
      console.log(response);;
      });
      with these lines added, no more error and I can see the data fetched from MongoDB in the console.
      Now, I just have to figure out how to display it in the browser...
      If anyone has questions how I did it, please ask. I'll try to check on this reply.

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

    Thank you Raddy, I've used your link to support you job

  • @1a906b
    @1a906b Рік тому +2

    Great tutorial, easy to understand and follow, thanks for the effort!

  • @mohd.saquibusmani953
    @mohd.saquibusmani953 Рік тому

    Thanks bro, You have explained it clearly is short time.. I have also hosted my web-app with the help of this vedio

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

    Thanks bro, You have explained it clearly is short time.. Thank ypu so much!

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

      I appreciate the comment, thank you!

  • @JitendraKumar-bp7zq
    @JitendraKumar-bp7zq Рік тому

    Thank You😊
    Your video help me to deploy backend project

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

    Amazing explanation Raddy! Thank you very much!!

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

    thank you for making this video it really helped me.

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

    Hi Bro First of all i'll appreciate your work i love it, i just wanted to know that what you are using to auto-complete the command in terminal just like github auto-pilot autocomplete-style suggestions as you code. thanks in advance

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

      Powershell on Windows has a history of commands that I've entered before. Sometimes when I mess up the video and I have to re-record a the same part they pop up. Unfortunately it's nothing clever like autocomplete and thanks for the kind words

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

    Thank you so much, this was super helpful

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

    Wow, this video was really helpful! Thanks you so much!

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

    Very useful, Thanks

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

    Thank you for this amazing video BRO ❤❤

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

    I finally managed to deploy my app, thanks bro

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

    Helpful🤗

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

    This video saved me!! Thank you so much.

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

    Thanks a lot for your video!

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

    thank you nicely explained

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

    Great video❤❤

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

    Thank you so much! Very helpful!

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

    very useful! Thank you!

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

    Yo man, thanks for this!

  • @Ali-tm7ly
    @Ali-tm7ly Рік тому +1

    Thank you so much !

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

    Awesome Man

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

    Hey raddy, i deploy my crud app but when i create data, error read only how i can fix this?

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

      Read only is making me think that your MongoDB user doesn't have full permissions. Check your MongoDB Database User Privileges. It could be that

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

    I tried to deploy the nodejs notes app on cyclic, but it's saying: The application failed to start.
    Node.js v18.16.1
    ERROR: Failed to run "npm run start". Start script defined in package.json:
    "scripts": {
    "start": "node app.js"
    ...

    Exited with code: 1
    [CYCLIC] ERROR: No response from server on port 3000

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

      Cyclic does things a little bit different. You might need to rename your 'app.js' file to either 'server.js' or 'index.js'. Then you have to make sure that mongoose.connect is finished before allowing your app to serve requests.
      In your case, it might be that you comment out:
      //connectDB();
      and replace it with:
      //Connect to the database before listening
      connectDB().then(() => {
      app.listen(PORT, () => {
      console.log("listening for requests");
      })
      })
      They do have a good example on their documentation that might help. Hopefully, the steps above will just work for you

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

      @@RaddyDev did all the changes, but still getting errors.
      TypeError: OAuth2Strategy requires a clientID option
      at Strategy.OAuth2Strategy (/var/task/node_modules/passport-oauth2/lib/strategy.js:87:34)
      at new Strategy (/var/task/node_modules/passport-google-oauth20/lib/strategy.js:52:18)
      at Object. (/var/task/server/routes/auth.js:7:14)
      at Module._compile (node:internal/modules/cjs/loader:1256:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
      at Module.load (node:internal/modules/cjs/loader:1119:32)
      at Module._load (node:internal/modules/cjs/loader:960:12)
      at Module.require (node:internal/modules/cjs/loader:1143:19)
      at require (node:internal/modules/cjs/helpers:110:18)
      at Object. (/var/task/index.js:52:14)

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

    cron jobs in my code do not work on the cyclic server (though it works on local machine)....is there a fix for this please?

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

      Best to look into their documentation as they might be doing something slightly different. They also have very active Discord page that you can check out. What error are you getting?

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

      @@RaddyDev Yeah, i contacted them and they said cron jobs work differently on their server,hence, i have to alter my code to work that way...However, i need my app to work the way i want it to work, so i switched to render😀😇

  • @Zhenkaaf
    @Zhenkaaf 11 місяців тому

    Can I deploy project where I use elephantsqlDB+postgres ? or only MONGODB ?

    • @RaddyDev
      @RaddyDev  11 місяців тому +1

      You can do. The database that you use don't matter

    • @Zhenkaaf
      @Zhenkaaf 7 місяців тому

      @@RaddyDev Hi! Thanks for hepl.. ciclic is closed.. Can you recommend some alternative to deploy progects ?

    • @RaddyDev
      @RaddyDev  7 місяців тому +1

      Try Render. Their website is pretty good and they have a lot of great services that you can use. To deploy NodeJs you need to create Web Service, you'll see it once you login. Also you can create a PostgreSql DB there as well

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

    Hii! I copied your tutorial step by step, but I keep getting Error: Failed to lookup view "list" in views directory "/var/task/views" when I try to open my URL link. Any ideas what I can do to fix this problem?

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

      Do yo have that "list" file inside your views directory? Make sure you have the correct extinction - ejs, hbs, html... Whatever view engine that you are using

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

    how to push changes to your deployed app in cyclic

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

      As default when you make changes to your GitHub repo it will redeploy automatically. You can also change your Auto Deployments from another branch if you wish. Look into the Environments tab, they have a lot of settings

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

    Does our node app have acces to the internet

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

      Yeah widely available. Anybody can access it once is online

  •  Рік тому

    why my app don't save session after i logged in successfully

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

      Which app is that? What are you using to save your sessions?

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

    hey bro i got this error after deploying
    "Cannot find module 'mongoose'"

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

      That's a strange one. Can you make sure that you have mongoose installed and you can see it in your package.json file? Check for typos as well

  • @DieBaltischeMeeresgottin
    @DieBaltischeMeeresgottin 24 дні тому

    cyclic is shutting dow and it does not have ssh protocol anymore!

    • @RaddyDev
      @RaddyDev  18 днів тому

      Yep, sad. Render is another free option

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

    thx a lot buddy

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

    i want code please

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

      Added the link under the description

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

    hello ! will it work for ejs?

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

      Hello! Yeah it will. You might want / have to store some of your static assets on another platform

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

    bro , thanks a lot,

  • @sernowodsk5963
    @sernowodsk5963 10 місяців тому

    7:10 / 13:40

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

    cyclic not installing express

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

      When you deploy your project, what is the error that you get? I've had many express projects on cyclic, it should work

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

    thanks!

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

      No problem!

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

      Please help me to deploy my handlebars (templating engine) , express, node. Js, mongodb website

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

      ​@@vikasmenghani2477 Sure, what do you need help with? Do you get an error? The process should be exactly the same

  • @dev.chhikara
    @dev.chhikara Рік тому

    genuine

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

    Amazing! Thank you so much.

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

    Thanks a lot!!

  • @vireltv256
    @vireltv256 11 місяців тому

    Thanks a lot !!!

    • @RaddyDev
      @RaddyDev  11 місяців тому

      No worries!

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

    THANK YOU