A production-ready OCaml Dream web framework template for Railway deployment. This template includes server-side HTML rendering with Tailwind CSS and HTMX, perfect for building modern interactive web applications.
- OCaml with Dream web framework
- Server-side HTML rendering with Dream-HTML
- Tailwind CSS for styling
- HTMX for dynamic interactions
- Docker containerization for consistent deployment
- Production-ready configuration with optimized builds
Deploy this template to Railway with a single click:
- OCaml (install from ocaml.org)
- Opam package manager
- Dune build system
- Clone the repository:
git clone <your-repo-url>
cd railway-dream
- Install dependencies:
opam install . --deps-only
- Build the project:
dune build
- Run the server:
dune exec app
The server will start on http://localhost:8080
Use the provided Makefile for common tasks:
# Start development server
make dev
# Build the project
make build
# Run tests
make test
Build and run with Docker:
docker build -t dream-app .
docker run -p 8080:8080 dream-app
Run the test suite:
dune runtest
├── bin/ # Executable entry point
├── lib/ # Main application code
│ ├── app.ml # Web server and routes
│ └── dune # Build configuration
├── test/ # Test files
├── Dockerfile # Container configuration
├── Makefile # Development commands
└── dune-project # Project configuration
The app is configured for Railway deployment with:
- Environment-based port configuration
- Production-optimized Docker builds
- Automatic dependency management with Opam
This template is available as open source under the terms of the MIT License.