Insane Hydraulics

Site theme image

Coil Finder App Notes

So, I did some brushing up on my backend skills by binge-watching Net Ninja's "Laravel 11 for Beginners" and then Laracasts' "30 Days to Learn Laravel" (both of which are awesome), and then put together this super-basic page that allows you to search for solenoid coils by arbitrary parameters and even mark them with personal searchable tags (available if you register, which is completely free). This post contains a few comments about this app.

Information

Please bear in mind the fact that this is a hobby-grade project built by a self-taught hack whose main occupation has nothing to do with coding. This essentially means that it is not impossible for me to do things like dropping a complete user database "by accident." All I can do is promise that I will do my best not to do that.

The search. I just want to give you one quick example using the "strange coil" that I described the other day. Each coil record has a part number and some optional notes. For that coil, I included a note "A4VG" to indicate that it is used in Rexroth A4VG pumps. So, if you start typing "a4vg" in the search field, you will immediately see all the records that have this string (at this point, there is only one record). Then, if you press the "view" button, you will be able to visualize more details, including additional pictures of the coil. Try it out!

Your email. Naturally, if you register, I get your email. What will I do with it? I won't spam - I can promise you that. I may send you a thank-you note or maybe a personal email at some point. Also, if I have news that might be important or interesting to folks related to industrial hydraulics, I might add your email to the list of recipients. Note that you don't need to register to search for coils - you only need to register if you want to add tags to coils. So, if you are not comfortable with sharing your email, you can still use the search function without registering.

Your tags. They are personal, and you are the only one who can see them - other users cannot. However, as an admin, I do have unrestricted access to the database, which means that I can see them. That is, if I want to - and I cannot really see why I would want to do that - however, I think that you should avoid using "sensitive" information when you tag coils.

Coil records. At this point, I have parsed some catalogs and added some coils manually, but I will be filling the database "as I go." If there is a coil record that you would like to add or perhaps a catalog to include in the database, please send me an email.

App Structure

Just some information in case you wonder how I built this "marvel." The Coil Finder was composed with Laravel 11 (I used version 11 because of the Softaculous installer, which can install the framework in a single click - given the fact that this blog is on shared hosting, it was the most painless option). The authentication is based on the Breeze package, and the dynamic search is provided by Livewire.

It is truly amazing what modern frameworks can do. You can create a page with fully functional (albeit basic) authentication in less than 10 minutes. I know that in this day and age, when AIs create full-blown apps from a single prompt, this may not sound like a big deal, but in my head, it totally is!

The app is installed in a subfolder on a shared hosting account, so I am not sure how well it will perform should multiple users access it at the same time. If you find that the search is laggy, please do tell.

AI Catalog Parsing

As I already explained in the motivation post, I wanted to figure out how to use AI to parse catalogs for coil data. It turns out that this is actually very simple - all you need is an API key (I used the Google's Gemini 2.5-flash, which currently allows for 20 daily requests in its free tier, which is more than enough for this project) and a form to send out the PDF file along with a custom prompt that contains detailed explanation of the data structure that you want to receive.

I can state that Gemini is... well... not too bad at parsing catalogs, but it is one of those things that most definitely requires a "man in the middle." Here is how I tackled this: when the AI returns a bunch of coil records, they fill a staging table which I can review and correct as necessary before committing the data to the database. It still saves me from doing all the typing, but AI definitely makes occasional mistakes. Still, the ease with which the AI chews through a file and spits out over a hundred almost-perfect records is scary. If they ever invent robots that can wield wrenches like humans do, we are screwed!

I also noticed that when I tried to parse the same catalog several times in a row, I would get a set of perfect results followed by a set of completely incorrect (almost hallucinated) data. It was almost as if a second request to parse exactly the same file with exactly the same prompt was treated by the AI as a confirmation that the previous results were unsatisfactory, causing it to dish out a set of values that were "different for the sake of being different." I didn't have time to investigate further, but I did include an option to store the "parsings" to be able to select (or not lose) the best one.

Conclusion

This was an interesting project, and it was the first time I used an AI in an app, which was quite educational. In the end, I got what I wanted - my own database of coil records that I can access from anywhere, edit at will, and search through with ease. Please feel free to use it, and if you have any suggestions or ideas on how to make it better, do not hesitate to share them with me.