Gravity
Gravity
  • 10
  • 114 524
How To Build An AI Photo Generation App With Javascript & DALL·E
Learn how to build a SaaS web app that generates photos using AI with OpenAI’s Dall-E.
You'll need an OpenAI account and API key, which you can get here ⬇️
platform.openai.com/signup
We’ll use my SaaS boilerplate to speed up the development and handle the authentication flow, subscription billing and UI components. ⬇️
usegravity.app
Dall-E will keep the images online for you for around two hours, so ideally, you’ll want to move them to your own storage to keep them. Perhaps that’s a future tutorial idea? :)
SaaS boilerplate ⬇️
usegravity.app
Use coupon SATURN10 to get 10% OFF
How to Build a SaaS Course ⬇️
usegravity.app/how-to-build-a-saas
Use coupon JUPITER10 to get 10% OFF
QUESTIONS
Have a question about building a SaaS app? Got a suggestion for a future video? Please comment below and I’ll get back to you.
CONNECT
Follow me on Twitter ⬇️
kylegawley
SUBSCRIBE
Get notified of new video tutorials ⬇️
czcams.com/users/gravityjs
zhlédnutí: 1 400

Video

How to Deploy a Node.js & React App to Heroku
zhlédnutí 12KPřed 2 lety
Learn how to deploy a Node.js & React app to Heroku in just 25 minutes. In this tutorial we’ll set up a deployment pipeline with staging and production apps for testing and live use. The demo application is the app that students have been building in my brand new course: How To Build a SaaS Product. Find out more here: usegravity.app/how-to-build-a-saas 🎁 Use code jupiter10 to get 10% OFF NOTES...
How To Build a To Do List Web Application in 30 Minutes
zhlédnutí 11KPřed 3 lety
Learn how to build a To Do list web SaaS application in just 30 minutes. It has everything from authentication and payments to a beautiful user interface (UI) 2023 UPDATES - Use ['completed'] when setting the default checkbox value. - Form data key is now inputs The application is built using Node.js & React and I’m using Gravity (usegravity.app) to do most of the heavy lifting. Building an app...
How To Store Passwords Securely In Node.js Using Bcrypt
zhlédnutí 7KPřed 3 lety
Many people assume that encrypting the password before storing it is the right approach to building a secure web application. However, encrypting your passwords is a BAD IDEA and will make your application vulnerable. Even worse, some people simply store the passwords in plain text! In this tutorial, we’ll look at a simple example of how to securely store passwords using bcyrpt. NOTES Download ...
How to Use Model-View-Controller (MVC) in Node.js
zhlédnutí 18KPřed 3 lety
This tutorial is a hands-on, simple example of how to build a web application that uses the Model-View-Controller (or MVC) development pattern in Node.js If you’ve find this topic confusing because of overly technical Javascript MVC tutorials, then this video is for you! No jargon, no headaches. NOTES Knex.js query builder ⬇️ knexjs.org How to Build a REST API in Node.js ⬇️ czcams.com/video/MDM...
How to Run Automated Browser Tests (No Code)
zhlédnutí 613Před 3 lety
This tutorial covers how to set up and run an automated browser test with Firelab (my new testing product). No code required! CONNECT Follow me on Twitter 👉 kylegawley Find out more about Firelab 👉 firelab.io SUBSCRIBE Get notified of new video tutorials 👉 czcams.com/channels/5B1mJn-FRs7hKZOsQtedbA.html
5 Pro Secrets For Working with Javascript Objects
zhlédnutí 1,1KPřed 3 lety
This tutorial covers 5 advanced techniques for working with javascript objects: 1. conditional object properties 2. optional chaining 3. object shorthand 4. object deconstruction 5. finding an object in an array of objects NOTES Download the code from the tutorial on Github 👉 github.com/usegravity/tutorials QUESTIONS Have a question about working with Javascript objects? Or a suggestion for a f...
Hate Try...Catch Error Handling in Node.js? Do This Instead
zhlédnutí 44KPřed 3 lety
UPDATE: At 8:32 you should replace the generic string with err.message to send a dynamic error message to the client. Are you fed up writing try…catch in your Node.js application? In this video I’ll show you how to set up a global error handler in a Node.js application in a few easy steps. You will never have to write another try…catch statement again! This trick will save you from writing hund...
How to Build a REST API (Node.js & Express)
zhlédnutí 2,2KPřed 4 lety
Learn how to build a simple REST API in Javascript using Node.js and Express. This is a basic example that is easy to understand and follow. In the next videos I'll cover adding more advanced functionality to the API, including integrating controllers & models, authentication and error handling.
Architecture of a Modern Javascript Web Application (Node.js & React)
zhlédnutí 16KPřed 4 lety
Learn how to structure a modern Javascript SaaS web application built with Node.js & React. Starting with an Express.js server, you'll see how to add a React.js client and communicate to the Node server with a REST API and model-view-controller pattern. In the next videos, we'll dive deeper into each of these topics so you can learn how to build your own web app. You can find out more about the...

