Build a comprehensive website monitoring application with ReasonML, OCaml, and server-reason-react.
Features:
- Real-time website monitoring with HTTP status checks
- Email and webhook alerting system
- Beautiful admin dashboard with Tailwind CSS
- Complete REST API for CRUD operations
- Background monitoring scheduler
- Multi-container Docker setup with 1-core CPU constraint
- PostgreSQL database with Caqti
- Full documentation and setup guides
Tech Stack:
- OCaml 5.0+ with ReasonML
- Dream web framework
- server-reason-react for UI
- PostgreSQL 16 database
- Docker & Docker Compose
Files:
- 9 OCaml source files (1961 LOC)
- 6 documentation files (1603 LOC)
- Complete Docker configuration
- Comprehensive API documentation
💘 Generated with Crush
76 lines
1.5 KiB
Makefile
76 lines
1.5 KiB
Makefile
.PHONY: all build clean test run docker-build docker-up docker-down docker-logs shell
|
|
|
|
# Build targets
|
|
all: build
|
|
|
|
build:
|
|
dune build
|
|
|
|
clean:
|
|
dune clean
|
|
|
|
test:
|
|
dune test
|
|
|
|
run:
|
|
dune exec bin/main.exe
|
|
|
|
# Docker targets
|
|
docker-build:
|
|
docker build -t website_monitor .
|
|
|
|
docker-up:
|
|
docker-compose up -d
|
|
|
|
docker-down:
|
|
docker-compose down
|
|
|
|
docker-logs:
|
|
docker-compose logs -f
|
|
|
|
docker-shell:
|
|
docker-compose exec app bash
|
|
|
|
# Development
|
|
repl:
|
|
utop
|
|
|
|
deps:
|
|
opam install . --deps-only
|
|
|
|
# Formatting
|
|
format:
|
|
ocamlformat -i bin/*.ml lib/*.ml
|
|
|
|
# Lint
|
|
lint:
|
|
ocaml-lint bin/*.ml lib/*.ml
|
|
|
|
# Database reset
|
|
db-reset:
|
|
docker-compose down -v
|
|
docker-compose up -d
|
|
@echo "Waiting for database..."
|
|
@sleep 10
|
|
docker-compose exec app sh -c "echo 'SELECT 1' | psql \$DATABASE_URL"
|
|
|
|
# Help
|
|
help:
|
|
@echo "Available targets:"
|
|
@echo " all - Build the project (default)"
|
|
@echo " build - Build with dune"
|
|
@echo " clean - Clean build artifacts"
|
|
@echo " test - Run tests"
|
|
@echo " run - Run the application"
|
|
@echo " docker-build- Build Docker image"
|
|
@echo " docker-up - Start services with docker-compose"
|
|
@echo " docker-down - Stop services"
|
|
@echo " docker-logs- View logs"
|
|
@echo " docker-shell- Open shell in app container"
|
|
@echo " repl - Start OCaml REPL"
|
|
@echo " deps - Install dependencies"
|
|
@echo " format - Format source code"
|
|
@echo " lint - Run linter"
|
|
@echo " db-reset - Reset database (WARNING: deletes all data)"
|
|
@echo " help - Show this help message"
|