Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lessp/ocaml-dream-mvc
https://github.com/lessp/ocaml-dream-mvc
Last synced: 30 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lessp/ocaml-dream-mvc
- Owner: lessp
- License: mit
- Created: 2024-06-01T17:03:51.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-07T18:26:54.000Z (5 months ago)
- Last Synced: 2024-06-08T15:07:23.239Z (5 months ago)
- Language: Reason
- Size: 44.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OCaml MVC
This is a simple example of a blog application using the Model-View-Controller (MVC) design pattern in OCaml.
## Getting Started
To run the application, you need to have OCaml installed on your machine. You can download OCaml from the [official website](https://ocaml.org/docs/install.html).
After installing OCaml, you can run the following commands to build and run the application:
> Note: Environment variables `DATABASE_URI` must be set to connect to a PostgreSQL database.
```bash
opam install . --deps-only --yes
dune build --profile=release
dune exec src/main.exe
open http://localhost:3000
```## Technologies
- **Server**: [Dream](https://aantron.github.io/dream/)
Dream is a web framework for OCaml that is designed to be easy to use, fast, and secure.
- **SQL**: [Caqti](https://github.com/paurkedal/ocaml-caqti)
- **Templating**: [`Html_of_jsx`](https://github.com/davesnx/html_of_jsx/)
`Html_of_jsx` is a library to convert JSX to HTML in OCaml. See [views](./src/views) for examples.
## File Structure
- [`src/Main.ml`](./src/Main.ml): The entry point of the application.
- [`src/controllers`](./src/controllers): Contains the controllers for the application.
- [`src/models`](./src/models): Contains the models interacting with the database.
- [`src/views`](./src/views): Contains the views for the application.
- [`src/types`](./src/types): Contains the types for the application.## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.