Build a CRUD Rest API in Go using Mux, Postgres, Docker and Docker Compose

Поділитися
Вставка
  • Опубліковано 7 вер 2024

КОМЕНТАРІ • 36

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

    Find Francesco: francescociulla.com
    0:00 Intro
    3:08 Start coding: project initialization
    6:00 main.go: dependencies, struct, main, middleware function, routes
    14:46 Controllers: Get All, Get one, Create, Update, Delete
    21:03 Dockerfile
    24:41 Docker Compose
    29:54 Run the Postgres container, Build the Docker Image, run the Go app container
    37:15 First test with Postman
    42:40 the app crashes on some requests. FIX.

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

    Great video! Mobile Developer here studying Go Lang.
    I studied syntax first from docs and other UA-camrs but was a little bit picky on guides and video examples for CRUD, with others I just stopped within the first 2 minutes but yours was compact and precise!
    At 37:20 - 39:40 I felt your pain haha, I hope I watched this live so I could've pointed it out earlier, this is a common mistake in mobile-fe development too xD
    Good luck and I hope you'll grow your channel more!

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

    Great and useful video Francesco. Thank you very much indeed.

  • @artemafonin9474
    @artemafonin9474 Рік тому +2

    Great lesson, thanks! Can't wait for more!

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

      We have one more this Saturday!

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

      @@francescociulla hey!
      I faced a problem, that I can't solve by myown, so I will be very grateful for your help.
      I have postgres installed on my machine, and I have had to use my postgres password in docker-compose file and in TablePlus.
      Then "docker compose up --build" is running I can create, update, delete and get users by Postman, it' works fine.
      But there is no table "users" in TablePlus. Checked postgres databases in PowerShell - same result. There is db postgres, but it is empty.
      I think that sql.Exec("create table if not exists...") don't work properly in my case, but it doesn't throw any errors, so I can't debug it.
      Could you please give me some tips to make it clear?

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

      @@artemafonin9474 I think you have 2 instances of Postgres running, try to tun just the go app and in the docker compose, change the PG host to "localhost"

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

      @@francescociulla thank you for fast and informative answer! I unistalled postgres from my system and now it works as should be 😅

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

      @@artemafonin9474 you are welcome

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

    This is exactly what Bilal and I will be using for Book Loop.

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

    Perfect video at a perfect time!

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

    Just an amazing session 🎉🥳🥳🥳

  • @AmolGajare-gf6bs
    @AmolGajare-gf6bs 2 місяці тому +1

    how your vs code suggest whole function to be write ?? any extention there or shortcut key?

    • @francescociulla
      @francescociulla  2 місяці тому

      It's GitHub copilot, to speed up the process. All the code is available

  • @webcode_
    @webcode_ 5 місяців тому +1

    At 51:32, you should have removed the ":" character in line 142. Instead of creating an 'esle' block because there is a 'return' in the 'if' block )))

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

    Hello Sir!
    What extensions do you use for code hints in gray, then you just highlight it?
    thank's

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

    Kiitos!

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

    Great 👍

  • @AchwaqKhalid
    @AchwaqKhalid 11 місяців тому +2

    Please use a bigger font ❗

  • @bandr-dev
    @bandr-dev 8 місяців тому +1

    environment variables straight to the docker compose file?
    no multistage dockerfile?
    put some actual effort into your video next time

  • @ashutoshsingh583
    @ashutoshsingh583 3 місяці тому +1

    man just pushing ai coding and not even explaining it you should just stop making videos