I am kind of an amateur at web development (I mostly did linux/embedded professionally), and wanted to do something fun and unique, so I made a website for selling my stock photos as a hobby photographer.
It is built in Common Lisp using Hunchentoot and HSX, very gently integrates it PayPal (this was by far the most painful thing), and uses HTMX to make switching pages smoother.
I am also implementing active search as we speak.
Developing things with Lisp and HTMX interactively was a breath of fresh air, I loved being able to keep around several versions of a function and swap them around at runtime without having to restart.
The fact that Lisp universally speaks s-expressions is also super handy, as I did not have to worry about formats.
(The photo metadata is just serialized to an s-expression, I don't think I will have too many of them to justify sqlite for that).
One thing I did because I am paranoid was adding type signatures everywhere, the serapeum library gives them a nice syntax:
(-> get-image-dimensions (string) (option (cons integer integer))) (defun get-image-dimensions (jpeg-path) "Get image dimensions using ImageMagick identify." (handler-case (let* ((full-path (format nil "files/photos/~A" jpeg-path)) (output (uiop:run-program (list "identify" "-format" "%wx%h" full-path) :output :string :ignore-error-status t))) (when output (let ((parts (split-sequence:split-sequence #\x (string-trim '(#\Space #\Newline) output)))) (when (= (length parts) 2) (cons (parse-integer (first parts)) (parse-integer (second parts))))))) (error () nil)))
All in all, it is a pretty small project, I started it on Friday and just put it live a few hours ago:
-------------------------------------------------------------------------------- Language Files Lines Blank Comment Code -------------------------------------------------------------------------------- Lisp 10 1338 179 14 1145 CSS 1 494 78 0 416 Bourne Shell 1 51 13 3 35 -------------------------------------------------------------------------------- Total 12 1883 270 17 1596 --------------------------------------------------------------------------------
The shell script just creates preview pictures for photos with my watermark.
I am here mostly to look for feedback because I don't like bloated webs, but I also would like to better at making my tiny web more usable :)
I think I am pretty clueless at UX/UI design, so I am glad for any advice, hahaha.
My plan is to clean the source code (I may have kinda been tempted to hardcode some secrets when I was losing my mind over PayPal) and make it opensource within the next few days.
Thanks guys for any feedback, Lukáš Hozda