ethanthoma / ocaml-webserver

My personal website written using the HOT stack!

Home Page:https://www.ethanthoma.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logo
Blog and Personal Website

🤖 Stack

Tech Stack
Htmx Frontend
Ocaml & Reason Backend
Turso w/ Go Database

🚀 Building + Running

The nix flake has two build targets:

  1. dune project derivation: produces a binary that one can run as is
  2. docker image: produces a minimal image that contains the derivation

The derivation can be built with nix build and the image can be built with nix build .#docker.

You can run it easily (assuming you have docker setup) with make run. If you want to clean up afterwards, use make clean.

🧮 Complications

It uses Ocaml for the webserver and Reason for templating. I opted to use Turso for the DB but the client support for Ocaml is poor. So, I compiled Go to C and use Dune to bind the C code to Ocaml...probably not the best idea but it does work. Nix is used to build the code and with GitHub workflows, it gets deployed. Locally, I test using the Makefile. This will let you easily run and clean.

About

My personal website written using the HOT stack!

https://www.ethanthoma.com/

License:MIT License


Languages

Language:CSS 50.9%Language:OCaml 15.5%Language:Reason 13.9%Language:Nix 6.8%Language:Go 6.2%Language:JavaScript 3.8%Language:Shell 1.5%Language:Makefile 1.4%