Symfony 4 | Creating a Microservice (Part 1)

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

КОМЕНТАРІ • 35

  • @tom2324
    @tom2324 5 років тому +8

    love finding intermediate and more advanced tutorials like these! thanks

  • @andysi1776
    @andysi1776 4 роки тому +12

    From the second minute when you started to list standards of coding you earned a like and subscription, a good video ! Thanks

    • @QbrainTV
      @QbrainTV  4 роки тому

      thanks! really appreciate it!

  • @angelogrieco
    @angelogrieco 4 роки тому

    Great video! It'd be very nice if you could make one to go deeper into test ( 17:30 ) and maybe digress a bit speaking about phpspec, what you think about that and where would you see it fit in your process...

  • @Alien95kloc
    @Alien95kloc 4 роки тому

    Thank you, this video helped me a lot :) Looking forward to see more videos

  • @acerrusm
    @acerrusm 4 роки тому +1

    Leuke videoles! Nu kan ik ten minste mezelf verplichten om met de docker te leren werken :)

  • @aristo630
    @aristo630 4 роки тому +2

    Plus, you have a terminal in the IDE - don't need to open a new one :)

  • @andysi1776
    @andysi1776 4 роки тому

    It would be interesting to see some simple prototype the implementation of SAGA orchestration or choreography.

    • @QbrainTV
      @QbrainTV  4 роки тому +1

      this is what im aiming for in the end yes :)

  • @ICSVortex-DCS
    @ICSVortex-DCS 5 років тому +3

    very pity that u didn't show docker_dev/nginx/site.conf file...

    • @QbrainTV
      @QbrainTV  5 років тому +2

      The site.conf file has the following code in it:
      server {
      listen 80;
      server_name localhost;
      root /app/public;
      location / {
      # try to serve file directly, fallback to app.php
      try_files $uri /index.php$is_args$args;
      }
      location ~ ^/(index|config)\.php(/|$) {
      fastcgi_pass php:9000;
      fastcgi_split_path_info ^(.+\.php)(/.*)$;
      include fastcgi_params;
      fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
      fastcgi_param DOCUMENT_ROOT $realpath_root;
      }
      # return 404 for all other php files not matching the front controller
      # this prevents access to other php files you don't want to be accessible.
      location ~ \.php$ {
      return 404;
      }
      error_log /var/log/nginx/error.log;
      access_log /var/log/nginx/access.log;
      }
      it creates a standard server listening to port 80 (which we mapped local port 8000 to in the docker-compose.yaml file)
      and places the webroot to app/public folder, so it loads the symfony front controller as the main page.
      If you have any more questions, let me know! :)

    • @QbrainTV
      @QbrainTV  4 роки тому

      To get back to this: ive adressed this comment in video 6 (API) (in the beginning), and fully showed the site.conf

  • @SonofSol1
    @SonofSol1 5 років тому +2

    You lost me at "alright" Haha coding messes with my Qbrain (solaire)

    • @QbrainTV
      @QbrainTV  5 років тому

      Hahaha! Yeah! I wanted to try something different then mario maker for a change, hope you still enjoyed this though! 😅

  • @Argon-X
    @Argon-X 4 роки тому

    Even in 1080p the image is blurred, seems like original straeam was in low quality? (

    • @QbrainTV
      @QbrainTV  4 роки тому

      Everything is recorded in 720p and upscaled to 1080p. However since part 1 and 2 i got some comments about the letters being small so i think from part 3 and on i have a larger font :)

    • @QbrainTV
      @QbrainTV  4 роки тому

      That being said, im currently busy upgrading a bit here, so my future videos (which are coming soon!) Will be native 1080p as well. :)

  • @TheJDieJ
    @TheJDieJ 4 роки тому

    Where can i download docker image? I know there is hub.docker, but i dont know how to use it. I can only pull images

    • @QbrainTV
      @QbrainTV  4 роки тому +1

      Hi, You install docker-compose next to docker for the command line (www.docker.com/products/docker-desktop)
      (docker-compose and docker itself are 2 different installs), and then you create a yaml file like the one I have where you "configure" what you like and how. After that, you only have to do "docker-compose up" in the directory where the docker-compose.yml file is, and docker will do the rest for you. :) It downloads the images you want and configures them, and if you want to create a custom image, you create a dockerfile and create your own. You can checkout my project on dannyeerens.com/#projects , there will be a docker-compose.yml file and dockerfile there that you can use as an example :) Hope this helps!

    • @TheJDieJ
      @TheJDieJ 4 роки тому

      @@QbrainTV Is creating docker-compose.yml enough for that? I dont have to prepare Dockerfile or nginx.conf? Btw. I really appreciate your answer. I am new to docker and I still dont understand many concepts

    • @TheJDieJ
      @TheJDieJ 4 роки тому

      @@QbrainTV Okay, I managed to configure it but i think i need to find out more about docker....

  • @TheJDieJ
    @TheJDieJ 4 роки тому

    Hey i have come across another problem. I cant run my test due to some kernel error LogicException: You must set the KERNEL_CLASS environment variable to the fully-qualified class name of your Kernel i
    n phpunit.xml / phpunit.xml.dist or override the App\Tests\IfAWSWorking\IfAWSWorking::createKernel() or App\Tests\IfA
    WSWorking\IfAWSWorking::getKernelClass() method.
    Would you mind helping me with this?

    • @QbrainTV
      @QbrainTV  4 роки тому +1

      Yoo, im not behind my laptoo right now so I can't provide a code example. But you are missing the link to the kernel class in your phpunit.xml. make sure to check if you have a KERNEL_CLASS defined in your phpunit.xml. check the one I have for an example. Should work. Good luck! :)

    • @TheJDieJ
      @TheJDieJ 4 роки тому

      @@QbrainTV Im not sure. I pasted in phpunit.xml.dist inside tags and it still doesnt solve the problem

    • @QbrainTV
      @QbrainTV  4 роки тому

      @@TheJDieJ try right mouse click on your dist.xml file and run tests from there. Curious If that works.

    • @TheJDieJ
      @TheJDieJ 4 роки тому

      @@QbrainTV No tests are executed for some reason

  • @vp4361
    @vp4361 3 роки тому +1

    this series of videos almost doesn't have anything related with microservices , and deals only with unit test and tdd

    • @QbrainTV
      @QbrainTV  3 роки тому

      Thank you for your comment. Could you explain what you are missing in the video's? Then I can see if I can add this to some more content later on. :)

    • @vp4361
      @vp4361 3 роки тому +1

      @@QbrainTV I think most of us is interested to know how do you approach microservices ideea using symfony and not creating like 5 videos with showing us how to do unit tests. I mean if I wand to watch video with unit test I believe there are lot of them
      - I was expected to see how you approach event bus principle
      - one of the mains goal of microservices are decoupling components and logic. with your tone of testing for me looks as a monolithic and not a microservices architecture
      Microservices with Event Buss should do this scenario:
      if you have 3 components like
      1) user management
      2) invoice system
      3) orders
      question: if user management is down can you still create invoices?

    • @QbrainTV
      @QbrainTV  3 роки тому

      ​@@vp4361 First of all: Thank you very much for the detailed response. I understand your feedback and I will do my best to help with this scenario.
      Let me start by saying that i recorded this course over (almost) 2 years ago, and I've learned a lot since then (as we all do).
      I'm planning to record more videos and come back to this course, I will make sure to go into your comment in more detail when I create that video.
      For now, I hope I can give you some answers to your questions through here:
      - The first video's are meant to explain what a microservice is, the scope that a microservice should have, and the general idea behind them. While I understand that the whole architectural principles are in later video's, I needed to start somewhere, and the idea for this course/tutorial was to start from the beginning, without shortcuts. I've seen a lot of video's with a lot of shortcuts (copy paste this, clone that) and I tried to do this as less as possible, which is the reason why you see so many test-driven stuff not necessarily needed in terms of microservices architecture, but still imho necessary to create a decent working microservice itself.
      - The api and adapter are from an architectoral standpoint, as far away from a monolith as you can get. The whole concept of microservices, as far as i believe, in itself is to dedicate a microservice to manage one specific type of component within your domain. In this course, "comments" are that component. In a big architecture, say, for a big website that features comments, the comments api would be 1 microservice within the architecture of multiple, next to possibly a video/media api, a pages api and for example an account api.
      Regarding your example, I understand your need for this, so I will cover that in a video, but for now it should be pointed out that the whole comments flow that I create accross all videos, is comparable as one of the 3 components in your list. The api posts commands to the message bus, the adapter picks them up, processes them, and puts an event on the message bus. Then other microservices can pick up the events. The reason to seperate the api and the adapter is because you want to seperate the read process and the write process, giving yourself the ability to horizontal scale the reader db instances, as well as keeping your database more secure.
      To go futher on your example, you would have an order-api, a user cms/api, and an invoice api. when the user cms is down, existing users would still be able to do an api call towards the invoice api, creating a "InvoiceCreatedCommand" towards the invoice adapter. When that command is processed, the invoice adapter could put an event towards the messagebus for both the order and user/cms adapters. The order adapter can process that event, so the order continues. If the user cms is down, the events would be staying in the message queue for the user adapter as long as it is down. When it is (re)started/fixed, the adapter would process events that it coulnt handle and syncs itself back.
      I hope this explains some of your questions, if you have anymore questions/tips/feedback, feel free to ask me.
      -Q

  • @francehit1514
    @francehit1514 3 роки тому

    why dony you uplaod files content? for example dockerfile etc. :(

    • @QbrainTV
      @QbrainTV  3 роки тому

      Hi FRANCEHIT, you can find the code, including dockerfiles etc (as is) from the last video of this series on my website: www.dannyeerens.com

  • @garethfoxtrot5722
    @garethfoxtrot5722 4 роки тому

    Can I please share on github or google drive the following files: Dockerfile, nginx.conf, php.ini and docker-compose.yml? I would be grateful, because it something me not working probably I something wrong prescibe.

    • @QbrainTV
      @QbrainTV  4 роки тому

      Hi gareth, sure! If you can share the link i would love to take a look. Also, i have a discord now with a channel called programming stuff, im trying to be there more actively. So if you have any questions or feedback then you are always welcome there as well :)
      discord.gg/Bz7qeE