Fishr
- PHP
- CodeIgniter 4
- MIT
- https://git.sr.ht/~zpm/fishr
Fishr is a simple little app for tracking sea life sightings.
In doing my Masters degree, I used Laravel for writing simple backends while doing web dev coursework. I like Laravel, but it feels very big, especially for something that isn’t going to be an entire SaaS or B2C startup. The documentation for Laravel says it was inspired by CodeIgniter, so I decided to use that instead.
I hoped that I would find that CodeIgniter::Laravel : Flask::Django
; that is,
a simpler implementation of a web server without batteries included. That is
mostly the case, which is nice.
Coming from Django and Laravel for a long time, boy howdy it sure is wild to be this close to the SQL. I love SQL, but high-level frameworks seem to be very scared of it, and try to abstract as much of it away from you as you can. There’s definitely something very lovely about Django’s simple
species = Species.objects.all()
But dealing with ‘annotations’ and so on can be annoying, especially if you know the underlying SQL is very easy.
CodeIgniter sure doesn’t pull any punches on that. Dealing with the ID columns
directly is always a pain, but there’s something very delightful about saying,
“I need to left join the sightings
table with the species
table to get the
species’ common name” and the code ending up as:
<?php
$sightings = $model->select('sightings.*, species.common_name')
->join('species', 'species.id=sightings.specied_id')
->orderBy('id', 'desc')
->findAll();
Especially for someone like me who spends and has spent a lot of time writing queries, it’s nice to just put the SQL together exactly how you know you should.