Final Exercise - Building Back-End For Dashboard - Build Expense Tracker App With PHP 8
HTML-код
- Опубликовано: 31 июл 2023
- Final exercise for the series. In this exercise you are expected to build the back-end part for the dashboard page. Front-end is provided for you along with controller & service methods. The exercise has 2 parts + bonus:
Part 1: Fill in the methods that return hardcoded data & return the real data in the same format
Part 2: Seed your transactions table with 100k or even more transaction records & test dashboard. Look out for N+1 problems & see if you can fix them. You can also add caching to cache some of that data & improve performance.
Part 3 (Bonus): Add date filters in dashboard either via date pickers or month/year drop downs. Pass this to controller & use it to filter data based on the given dates.
Good luck!
SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL
👍 Smash the like button
🤝 Subscribe to the channel & turn the notifications on
💬 Post comments, any feedback is greatly appreciated
⭐ Become a Patreon: / programwithgio
THANK YOU!
🛠️ TOOLS & SERVICES I USE
Digital Ocean Hosting - Get 100$ credit - m.do.co/c/38b935ad74e5
Domains on Namecheap - namecheap.pxf.io/rnRjdQ
Envato Elements - 1.envato.market/c/2937311/298...
LESSON P.37
Starting Source Code - github.com/ggelashvili/expenn...
Ending Source Code - github.com/ggelashvili/expenn...
ChartsJS - www.chartjs.org/
Doctrine Extensions - github.com/beberlei/DoctrineE...
Course Outline - github.com/ggelashvili/learnp...
Course Playlist - • Learn PHP The Right Wa...
** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.
your course helped me put my knowledge in order and get a good job. you are a great teacher
That's awesome, very happy to hear that. Thank you & good job on landing a job
hope to see laravel the right way very soon you are a great teacher thanks alot😀
Yes eagerly waiting for laravel the right way
@@sakthisp107 yes, yes. We want Laravel with Gio 😀
This is in plans, don't have a set date yet though, but we'll see. Want to plan it well ahead of time
8:18
Such channels are few and far between. Your work is highly appreciated!
Thank you so much
What a journey! I've finally caught up with all the lessons uploaded.
Amazing content, created with great dedication and care.
I'm looking forward to what's to come (beyond this course), and I bet it will be great.
A million thanks, Gio, you are a hero.
Awesome job for following along & completing the course. Thank you
You are a great teacher and professional php tutor, I hope for new laravel series. More that grateful Gio
Thank you
Finally cracked all the majors in the exercise Gio. Amazing! I'll look into the extras. Thanks a lot Gio
That's awesome, great job
How long does it take for your page to load with +10.000 transactions?
@@themaridv2000 oh, so sorry, I'm not sure I recall.
This has saved me years. Thanks a lot
You're welcome
thank you very much, you are great teacher and very profesional php series, i wish for more, have a good luck!
Thank you very much
Wonderful 👍. I'll get to it Gio. Thanks alot
Good luck, you're welcome
Wow thanks for all you do
You're welcome
Man! trust me all these series are ruling over all PHP channel, it is blast!!
Thank you 🙌
You are a great teacher and professional php tutor, I hope for new laravel series
Thank you 💙
Amazing.🎉 thanks
You're welcome
So Gio, implemented caching. It was fun. The cache is deleted when a transaction is created or updated. So that a fresh dashboard is generated. Cached pretty much everything so my dash refreshes lightening speed unless something has changed. I wanted to add something to it though... Like to only delete the cache by year as well, since the chart displays data for the given year. So to only delete the data for the year that is being updated. But that seems a bit challenging lol (but doable I believe). Thanks for this lesson and exercise. I'll now move on to check your solutions and learn some more tricks. Thanks for everything Gio
Thats good to hear, you can totally add your own things and caching parts of data makes sense
Thanks!
Thank you for support 🙏
oh my God. i never knew i could get such tutorial for free.. i feel like i have wasted my time following some channels ... thank God i found this channel. i await more and more of your tutorials. i wanna be an expert like you
I assure you your time was not wasted. Many other creators create good quality tutorials. That being said, I'm happy you found my channel, welcome & thank you for the kind words
Wow. Looked at your solutions Gio. Had no idea that DQL/SQL could be utilized like this. Getting the monthly summary that I did with a query and 2 foreach loops you did with just a query. Wow! It appears that your query expects that expenses are saved with negative amounts. I'm setting up your 37_End branch to see how it runs
Yup, we store amounts as is with negative/positive values. So if expenses are stored as negative numbers then doing aggregations becomes a bit simpler.
Finally I’m done with the series 😭😭
Congrats & great job 💙
Congratulations on an outstanding course. I have watched around 80% of all 138 lessons. I have paid many thousands in the past for courses that are nowhere near the quality you bring, superb job! Like a lot of PHP developers, I guess I have been coding PHP "the wrong way" for the last 3-4 years, very vanilla PHP, no frameworks, hardly any 3rd party code, using Apache mod_rewrite for routing, pure PDO for database access etc. I attended this course because I wanted to bring my skills up to date and I can see your resulting code very much follows best practise for OOP. But I can't help but think If I refactored my current codebase it would take a performance hit due to the Frameworks, levels of abstraction and 3rd party libraries? I'd love to know your thoughts.
Thank you so much 💙. If your code works & does what it was intended to do, then I would not bother refactoring it unless of course your budget & time allows. As for performance, yes it may add a slight overhead but I would say framework overhead is usually not the bottleneck of most performance problems. Your database & your queries will be the main cause for concern when it comes to performance optimizations. The benefits of framework is well worth the few milliseconds overhead which can be further improved via other solutions like using Octane for Laravel & so on.
Hi Gio, so I tried the second exercise. At 120k+ transactions, the dashboard (based on the functions I put together in completing the 1st exercise) didn't seem slow (removing the slowness of my own computer). Instead I started experiencing a drag when I visit the transactions page. The page loads quick but the table takes a while to populate. Now it's 240k+ transactions and the transactions table on the transactions page load even slower. Searching through too is slow. How can I optimize that?
Hey, check if there is n+1 problem on transactions page. Other than that the transactions table is expected to be a bit slower especially when searching cause there are no indexes on tables
@@ProgramWithGio Okay Gio, I'll check for N+1 problems. Perhaps I'll read up abit about indexing tables too.
@@ProgramWithGio I made a mistake Gio, my dashboard chart is slow too. Didn't realize it cause I set maxresults at a limit while I was working on it to test something. Having now removed it, the chats too are slow. I'll look into caching now. Thanks Gio
Mehn! Gio! Still looking into the simplicity your query brought into aggregating the data. I'm trying to see how I can apply simplicity to querying for data to a small app I did but I'm finding that the way I structured my data(tables) may not allow for that. I'm seeing how important structuring your data plays into scalability and roburstness of applications. I'm trying to see how I can maybe change the structure of the data... It feels overwhelming lol. Thanks for your lessons Gio
Don't overstress it, do what works for you, my way is not the only way. Your table structure may come in handy for other operations, it all depends on what you are doing & what the goal is. Stick to what you have, don't refactor things unless you have a good reason to do so. Don't just do it because you found someone else did it with fewer lines of code. If your implementation solves the problem & works, stick to it and only refactor if it actually makes sense, otherwise you will find yourself in constant loop of refactoring because there are many ways of doing things and you'll keep finding better ways to do it and further delay the delivery of your product.
@@ProgramWithGio Wow, incredible! What you've said makes so much sense Gio. I'll take it to heart. I had already brought out a chainsaw to start hacking my code. I'll put it away now. Lol. I'll just learn it for the future. 🙏 Thanks a lot Gio
@ProgramWithGio it was very nice course, i have learned alot from this, i also would like to know about your future plans regarding new couerse
i would say looking forward learn javascript the right way or learn python the right way :)
Thank you. Those sound nice but it wouldn't be of same quality as PHP because I don't have such in depth experience with either Javascript or Python as I do with PHP. That being said, I might make course on Javascript later in future tailored towards PHP devs. We'll see.
I saw you answered a previous comment where you have been asked if the completion of this amazing course was enough for landing a junior position. My question is slightly different, here it is: according to you, completing the course properly at which level place a person ? You provided a road map for a mindset and in my opinion that's not anymore a junior position. I'd dare to say that with the proper personality and being a nerd for a while someone could also try to land a middle position. What do you think about it?
If you put in the work & try to build more features on top of this project or build entirely different project on your own yea I would say you could be ready for mid level position as well. It just depends on how much effort one is able to put in. This course should give you a solid background in PHP, picking up a framework like Laravel or Symfony should become a bit easier & having those as skills can get you better jobs in my opinion, so logical next step after this course would be learning one of the popular frameworks like Laravel or Symfony.
I do agree. Thanks a lot for the whole work you did, I learned some that I added alongside what I did already know. Like many others I am waiting for the Laravel one. 🎉 😊
Which video is it where he answered a question about this course being enough to land a junior position? What was his answer?
@@stranger9951 it's not a video, it was a reply to another comment. Pretty much same thing I answered here.
@@stranger9951 I was not talking about junior position to land , if you read once more maybe you will realize that I was talking about approach to coding, middle level position and asked about his opinion about it. In my view totally another question compared to the one where someone else was asking about landing a junior position. Question I personally would never ask cause to me it is pretty visible that he provided a full articulated teaching experience that goes way beyond the standard basics. Live long and prosper.
may i know what font are u sing in you editor?
Standard font that comes with phpstorm
First of all than you for this amazing course. Secondly, I am trying to learn Laravel can you recommend me some good online courses?
Thanks
Laracasts, Code With Dary
is this playlist cover opps concept also ??
You can see the full list of topics in the repository or in the playlist but yes it covers OOP
can you upload a long version of this whole series as one video? it would be great to have everything in just on continious video also then we could download just 1 video and have everything thank you
Not at this time. Also downloading videos doesn't really help the creator fyi
@@ProgramWithGio appreciate your efforts and thanks for this tutorial series but not everybody has access to the internet all the time fyi
Big fan, man. In your code, I see the Auth class is passed to the AuthController constructor from the container using the AuthInterface. How so?
AuthInterface has a binding in container_bindings config file that tells the DI container how to resolve this interface. We covered this earlier in the series
@ProgramWithGio got it 👍. Thanks man.
is the course is finish or more videos are remain?
Finished
waiting for EventDriven PHP tutorials😊
👍👍
Sorry, is this php course over and full knowledge of php? Or is it not over yet?
Yes it's finished
this PHP course is completed???
Almost. One more video left
The end of the beginning
What will begin after this end
Idk, we'll see :)
Please also make playlist on laravel 10. it is humble request to you.
Will start working on that once Laravel 11 releases
@@ProgramWithGio thankyou for your precious reply
Sir how to contact with you in personally please reply
X (Twitter)
@@ProgramWithGio Please mention your Twitter account
You can find it on my channels RUclips page
@@ProgramWithGio Sir I'm from Pakistan not working Twitter if u have Instagram account please mention
please start course about laravel)
Hopefully I'll be able to start soon but cant promise any set dates yet. Going to take a little break first
@@ProgramWithGio thanks gio, though its not your responsibility but your still willing to help us. We really appreciate it
Pls Rest full api
Thanks for the suggestion