Next.js 14, Python, Docker: Build a fullstack rest API in TypeScript and Python, using Flask

Поделиться
HTML-код
  • Опубликовано: 18 сен 2024

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

  • @francescociulla
    @francescociulla  8 месяцев назад +3

    find Francesco: francescociulla.com
    0:00 Intro, Architecture, Prerequisites, Project initialization
    1:45 PostgreSQL
    3:29 Backend: Python, Flask, SQLAlchemy, Dockerization of the Python application
    14:30 Testing the backend service
    15:57 Frontend: nextjs14, TailwindCSS, testing the frontend
    27:35 Dockerization of the nextjs app and final test

  • @user-ng1lv5pr3n
    @user-ng1lv5pr3n 24 дня назад +1

    Very cool demo, Thank you. @ 5:03 , how to get rid of those yellow squiggly lines?

    • @francescociulla
      @francescociulla  24 дня назад

      they are just warnings and these are used in the dockerization of the project. I can't remember now but if you delete those dependencies is not gonna work (you can try it out and let me know)

  • @trungkienao6230
    @trungkienao6230 Месяц назад +1

    I followed the steps you showed in the video and it actually worked. However, I have a big question: in ./frontend/src/components/UserInterface.tsx, it seems that in line 16, the frontend cannot call the backend through the env file but can only call when hard-fixing the path. Lead the backend here too. Is the reason coming from the frontend's Dockerfile? And what should I do if I want to use the .env file? Once again thank you for the useful video, hope you will reply me soon.

    • @francescociulla
      @francescociulla  Месяц назад +1

      Hi, that env variable is set in the line 12 of the compose file. of course if you deploy the backend and frontend on different Ips, you should solve cors issues. if you want to use the .env file, you can do that and just use the env file in the docker compose (to be honest, docker compose automatically reads a .env file in the path, so it might look like magic)

    • @trungkienao6230
      @trungkienao6230 Месяц назад

      @@francescociulla thanks for your reply. Oh i found that my env file is normal and docker-compose is normal too. The problem is not come from env file. When I try to log out from FE's container, I still see the backend's localhost:4000. But let's go back to line 16 of the ./frontend/src/components/UserInterface.tsx file, if you replace that line with "const apiUrl = process.env.NEXT_PUBLIC_API_URL" then the application is actually unusable. FE is not calling the correct BE localhost:4000 path that we passed in from the env file.

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

    Hey francesco we use exactly same tech stack in our company and I'm in backend but confused about flask is there a future in flask or django ?

  • @abhishekshukla115
    @abhishekshukla115 8 месяцев назад +2

    Great explanation ❤

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

    Great content franc!!
    I wanted to know if we can deploy this docker container running backend server to the vercel ? Or do we need to deploy it to some other cloud?

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

      no you can't vercel is just to deploy next.js apps (it's their framework)

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

      @@francescociulla thanks franc! You are right. I've checked that it won't be suitable for my use case so I probably have to look into some other cloud.

  • @oludedavid9706
    @oludedavid9706 7 месяцев назад

    I wish I could add more likes. Thank you for the video 🤗

    • @francescociulla
      @francescociulla  7 месяцев назад

      Your comment has been featured here twitter.com/FrancescoCiull4/status/1754193688480096632?t=kW64AklOTzthZ9LaLTU4-Q&s=19

  • @khalidsultani1896
    @khalidsultani1896 6 месяцев назад +1

    Thanks any video on deployment of given app

    • @francescociulla
      @francescociulla  6 месяцев назад

      I made some but we will do more in the future

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

    Thank you for the video ❤

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

    Thanks for this masterpiece❤🎉

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

    Hi @@francescociulla, just wanted to understand, why did you use NextJS not just react because you are not using any NextJS functionality.

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

      Godd point. I also noticed it and I was going to ask the same thing.

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

    if i push it to a git repo, the postgres Database will be empty no?
    I want to share my code with a student and run postgres with node.js on a Docker container. Works fine for me localy since I already inserted some Data to the postgres database. But if he clones the repo and runs docker compose there would be no data I guess?

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

      the repo contains a docker compose, where you have the definition of a service. no you will not get any data, but you'd start with a fresh new volume calleg pgdata on your host system

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

      @@francescociulla so either i need to initialise a psql dump in docker compose.yaml or Upload my lokal docker Container to dockerhub, so he will get 1:1 my Database?

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

    Thanks Brother.