Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
FROM node:lts AS node
FROM ocaml/opam:debian-10-ocaml-4.14
FROM ocaml/opam:debian-12-ocaml-5.4

USER root

# copy node from node container and link commands
COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node /usr/local/bin/node /usr/local/bin/node
COPY --from=node /opt /opt
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
&& ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
&& ln -s /opt/yarn-v*/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn-v*/bin/yarnpkg /usr/local/bin/yarnpkg

# copy hadolint
COPY --from=hadolint/hadolint:latest-alpine /bin/hadolint /bin/hadolint

Expand Down Expand Up @@ -51,7 +40,7 @@ RUN bash -c 'echo "http 80/tcp www # WorldWideWeb HTTP" >> /etc/services' \
&& bash -c 'echo "https 443/tcp www # WorldWideWeb HTTPS" >> /etc/services'

# link opam version
RUN ln -fs /usr/bin/opam-2.2 /usr/bin/opam
RUN ln -fs /usr/bin/opam-2.3 /usr/bin/opam

USER opam

Expand Down
4 changes: 4 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ There is an `Adminer` container added to the development package. To be able to
1. Uncomment its line in the `.devcontainer/devcontainer.json` under `runServices`
1. Use `Remote-Containers: Rebuild Container` that it will also create and startup the `Adminer` container
1. Open your web browser and open `localhost:8080`

## NOTE

Installation of packages will downgrade `ocaml-compiler` to version `5.3.0` as of `ppxlib` used by `tyxml-ppx` has currently it's upper bound to `< 5.4.0` (PR in progress: <https://github.com/ocaml-ppx/ppxlib/pull/607>)
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
},
"terminal.integrated.defaultProfile.linux": "zsh",
"editor.formatOnSave": true,
"files.insertFinalNewline": true,
"files.associations": {
"*.ml": "ocaml",
"*.mli": "ocaml"
},
"ocaml.sandbox": {
"kind": "global"
"kind": "opam",
"switch": "5.4.0"
Comment thread
mabiede marked this conversation as resolved.
}
},
// Add the IDs of extensions you want installed when the container is created in the array below.
Expand Down
2 changes: 0 additions & 2 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ services:
volumes:
# default user is "opam"
- ..:/workspace:cached
- node_modules:/workspace/node_modules:cached
- opam:/home/opam/.opam:cached
- build:/workspace/_build:cached
- ${HOME}${USERPROFILE}/.ssh:/home/opam/.ssh
Expand Down Expand Up @@ -62,5 +61,4 @@ services:

volumes:
opam:
node_modules:
build:
18 changes: 0 additions & 18 deletions .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,8 @@
set -ex

sudo chown -R opam: _build
sudo chown -R opam: node_modules

opam init -a --shell=zsh

# get newest opam packages
opam remote remove --all default
opam remote add default https://opam.ocaml.org

# TODO: remove pins when the packages are released
opam pin add -yn opium https://github.com/mabiede/opium.git#upgrade-packages
opam pin add -yn rock https://github.com/mabiede/opium.git#upgrade-packages

# install dev dependencies
opam install --yes --with-doc --with-test --deps-only --working-dir .

eval $(opam env)

# install opam packages used for vscode ocaml platform package
# e.g. when developing with emax, add also: utop merlin ocamlformat
make deps

# install yarn packages
yarn
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
- ubuntu-latest
ocaml-compiler:
- 4.14
- 5.3
Comment thread
mabiede marked this conversation as resolved.
- 5.4
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ all:

.PHONY: deps
deps:
opam install -y dune-release merlin ocamlformat utop
opam install -y alcotest-lwt mariadb.1.1.6 caqti-driver-postgresql.2.0.1 caqti-driver-mariadb.2.0.1
opam install . -y --deps-only --locked
opam install --yes --with-doc --with-test --with-dev-setup --working-dir --update-invariant .
eval $(opam env)

.PHONY: create_switch
Expand Down Expand Up @@ -44,7 +42,7 @@ clean: ## Clean build artifacts and other generated files
opam exec -- dune clean --root .

.PHONY: format
format: build ## Format the codebase with ocamlformat
format: ## Format the codebase with ocamlformat
opam exec -- dune build --root . --auto-promote @fmt

.PHONY: sihl
Expand Down
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* [Contact](#contact)
* [Acknowledgements](#acknowledgements)

## About
## About

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

Expand All @@ -44,7 +44,7 @@ Sihl is a batteries-included web framework built on top of [Opium](https://githu

Checkout the [getting started](https://oxidizing.github.io/sihl/sihl/index.html#getting-started) section of the documentation.

If you want to jump into code have a look at the [demo project](https://github.com/oxidizing/sihl-demo).
If you want to jump into code have a look at the [demo project](https://github.com/oxidizing/sihl-demo).

## Background

Expand All @@ -68,43 +68,43 @@ OCaml itself ensures a certain level of correctness at compile-time. In order to

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
* 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.
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 ...

* ... runs fast
* ... compiles fast
* ... 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
The API documentation for the latest version can be found here: <https://oxidizing.github.io/sihl>

## Ecosystem

- https://github.com/uzh/ask
* <https://github.com/uzh/ask>

## Roadmap

Expand All @@ -122,6 +122,6 @@ Distributed under the MIT License. See `LICENSE` for more information.

## Contact

Oxidizing Systems - [@oxidizingsys](https://twitter.com/oxidizingsys) - hello@oxidizing.io
Oxidizing Systems - [@oxidizingsys](https://twitter.com/oxidizingsys) - <hello@oxidizing.io>

Project Link: [https://github.com/oxidizing/sihl](https://github.com/oxidizing/sihl)
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
with import <nixpkgs> { };

mkShell {
buildInputs = [ yarn zlib.dev zlib.out zlib zlib.all gmp gmp.dev pkg-config openssl libev libevdev mariadb-client mariadb-connector-c postgresql ];
buildInputs = [ zlib.dev zlib.out zlib zlib.all gmp gmp.dev pkg-config openssl libev libevdev mariadb-client mariadb-connector-c postgresql ];
LD_LIBRARY_PATH = "${mariadb-connector-c}/lib/mariadb";
shellHook = "eval $(opam env)";
}
Loading