NestJs, TypeORM and MySQL

I have been using Nest with MySQL. As ORM I used TypeORM for every project. But definetly I've hit some road blocks on TypeORM and MySQL. I think TypeORM is the best choice for ORM in node as world as of now , but apparently if you use JSON column for…

NestJs validation constraints

If you're coming from Laravel, you're probably used to simple validation rules that ease developers life with confirmed rule. On NestJs there is no such rules. On top of that to make NesJs more flexible it uses class-validator package which you can add to your project by running npm install…

Laravel Valet 504 Gateway Time-Out

I recenly started gettting 504 from Laravel app using valet had some issues while debugging it. Basically it boils down to NGINX. Add these values to your proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600; fastcgi_read_timeout 300; fastcgi_buffers 8 128k;…

PHP find array key recursively

Today I had an issue where I needed to find a key in multidimensional array. It took trial and error ant some googling around, but this is what I found. <php function recursiveFind(array $haystack, $needle) { $iterator = new RecursiveArrayIterator($haystack); $recursive = new RecursiveIteratorIterator( $iterator, RecursiveIteratorIterator::SELF_FIRST ); foreach ($recursive…

NestJs Microservice exception handling

Microservices is this concept of breaking up a monolyth into a smaller pieces to make project more manageable. But todays tip is about how to handle errors in NestJs microservice architecture. For an example lets use Redis as a proxy between other microservices instead of letting each microservice talk to…

SwiftUI or UIKit for a new project

Pick one or the other is a tricky question.  If a project is planned for a long term go with UIKit/AppKit. SwiftUI is a hot new thing right now and I think it needs to bake a cycle or two to stabilize, there will be changes and best practices…