I'm a software engineer and entrepreneur with a passion for building great software products and promoting a healthy lifestyle. I founded Realhub, a software company that helps real estate agents manage their business more efficiently. When I'm not building software, you can find me in the gym or outdoors, as fitness is a huge part of my life and something that I'm truly passionate about.
I like to experiment with new technologies but am primarily developing applications in Javascript/Typescript with React. When building applications that are expected to scale and make money I use Ruby on Rails as the API paired with a React frontend.
when you query from a database you are not necessarily reading from the disk, the database has an optimization engine and if there are queries that satisfy certain criteria the db will cache stuff in memory. the main reason why people don't use DBs as an in-memory cache is because we usually don't put them in the same machine as the application so the biggest penalty is paid even if the data is held in ram, the penalty of network latency. DHH point is to use sqlite in the same machine until you need to scale the DB or the app itself and thus have the sqlite process hold the db in-memory and you will get very close performance to Redis, enough to satisfy the needs for your app, is not like ruby is capable to squeeze all the juice from Redis to begin with.
Fair points but I don't think they are running basecamp using sqlite, pretty sure it is a MYSQL database. SolidQueue is something they are using internally. The real reason to use something like this is in the beginning stages where you want application and infrastructure complexity to be a minimum. Once you scale it is very easy to swap this out as it uses ActiveJob
We ran separate repos in production and never had any real issues without versioning. I would probably setup the pipeline to deploy API first then the frontend after. Could also use feature flags. I think you can even have these issues when using next.js only - vercel tried to solve but not sure how well it works as I’ve never used that feature.
Hi! Thanks for the video. Why are there empty parentheses in the scopes, you can omit them. If the default sorting by order method is used, :asc can be omitted.
Do you mean the .ordered method? If so, that is a custom method on the model. If you are referring the the scopes in the model, then yes, I could omit empty parentheses - they were probably there for a param and I removed while developing. I like to leave the :asc there for clarity
It's not very clear why you used `return` in the `scope :where_channel_slug`. A simple `if/else/end` would be enough. Please don't take it to heart; these are just minor details. Overall, your videos are very good and helpful. Thank you.
Thanks Ken, good to see some basic React Query stuff, and the auto-generated types from the rails schema was interesting too. Would love to see create, update, delete functionality the React Query way with useMutation.
i dont like solito because we sometimes cant use react native libs directly with it. For example, when in need to use icons, I have to install expo-icons for native and some other icon lib(like react icons) for web
To be honest, not sure. It’s been a convention to use the src directory for many years in js so probably just a preference thing. You can throw all your other directories into src as well, but either way probably works!
@@kengreeff omg, I just knew you so good at programming, i started watching your videos when you were building my4x4, I don't know if you still building it but am so amazed how much knowledge you've got on this field. Any advice for someone like me who's still somewhat a junior?
Find a company where you can learn. Spend your time outside of work building products so you can learn how to setup things from scratch. Enjoy the process and learn to love your craft!
Thanks, Keen. Your tutorials are always incredibly helpful! Could you make a video on optimizing SQL queries for better performance? When working with big data, it's common to encounter situations where code runs fine locally but isn't fast enough in production. I've managed to improve performance by adding indexes and using memoization. I'm confident your tutorial would greatly benefit many Rails developers.
I would probably need an example to work from - would be quite hard to reproduce something locally. It sounds like you are on the right path though, indexes are a great way to get extra performance. You would want to be careful with memoization to avoid stale data but if you are just doing it during the request cycle you should be ok.
Passing the channel slug as a param in a get request is potentially unsafe. As ideas are "children" of channels, maybe you should have nested routes (ideas inside channels). This will ease a few things.
Hey mate, how would having nested routes make it more secure? I am using policy scoping to ensure a user can only see the records/channels/ideas that belong to their org.
@@kengreeff yep - you later mention it in the video, i should have amended my comment 😊 i just try to avoid parameters in get requests as much as possible in general...
Hii Ken , I can see you are doing great,thats is fantastic. But your videos are raw which need some editing to imporve the quality of video, hence it will increase understanding level of any topics you are gonna to discuss on your video. By good and quality editing you can get more views amd genuine subscriber . Let's connect together and spread ourselves. Thankyou Contact:- vikashsorenn@gmail.com
I am just responding with a render :new block in the controller if it fails. The modal re-opens with the errors showing. If you jump on to www.clipflow.co you can see if in action.
How are you displaying on an iphone emulator? Is there a flutter app linked to this ? Awesome content besides. Thanks. If possible, please add stripe payments and subscriptions tutorial on 4x4.
Unfortunately we don’t have anything to charge for at the moment so won’t be adding subscriptions. We are working on new products though and will be adding to them.
I think all I did when rendering the content was to set the editor to readOnly mode using the prop. How fun are crappy docs haha - a nice opportunity to dig in to the docs. Check out the code here: github.com/lockedandlifted/my4x4/blob/main/src/components/Post/Viewer/index.tsx Reach out on X/Twitter: @kennnG if you need any more assistance!
You definitely can but it does increase complexity. It depends on the resources you have on hand. The company we recently sold used react + rails for all our apps. I’m building Clipflow using pure rails and can say that it is much simpler to not have to build an API and the frontend in another tool. When you first build an untested product you want the most speed possible - choose what works for you. You will find that users don’t care about the tech and that marketing/sales is more important :)
Any idea on the corect way to add a canonical tag to the head of a dynamically generated client side component? For example the link is {baseurl}/{lang}/{productId}. would the correct canonical tag be: <link rel="canonical" href={`${url}/${lng}/${productId}`} />
I’m not sure to be honest as I haven’t looked in to it. The features are shared and SEO isn’t really relevant for native apps. You would probably do it in the next/web folder directly
I feel like Tamagui is flat out impossible to customize. I have read the docs over and over again, and still can't make createThemBuilder work. There's always something breaking because of misconfigured relationships between "palette", "template", "parent" and some theme key.
If your using Rails < 7.1, you must use version 2 of the authentication-zero, otherwise you will get an error as "undefined method `generates_token_for' for User:Class" as soon you get to the Sign up page.