{"id":16656454,"url":"https://github.com/xvw/muhokama","last_synced_at":"2025-07-12T22:37:53.100Z","repository":{"id":39578782,"uuid":"447942002","full_name":"xvw/muhokama","owner":"xvw","description":"A simple forum built on top of Dream, Caqti, Omd, Preface, Cmdliner and other useful OCaml libraries","archived":false,"fork":false,"pushed_at":"2023-03-06T14:24:39.000Z","size":513,"stargazers_count":54,"open_issues_count":9,"forks_count":7,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-07-06T11:45:23.373Z","etag":null,"topics":["forum","ocaml","webapp"],"latest_commit_sha":null,"homepage":"https://muhokama.fun","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xvw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-14T11:21:07.000Z","updated_at":"2025-03-04T10:10:17.000Z","dependencies_parsed_at":"2024-10-12T09:57:24.242Z","dependency_job_id":"03d84ea8-fdd3-4979-9a62-9991d415ddc0","html_url":"https://github.com/xvw/muhokama","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xvw/muhokama","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvw%2Fmuhokama","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvw%2Fmuhokama/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvw%2Fmuhokama/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvw%2Fmuhokama/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xvw","download_url":"https://codeload.github.com/xvw/muhokama/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvw%2Fmuhokama/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265066218,"owners_count":23706068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["forum","ocaml","webapp"],"created_at":"2024-10-12T09:57:22.935Z","updated_at":"2025-07-12T22:37:52.739Z","avatar_url":"https://github.com/xvw.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Muhokama\n\n\u003e Muhokama (which means \"_discussion_\" in Uzbek) is a web application that\n\u003e powers a rudimentary forum because Slack, Discord and IRC are, in our opinion,\n\u003e not very suitable for long conversations and message tracking.\n\n## Getting started\n\n**Muhokama** is an [OCaml](https;//ocaml.org) application (`\u003e= 4.13.1`), so it\nneeds [to be installed](https://ocaml.org/learn/tutorials/up_and_running.html).\nAnd for lack of originality the application is based on a\n[PostgreSQL](https://www.postgresql.org/) database (which must be installed and\nproperly configured). For the sake of comfort,\n[GNU/Make](https://www.gnu.org/software/make/) is an optional but recommended\naddiction. (All examples in this tutorial assume that `make` is available).\n\nOnce the repository is locally cloned, go to the root of the project. To locate\nall dependencies at the root of the project (locally) rather than globally,\n[creating a local switch](https://opam.ocaml.org/doc/Usage.html#opam-switch) is\nrecommended:\n\n``` shellsession\nopam update\nopam switch create . ocaml-base-compiler.4.14.0 --deps-only -y\neval $(opam env)\n```\n\nWhen the _local switch build procedure_ is complete you can simply run the\nfollowing two commands to retrieve the project dependencies and to retrieve the\ndevelopment dependencies (the second one is optional):\n\n``` shellsession\nmake deps\nmake dev-deps\n```\n\n### Initialization of the database\n\nAssuming a role has been created for the current user, you can simply issue the\ncommand `make init-database` which will create a user `muhokama` and and ask for\na password to be entered in a prompter, and two databases:\n\n- `muhokama_dev`: the database populated by the development server to test the\n  application locally;\n- `muhokama_test`: the database used for the integration tests.\n\nThe configuration is provisioned by environment variables:\n\n``` sh\nexport POSTGRESQL_ADDON_HOST=localhost\nexport POSTGRESQL_ADDON_PORT=5432\nexport POSTGRESQL_ADDON_DB=muhokama_dev\nexport POSTGRESQL_ADDON_USER=muhokama\nexport POSTGRESQL_ADDON_PASSWORD=muhokama\nexport LOG_LEVEL=debug\nexport POSTGRESQL_ADDON_CONNECTION_POOL=5\n```\n\n### Running integration test\n\nRunning integration tests (with the `make test-integration` command) requires\nthe presence of a `.test_env` file at the root of the project which exports\nenvironment variables specific to running integration tests.\n\n\n### Interaction using `muhokama.exe`\n\nThe main actions are orchestrable via the `muhokama.exe` binary. Once the\nproject is compiled (using, for example, `make build`) it is possible to\ninvoke the tool with `dune exec ./bin/muhokama.exe PARAMS` or `dune exec bin/muhokama.exe\n-- PARAMS`. The second invocation recompiles (if needed) the binary. Each\nsubcommand can display its `man` page using the `--help` flag.\n\n\n#### Basic usage\n- `dune exec ./bin/muhokama.exe` : Display the `man` page of the binary.\n- `dune exec ./bin/muhokama.exe -- server.launch` : Start the application.\n  - `--port X` : Specifies the TCP port on which the server is listening. Defaults to `4000`\n\n#### Database\n- `dune exec ./bin/muhokama.exe -- db.migrate` : Build a migration context and performs missing migrations.\n  - `--to N` : Specifies the target state. Can be behind or beyond the current state.\n\n```\n Given the migration context being 2 and migrations 3 to 5 pending.\n   `db.migrate` will execute migration 3 to 5.\n\n Given the migration context being 5.\n   `db.migrate --to 2` will play `5.down`, `4.down` and `3.down`.\n\n Given the migration context being 0 with migrations 1 to 5 pending.\n   `db.migrate --to 2` will play `1.up` and `2.up`.\n```\n\n- `dune exec ./bin/muhokama.exe -- db.migrate.reset` : Rollback database to state `0`, drop and then create the migration table again.\n\n#### Utilities\n- `dune exec ./bin/muhokama.exe -- user.list` : List all registered users (regardless of their status).\n- `dune exec ./bin/muhokama.exe -- user.set-state` : Update the status of a user.\n  - `-U` : Specifies user uuid. __Required__\n  - `-S` : Specifies user state. Must be one of (`inactive`, ` member`, `moderator`, `admin`). __Required__\n\n### Deploy on clever cloud\n\n1. Create a docker application with a postgreSQL add-on\n2. Add the following environment variable to the docker application\n  - `CC_DOCKER_EXPOSED_HTTP_PORT=\"4000\"`\n  - `POSTGRESQL_ADDON_CONNECTION_POOL=\"5\"`\n\n\u003e \"5\" is the maximum connections for free databases, you can adapt `PGSQL_CONNECTION_POOL` in accordance to the [pool of your plan](https://www.clever-cloud.com/doc/deploy/addon/postgresql/postgresql/#plans)\n\n3. In **Information** of the docker application, check the following options:\n  - Zero downtime deployment\n  - Enable dedicated build instance (Must be minimum S)\n  - Cancel ongoing deployment on new push\n  - Force HTTPS\n\n4. Add a git remote `git remote add clever \u003cDeployment URL\u003e`\n\n5. Push your first deployment `git push clever main:master`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxvw%2Fmuhokama","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxvw%2Fmuhokama","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxvw%2Fmuhokama/lists"}