Sunday, December 22, 2019

Simple Service

I've been working in CodeIgniter for the past couple of weeks, building a wrist watch library site. It is a great MVC framework. It actually works out of the box and it's simple and straightforward. But...
I really hate web development. The client / server barrier is super annoying, and sadly the one thing I found lacking in CI was calling a controller within a view (Like a sub view), doesn't seem to receive the data in the sub view. It can access the parent view's data, but not its own. So you either have to do full page refreshes, or load everything into the parent which could get out of hand.
I didn't want to use POSTs to interact with the backend, I wanted to allow users to bookmark ANYTHING they were looking at. But this quickly became an absolute nightmare. Finally, it became too much. I was no longer having fun.

I decided to just focus on the database. I started fresh, and this time I'm not over engineering it. Watch attributes are pretty stable. People will be searching for specific case sizes, lug widths, crystal material, etc. So I created a fairly flattened table. This makes it much easier to add items without an admin interface. But MySQL query outputs are not fun when you have a ton of fields in a table. I tried setting the output format to JSON but it was having none of it so I settled for VERTICAL output. But that kept annoying me too. And I really didn't want to just have a DB. That's kind of useless.

I decided to create a web service. I've done a little work on services at work, mainly either C# services or tweaking YAML definitions. But this is all updates to existing solutions. This would be good, building a service from scratch. I would like to do NodeJS, but so far I'm not familiar with free Node hosting. I know PHP/MYSQL hosting is super easy to find and configure etc. I decided to use PHP. So far it is great! there were a few 'head-meet-desk' moments, but now I can search the data and see it in JSON. And when I'm done, other people can leverage my growing watch database.
And so can I!
I probably will at some point.

No comments:

Post a Comment

5 VST Effects I Use in Every Song

VSTs are so great. I have a massive collection of free instruments and FX that I've tracked down. There are SOO many to choose from... B...