package sihl

  1. Overview
  2. Docs
The Sihl web framework

Install

Dune Dependency

Authors

Maintainers

Sources

0.3.0.tar.gz
md5=3265ccfac470edc97a524259ec98e15b
sha512=0e6b184d5077a444a0583b65e5b99ba69e798321a34bc99bcc121eb82a3555b86ce8d1c7d3fc6afdcadf87d76f2d903702e5e6252b6b06fd7c1311b712298cc9

Description

Modules for dealing with configuration, service lifecycle, app, CLI commands, logging, random number generation, middlewares and database.

Published: 13 Mar 2021

README

README.md

Logo

A modular and functional web framework
Explore the docs »

Getting Started · Report Bug · Request Feature

Table of Contents

About

Note that even though Sihl is being used in production, the API is still under active development.

Sihl is a batteries-included web framework built on top of Opium, caqti, logs and many more. Thanks to the modular architecture, included batteries can be swapped easily. Statically typed functional programming with OCaml makes web development fun and safe.

Getting Started

The easiest way to get started is by using Spin.

Prerequisites

  • Basic understanding of OCaml

  • Installation of opam

To initialize opam:

opam init

To install Spin, following the instructions here. You can install it using opam:

opam install spin

Create a project

Generate a start project:

spin new https://github.com/oxidizing/spin-sihl.git app

Spin template for project generation.

Visit http://localhost:3000/, you should see the Sihl logo.

Check out the (adjusted) example project. We use that project for testing but the file structure gives you an idea of how a real world project might look like.

Background

Design Goals

These are the main design goals of Sihl.

Fun

The overarching goal is to make web development fun. Fun is hard to quantify, so let's just say fun is maximized when frustration is minimized. This is what the other design goals are here for.

Swappable batteries included

Sihl should provide high-level features that are common in web applications out-of-the-box. It should provide sane and ergonomic defaults for 80% of the use cases with powerful but not necessarily ergonomic customization options for the other 20%.

Ergonomic but safe

OCaml itself ensures a certain level of correctness at compile-time. In order to optimized developer experience, some things are not verified at compile-time but at start-time. Sihl makes sure that your app does not start without the needed configurations and the required environment.

Features

These are some of things that Sihl can take care of for you.

  • Database handling (pooling, transactions, migrations)

  • Configuration (from env variables to configuration services)

  • Logging

  • User management

  • Token management

  • Session management

  • HTTP routes & middlewares

  • Flash Messages

  • Authentication

  • Authorization

  • Emailing

  • CLI Commands

  • Job Queue

  • Schedules

  • Block Storage

Do we need another web framework?

Yes, because all other frameworks have not been invented here!

On a more serious note, originally we wanted to collect a set of services, libraries, best practices and architecture to quickly and sustainably spin-off our own tools and products. An evaluation of languages and tools lead us to build the 5th iteration of what became Sihl with OCaml. We believe OCaml is a phenomenal place to build web apps.

Thanks to OCaml Sihl is ...

  • ... runs fast

  • ... compiles fast

  • ... is pragmatic and safe

  • ... is fun to use

Documentation

The API documentation for the latest version can be found here: https://oxidizing.github.io/sihl

Roadmap

Our main goal is to stabilize the service APIs, so updating Sihl in the future becomes easier. We would like to attract contributions for service contributions, once the framework reaches some level of maturity.

Contributing

Check out the Contributing guidelines.

License

Copyright (c) 2020 Oxidizing Systems

Distributed under the MIT License. See LICENSE for more information.

Contact

Oxidizing Systems - @oxidizingsys - hello@oxidizing.io

Project Link: https://github.com/oxidizing/sihl

Dependencies (23)

  1. caqti-lwt >= "1.2.0" & < "2.0.0~"
  2. caqti >= "1.2.1" & < "2.0.0~"
  3. opium >= "0.20.0"
  4. ppx_sexp_conv >= "v0.13.0" & < "v0.16.0"
  5. ppx_fields_conv >= "v0.13.0"
  6. uuidm >= "0.9.7"
  7. jwto >= "0.3.0"
  8. safepass >= "3.0"
  9. caqti >= "1.2.1" & < "2.0.0~"
  10. lwt_ssl >= "1.1.3"
  11. uuidm >= "0.9.7"
  12. ssl >= "0.5.9"
  13. tls >= "0.11.1" & < "1.0.0"
  14. ppx_deriving_yojson >= "3.5.2"
  15. yojson >= "1.7.0"
  16. sexplib >= "v0.13.0"
  17. fmt >= "0.8.8"
  18. logs >= "0.7.0"
  19. containers >= "2.7"
  20. tsort = "2.0.0"
  21. conformist >= "0.1.0" & < "0.3.0"
  22. ocaml >= "4.08.0"
  23. dune >= "2.7"

Dev Dependencies (3)

  1. odoc with-doc
  2. alcotest-lwt >= "1.2.0" & with-test
  3. cohttp-lwt-unix >= "2.5.4" & with-test

Used by (6)

  1. sihl-cache = "0.3.0"
  2. sihl-email = "0.3.0"
  3. sihl-queue = "0.3.0"
  4. sihl-storage = "0.3.0"
  5. sihl-token = "0.3.0"
  6. sihl-user = "0.3.0"

Conflicts

None

OCaml

Innovation. Community. Security.