Build a REST API in TypeScipt - ExpressJS and Prisma

Поделиться
HTML-код
  • Опубликовано: 2 июн 2024
  • In this video we're going to build a basic REST API using TypeScript, ExpressJS and Prisma.
    👨‍💻 Looking for a web developer job, visit: www.webdevjobs.io/
    👽 Discord - / discord
    ⏳ Timestamps
    0:00:00 - Intro
    0:02:05 - Installation
    0:06:36 - Prisma Schemas and Database Setup
    0:28:37 - Server Setup
    0:33:19 - Author Services and Router
    1:04:41 - Book Services and Router
    The finished code can be found here:
    👾 - github.com/sixfwa/express-typ...
    #typescript #expressjs #prisma

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

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

    👽 Join the Discord Server (link in the description)

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

    Wow I love the style of your teaching 😍

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

    great job for juniors! thanks!

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

      Thank you! Im glad that it helped :)

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

    Very well explained. Big project but super easy to follow 😎

    • @iamrithmic
      @iamrithmic  8 месяцев назад +1

      Thanks a lot! Glad that you found it useful :)

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

    Great video!

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

    If you enjoyed this video - please leave a Like and Subscribe for more :)

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

      Great Video Dude, :) Actually i'm bit of django fanboy, i think we can implement the same thing using drf in much shorter timeframe.
      anyways, i might follow along this in future, as of now i prefer working with js in frontend only.

    • @anatholekaringanire7649
      @anatholekaringanire7649 10 месяцев назад

      why didnt' you use ts-node ??

  • @k303k
    @k303k 5 месяцев назад +1

    Thanks a lot for the video .Very well explained.

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

      Glad it was helpful!

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

    Great video, I've learned a lot from it thank u very much
    I just have one question please. So I've just finished coding my REST API and now its ready for production phase; How do I go about building or compiling my project, I've read a lot of articles that say you need to compile out typescript project, but I lose my generated Prisma client in the process. And its not ideal to deploy your project with dev depends like Nodemon just to have working. I'm really stuck at this point can you please explain this to me

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

    I am beginner in terms of backend dev, it helped me understand prisma, the services and route seperations, validators, and integration with a sql database.
    I'm going to try such a project with postgresql

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

      Awesome!! Best of luck. You can keep us up to date on our Discord server also with your progress (check description)

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

    Great video

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

    Very nice video, great job!
    For some reason, I thought Prisma is only used for GraphQL, but seems like it's got everything covered!

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

      It's an amazing ORM. With TypeScript the experience is x100

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

      Totally agree, watching your video, I see that it seems really nice!

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

    Well done. Please do some tRPC next.

    • @iamrithmic
      @iamrithmic  8 месяцев назад

      It's on the way. Have one with the T3 Stack

  • @m1thrandir
    @m1thrandir Год назад +6

    Can't we use the types that prisma generates for our models, instead of typing them on our own?

  • @ilaydelrey3122
    @ilaydelrey3122 8 месяцев назад

    by the way, which keyboard were you using when recording this video?

    • @iamrithmic
      @iamrithmic  8 месяцев назад +1

      The Apple Keyboard :)

  • @nestorcarrasquero
    @nestorcarrasquero 11 месяцев назад

    Great video, good job! Although I am not clear how to work with nullable fields

    • @iamrithmic
      @iamrithmic  8 месяцев назад

      Thank you very much! What exactly confuses you?

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

    what is your editor theme?

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

      It's looking 👌

    • @iamrithmic
      @iamrithmic  8 месяцев назад

      From the Noctis collection :)

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

    which theme u r using ?

    • @iamrithmic
      @iamrithmic  8 месяцев назад

      From the Noctis collection :)

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

    Nice mate! Next do Laravel if you want.

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

    How are you using Typescript with no tsconfig.json???

  • @martinzutelman1018
    @martinzutelman1018 9 месяцев назад

    I am a beginner and I don't understand how or why you are giving it info through GET instead of POST, pleas help

    • @iamrithmic
      @iamrithmic  8 месяцев назад

      This is because I just want the information for a given object. I am not writing to the database

  • @altingoxhe4275
    @altingoxhe4275 3 месяца назад

    Yuval Noah Harari? Really? What books did you read from him?
    "How despicable human race is" or "The Deplorables" co-authored with Hillary Clinton? Or "You'll own nothing and will be happy"?
    And by the way, correct the prisma schema for authors and books to have many to many relationship.

    • @iamrithmic
      @iamrithmic  3 месяца назад +1

      Why are you so pressed about this? It's a programming tutorial not a book review

    • @altingoxhe4275
      @altingoxhe4275 3 месяца назад

      Actually I was looking for a prisma tutorial, featuring books and authors, like "Mein Kampf" written by a little moustache guy in 1925. But I should be satisfied with authors like Harari and his mentor Klaus Schwab. Their ideas of sociopathy are very close the little moustache man.
      Fuck this shit.

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

    Hey @rithmic I have a problem with this code on the "seed.ts". line 40, error: 'author' is possibly 'null'.

    • @gauravmishra8561
      @gauravmishra8561 11 месяцев назад

      hey you found any solution?

    • @kadekdarmayasa8208
      @kadekdarmayasa8208 10 месяцев назад

      This is only a warn that come from typescript, just ignore it.

    • @allenal-shamali9553
      @allenal-shamali9553 10 месяцев назад

      If you don't want to ignore the problem, you can add a check and put the await where the error is happening in the check.
      if (author) {
      await ...... (the code where the problem is)
      } else {
      console.log("author not found")
      };
      This error is happening because we can't be sure that we will find an author with the name Yuval Noah, so TS is basically telling you that errors might happen here, so it is better to prevent accessing properties that are potentially null or undefined.