Oasis Framework

Follow the instructions here to get setup using Oasis, replacing the text marked in red with information specific to your project.

Once you are done, head on over to the tutorial to learn more about how Oasis works.

Pre-requisites

To install oasis framework you will need some pre-requisites.

Install opam

bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh)"

Install dune

opam install dune

New Oasis Project

You should be ready now to get started with Oasis

The following steps will pull in the starter template and then rename some things to suit your project.

Clone the starter repo

git clone git@github.com:etopiei/oasis.git your_project_name

Setup

cd your_project_name
rm -rf .git
opam install . --deps-only
dune exec setup

Database Setup

Setting up the database can be quite involved, and vary from project to project. If you're not sure how to setup postgres and would like a fast way to get started, run docker with postgres using:

docker run --name oasis-postgres -e \
POSTGRES_PASSWORD=mysecretpassword \
-p 5432:5432 -d postgres

Next you'll need to edit the `db_params` variable in the file bin/config/oasis_conf.ml to point to your postgresql database.
(If you used the docker command the only thing you'll have to change is the password.)

Now with your database details configured you can test the connection and create the database in postgres with:

dune exec migrate create

Run the Server

You're almost ready to go now! Build the frontend with:

dune build lib/webapp/webapp.js

And lastly run the server with:

dune exec your_project_name -w

This will start the server at: http://localhost:8080/index.html
So go check it out!
If all is well, you'll see a welcome screen and from there can start making changes to your project.
If there are any problems, feel free to create an issue on the Oasis github.

Next Steps

From here you can expand the project however you want, if you're unsure how to proceed I'd recommend checking out the tutorial.
Or for general concepts, check out the guide.