Komentáře

  • @edwinmunguia2049
    @edwinmunguia2049 Před měsícem

    why are you complicating yourself? you just need to implement the error middleware and throw errors from controllers 🤷🏽

    • @GravityJS
      @GravityJS Před měsícem

      That's exactly what I did in the video.

  • @prerakhere
    @prerakhere Před 4 měsíci

    vid starts at 5:30

  • @jibrilben4297
    @jibrilben4297 Před 5 měsíci

    knexfile🤔

  • @randalleikelboom2099
    @randalleikelboom2099 Před 5 měsíci

    Great Video!. Thanks!!

  • @Muneer398
    @Muneer398 Před 5 měsíci

    Please help me out

  • @Muneer398
    @Muneer398 Před 5 měsíci

    I am getting an error Invalid template name when I am trying to create a new account why

  • @boatingsocal9297
    @boatingsocal9297 Před 7 měsíci

    At the 16:00 mark, you mention how you would set up the configuration if the React app was hosted separately from the Node.js app. You mentioned that you would add details in the video description, but I don't see it. Can you please provide that information?

  • @germanoller4418
    @germanoller4418 Před 10 měsíci

    really good work brother

  • @harshshah3797
    @harshshah3797 Před rokem

    Video starts at 4:52

  • @johnjiang4412
    @johnjiang4412 Před rokem

    unneccesory background music

  • @justinhopkins2088
    @justinhopkins2088 Před rokem

    if im using sanity database for my app already, creating a database on heroku is not necessary, correct?

  • @justinhopkins2088
    @justinhopkins2088 Před rokem

    if im using sanity database for my app already, creating a database on heroku is not necessary, correct?

  • @ismaeinqasem3606
    @ismaeinqasem3606 Před rokem

    where git ?

  • @dryoldcrabman6890
    @dryoldcrabman6890 Před rokem

    i may kill my self I have never been so frustrated in all my life with this crap

  • @djgulston
    @djgulston Před rokem

    Very clear and concise video! Thank you so much!

  • @forsabarça
    @forsabarça Před rokem

    Use Thender Client extension instead of Postman

  • @RyanGosselin-xe9tl
    @RyanGosselin-xe9tl Před rokem

    Cool. Hope my bootcamp teacher approves haha

  • @Flipping_myFinds
    @Flipping_myFinds Před rokem

    It’s an entire learning curve just to deploy a website 🤦‍♂️

  • @mbakoaobakwegoitsemang5663

    Thanks so much for the video @KyleGawley, i'm having issues adjusting this approach for a react,vite node build.. any suggestions? my build seems to fail right after trying to build the vite app after starting the node server backend

  • @jabborsattarov4982
    @jabborsattarov4982 Před rokem

    👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍

  • @AlTearjen
    @AlTearjen Před rokem

    thanks for explaining this, but I don't think you should be saying every error is a 500 error. It could be a bad request. I would suggest this code. res.status(err.status || 500); res.end();

  • @SpokoProductions
    @SpokoProductions Před rokem

    I'm not seeing where you're using the uuidv4 part for the password. Is that needed? Great vid!

    • @SpokoProductions
      @SpokoProductions Před rokem

      Oh wait nevermind, you're using that as the id field in your database. Got it now!

  • @PS-od2mm
    @PS-od2mm Před rokem

    I respect people who focus on their video quality instead of wasting time of viewers to earn watch time. You earned a subscriber. Thank you Sir.

  • @aliadel1723
    @aliadel1723 Před rokem

    bro sorry but can tell me how I can use it in any code and where in MVC??

  • @XeonXR6
    @XeonXR6 Před rokem

    What's in your KNEX model?

  • @dav.R7
    @dav.R7 Před rokem

    @Gravity . I really liked your solution, it worked perfect here. But wouldn't it be better to write function as handler than use?

  • @abdirahmann
    @abdirahmann Před rokem

    i get your solution, its beautiful but how do i implement it for middlewares that need to execute a 'finally' after the try catch has ended. i need the finally part because for some middlewares i want to do a db transaction (i don't use ORMs), i use postgres and that involves checking out a client from the pool and the *finally* releasing it into pool after a transaction has completed. i'll give you an example: const client = await pool.connect() try { // very may queries are executed here res.status(201).json({message: "resource created successfully"}) } catch(err) { res.status(500).json({message: "something went wrong"}) } finally { // here is how i would like to be helped. Thanks :) client.release() } .... more code

  • @kameerhosein5748
    @kameerhosein5748 Před rokem

    What is your VS Code theme?

  • @v0nnyboy
    @v0nnyboy Před rokem

    Couldn't one just use the 'express-async-errors' library ? Just wondering !!

    • @frosty129
      @frosty129 Před rokem

      I think that's an even better solution, no?

  • @Daniel-zk5sj
    @Daniel-zk5sj Před 2 lety

    Better deploy it on mogenius. Not by salesforce...

  • @fakeplay4534
    @fakeplay4534 Před 2 lety

    Very good video!

  • @krishnachandrasharma1321

    It’s helpful 👍

  • @kabapy2
    @kabapy2 Před 2 lety

    i am trying to implement this on a higher level, on the express router level, it works for non-async-routes, and fails for async routes . any insights ??

    • @bonsayeb9620
      @bonsayeb9620 Před rokem

      Hey, I'm facing the same issue, did you find out a solution?

  • @leoMC4384
    @leoMC4384 Před 2 lety

    Very useful. I'd add a fifth argument to the high order function: data about the operation, for logging in case of an error. Thank you. Great tutorial. 👏👏👏

    • @GravityJS
      @GravityJS Před 2 lety

      Thank you

    • @RyanGosselin-xe9tl
      @RyanGosselin-xe9tl Před rokem

      Do you have a code example of this suggestion? Im new to JS

    • @josephajibodu2377
      @josephajibodu2377 Před 8 měsíci

      You can instead create custom exception classes with message, status code and data. That way its cleaner.

  • @hectorgohome
    @hectorgohome Před 2 lety

    You need to make more videos

  • @flowerofash4439
    @flowerofash4439 Před 2 lety

    interesting how the fn function return it self as a promise and somehow it is connected to the express route

  • @MuhammadIlham-vn5nq
    @MuhammadIlham-vn5nq Před 2 lety

    did you store the salt into database ?

    • @GravityJS
      @GravityJS Před 2 lety

      It's stored in the hash automatically

  • @icheston
    @icheston Před 2 lety

    What about chaining different handlers, if the catch calls the next middleware and the next middleware is to handle email notification. Even if there is an error, the email will get send?

  • @dejangavrilovik2363
    @dejangavrilovik2363 Před 2 lety

    I like the tool, also nice videos guys!

  • @mysteriousmsn
    @mysteriousmsn Před 2 lety

    Great Video, no try catch needed anymore, short and simple alternative.

  • @adventurer2395
    @adventurer2395 Před 2 lety

    Great video! One drawback of this approach is that you lose complete control over creating contextual errors at different layers of your app, which improves debugging, because you’re never catching/handling them and just bubbling up anything that might happen.

    • @GravityJS
      @GravityJS Před 2 lety

      You can throw a specific error anywhere the catch it in this method. I messed up the video by passing a generic message back to the client and put a note in the description. Will do an updated video soon :)

    • @angrysmilex
      @angrysmilex Před 2 lety

      Just throw new Error('This is new error') in if else statement in any function

    • @dav.R7
      @dav.R7 Před rokem

      it was a good observation. I used the Joi library and I can't put the code status as 400.

    • @kakam458
      @kakam458 Před rokem

      You can still do independent try catch blocks if you need to. Also you can create custom error classes by inheriting the Error class. Then throw those instead. Like: class BadRequest extends Error{ constructor(message){ message = message || 'Unspecified Bad request'; super(message); this.status = 400; } } throw new BadRequest();

  • @npc73x
    @npc73x Před 2 lety

    What if I have a 4 middlewares and the error happened on 3 rd middleware ?

    • @icheston
      @icheston Před 2 lety

      The third middleware will still gets called 😂

  • @guillermosalguero3581

    Great video, keep up the great work!

  • @sheldonfourie5959
    @sheldonfourie5959 Před 2 lety

    On your front-end like vue what do you recommend doing for your api? can you recommend any good docs on this or repos I can check out?

    • @GravityJS
      @GravityJS Před 2 lety

      To make the API calls? I use AXIOS.

    • @sheldonfourie5959
      @sheldonfourie5959 Před 2 lety

      @@GravityJS how you handle your errors neatly on the front-end

    • @galactusclb5733
      @galactusclb5733 Před 2 lety

      @@sheldonfourie5959 That's what I'm also looking for😊 ex : When using SQL, how to handle errors in the best way. like user input errors ( duplicate entries), coding errors. if (err) { if (err.code === 'ER_DUP_ENTRY') { throw new BaseError("Duplicate entry.....................", err, "sampleFunc"); }

  • @roselpadilla
    @roselpadilla Před 2 lety

    Beautiful code!

  • @adventurer2395
    @adventurer2395 Před 2 lety

    Thank you for this video. Shouldn't the business logic be abstracted away from the controller?

  • @luannguyen-dg8eu
    @luannguyen-dg8eu Před 2 lety

    You try to give the video more brightness it will be great if you do

  • @djmonteur
    @djmonteur Před 2 lety

    many thanks

  • @themouldyorange2912
    @themouldyorange2912 Před 2 lety

    hi i like the vids - how about a tutorial on oop in javascript. i know i'd find that useful.

  • @dangthuyhuong5890
    @dangthuyhuong5890 Před 2 lety

    You try to give the video more brightness it will be great if you do