{"id":20530120,"url":"https://github.com/ezmiller/datemo","last_synced_at":"2025-07-09T16:04:27.567Z","repository":{"id":141689547,"uuid":"81066285","full_name":"ezmiller/datemo","owner":"ezmiller","description":"A restful server for document trees using datomic and clojure.","archived":false,"fork":false,"pushed_at":"2019-01-11T20:10:58.000Z","size":124,"stargazers_count":3,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T02:23:33.760Z","etag":null,"topics":["datomic"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ezmiller.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-02-06T08:44:39.000Z","updated_at":"2023-03-10T00:23:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"7e46e5a3-b64d-42ee-849a-ab9b7ff8b256","html_url":"https://github.com/ezmiller/datemo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ezmiller/datemo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezmiller%2Fdatemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezmiller%2Fdatemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezmiller%2Fdatemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezmiller%2Fdatemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ezmiller","download_url":"https://codeload.github.com/ezmiller/datemo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezmiller%2Fdatemo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264492322,"owners_count":23617027,"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":["datomic"],"created_at":"2024-11-15T23:35:29.622Z","updated_at":"2025-07-09T16:04:27.518Z","avatar_url":"https://github.com/ezmiller.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# datemo\n\n## Getting Datomic Server Running\n\n1. Datemo relies on [Datomic Cloud](https://docs.datomic.com/cloud/index.html). In order to run in\neven in development you will need to have set up a Datomic Cloud instance (see [here](https://docs.datomic.com/cloud/setting-up.html)).\n\n2. Once you have a Datomic Cloud instance setup on AWS, you will need to run the SOCKS proxy. The script provided by\nDatomic is located in the root directory of this repository. Run it as follows:\n```\n./datomic-socks-proxy -p \u003caws-region\u003e \u003cdatomic cloud stack name\u003e\n```\n\n3. Now that the Datomic database should be reachable, you can start the datemo server:\n\n```\nlein ring server \u003cport-number\u003e\n```\n\n4. (optional) If you want to use the repl to access the db:\n```\nrlwrap bin/repl\n```\n\n## To run Datemo to test Production\n\nAssuming the transactor is already running on AWS:\n\n1) Build the jar files with:\n```\nlein ring uberjar\n```\n\n2) Run the following command, adding the AWS keys:\n```\njava -Ddatabase.db-name=\"production\" -jar target/datemo-\u003cversion#\u003e-standalone.jar\n```\n\n## Notes on Deployment\n\nCurrently, I'm running this instance using Docker and AWS. So the deployment has two steps:\n1. Deploy the datemo server (its clojure jar file) and run in connection with a web server\nusing Docker.\n2. Deploy a transactor to AWS using the Datomic tools for deploying via Cloud Formation.\n\n### Deploying the Datemo Server\n\nThe Datemo server is currently deployed using the a Docker stack. See the `docker-compose.yml` file\nin the project root for the configuration. \n\nTo start the stack you first need to set up the swarm, if it is not already initialized:\n\n```\ndocker swarm init --advertise-addr \"\u003cip of host\u003e\"\n```\n\nThen to run the containers on the stack, we can use the config specified in `docker-compose.yml`:\n\n```\ndocker stack up -c docker-compose.yml datemo\n```\n\nTo stop it:\n\n```\ndocker stack rm datemo\n```\n\nTo see what is running in the stack do:\n\n```\ndocker ps\n```\n\nTo inspect the logs for one of the processes do:\n\n```\ndocker logs \u003cprocess-name, e.g. \"datemo_web.1.myrooeb6ifz71p00bebftgof6\"\u003e\n```\n\n**Note:** The `VIRTUAL_HOST` setting in `docker-compose.yml` needs to point to the IP of the\nAWS instance where the transactor is running, i.e. the instance that is started when deploying\nthe cloud formation in step #2.\n\n### Deploying a transactor to AWS\n\nHere's a [video](https://www.youtube.com/watch?v=wG5grJP3jKY) that covers the basic process, and here's a [link](http://docs.datomic.com/aws.html) that does the same. None of this documentation is particularly up to date, but it gives the basic idea.\n\nHere is another overview of the steps needed:\n\n1. Create a cloud formation template `.properties` file. Copy the basic template from the\ndatomic `/config/samples` folder. Set your instance type (e.g. `c3.large` or `m3.medium`).\nA list of possible instances can be found by looking at the JSON template file that is generated\nat the end of this process.\n\n2. Create an \"ensured\" cloud formation propreties file by running `bin/datomic ensure-cf`. This\nlooks like this:\n    ```\n    bin/datomic ensure-cf /path/to/your-cf.properties /target/path/to/your-cf-ensured.properties\n    ```\n\n3. Create the cloud formation JSON template:\n    ```\n    bin/datomic create-cf-template /path/to/dynamodb-transactor.properties /path/to/ensured-cf.properties /output/path/to/cf.json\n    ```\n\n4. Once these steps have been concluded, you should have a workable cloud formation template file.\nTo deploy the cloud formation, you can do the following:\n\n    ```\n    bin/datomic create-cf-stack us-east-1 DatomicTransactor /path/to/cf.json\n    ```\n\n5. If you need to delete the stack, do:\n\n    ```\n    bin/datomic delete-cf-stack us-east-1 DatomicTransactor\n    ```\n\n## Rebuilding Docker Image for new version\n\n1. Make sure you've updated the version in `project.clj`.\n2. Build the new jar files by doing: `lein ring uberjar`.\n3. Update the .jar file specified in the `Dockerfile` and in `docker-entrypoint.sh`.\n4. Build the new docker image:\n    ```\n    docker build --rm -t ezmiller/datemo:latest -t ezmiller/datemo:\u003cversion\u003e .\n    ```\n5. Push both latest and the new version to the Docker Hub:\n    ```\n    docker push ezmiller/datemo:lates\n    docker push ezmiller/datemo:\u003cversion\u003e\n    ```\n6. Now you can do `docker pull` of latest on server and redeploy stack. E.g.:\n```\ndocker pull ezmiller/datemo:latest\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fezmiller%2Fdatemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fezmiller%2Fdatemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fezmiller%2Fdatemo/lists"}