A Lightweight OCaml Webapp Tutorial (Using Opium, Caqti, and Tyxml)

The tutorial is hosted on gitlab pages, out of this repository.

I put this together in response to some requests for introductory material on the topic (here and on /r/ocaml. I don’t have much expertise to offer in this area, but I had hacked together some simple servers based on Opium in the past few months, so it seemed like I should be able to memorialize some of what I learned for the benefit of others. I received some critical guidance by the Opium maintainers, rgrinberg and anuragsoni, and from other resources online (mentioned at the end of the tutorial).

Any feedback or improvements are welcome: this is my first time writing such lengthy instructional material, and I’m sure there’s lots of room to make it better.

30 Likes

Skimmed through this and bookmarked to go back later. Looks great! Thanks for putting this together.

1 Like

We definitely need more tutorials, and yours looks good!

Maybe using SQLite could lower the setup requirements, if it’s possible.

2 Likes

I agree that would be a helpful simplification! I have a todo item in the project notes org file to implement a SQLite backend. I’ll see if I get time to make it happen :slight_smile:

1 Like

You might want to check the type-safe ORM then - Sequoia. It supports both PostgreSQL (along with MySQL) and SQLite.

2 Likes

Fantastic clarity and presentation. Thank you for creating this!

1 Like

Thanks very much for the encouragement @nick!

I was quite worried that the material was too verbose (but hoped that the indexes and table of contents would still help people find what they needed out of it). I’m very glad to hear that (at least) one person finds the exposition clear enough to be helpful.

2 Likes