{"id":18686239,"url":"https://github.com/sharetribe/harmony","last_synced_at":"2025-04-12T04:54:25.495Z","repository":{"id":146612389,"uuid":"66255092","full_name":"sharetribe/harmony","owner":"sharetribe","description":"Availability management backend and API for Sharetribe marketplaces","archived":false,"fork":false,"pushed_at":"2020-05-11T12:07:07.000Z","size":224,"stargazers_count":19,"open_issues_count":5,"forks_count":11,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-12T04:54:18.079Z","etag":null,"topics":["availability","calendar","marketplace","rental","service"],"latest_commit_sha":null,"homepage":"https://www.sharetribe.com","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sharetribe.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":"2016-08-22T08:44:35.000Z","updated_at":"2022-11-02T20:50:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc237674-d60e-408d-94eb-ef05eed9fb71","html_url":"https://github.com/sharetribe/harmony","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharetribe%2Fharmony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharetribe%2Fharmony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharetribe%2Fharmony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharetribe%2Fharmony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sharetribe","download_url":"https://codeload.github.com/sharetribe/harmony/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248519472,"owners_count":21117757,"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":["availability","calendar","marketplace","rental","service"],"created_at":"2024-11-07T10:26:44.195Z","updated_at":"2025-04-12T04:54:25.486Z","avatar_url":"https://github.com/sharetribe.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Harmony\n\n[![CircleCI](https://circleci.com/gh/sharetribe/harmony/tree/master.svg?style=svg\u0026circle-token=043fa482e17e0b7a80641714c91b41a6bc0d3a40)](https://circleci.com/gh/sharetribe/harmony/tree/master)\n\n**Harmony is DEPRECATED. Sharetribe Go from [v10.0.0](https://github.com/sharetribe/sharetribe/releases/tag/v10.0.0) implements availability\nmanagement natively.**\n\nAvailability management backend and API for Sharetribe marketplaces.\n\nFor more information about Sharetribe marketplaces and the core marketplace functionalities, see the [main Sharetribe repository](https://www.github.com/sharetribe/sharetribe).\n\nWould you like to set up your marketplace in one minute without touching code? Head to [Sharetribe.com](https://www.sharetribe.com).\n\n### Contents\n\n- [Installation](#installation)\n- [Changelog](#changelog)\n- [Development](#development)\n- [Testing](#testing)\n- [Using in production](#using-in-production)\n- [Deploying](#deploying)\n- [Release](#release)\n- [License](#license)\n\n## Installation\n\n### Requirements\n\n* MySQL 5.7\n* This component is designed to be deployed to [Amazon Web Services (AWS)](https://aws.amazon.com/) using [Docker](https://www.docker.com/) and [Convox](https://convox.com/) but AWS is not a hard requirement.\n\n### Starting a dockerized environment on localhost\n\nThis instruction will describe how to set up a local Harmony API on\nlocalhost on OS X. This is intended for doing development work for\nother services that will rely on and integrate to the Harmony API.\n\n1. Install `docker` and `docker-compose`\n\n  Use latest Docker for Mac: https://docs.docker.com/engine/installation/mac/\n\n1. Clone this repository and checkout the latest version\n\n  ```\n  git clone git://github.com/sharetribe/harmony.git\n  cd harmony\n  git checkout latest\n  ```\n\n1. Create database\n\n  First, start up just the database service. In the project root:\n\n  ```\n  docker-compose up db\n  ```\n\n  Next, create an empty database and run migrations:\n\n  ```\n  echo \"CREATE DATABASE IF NOT EXISTS harmony_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\" | mysql -u root --password=harmony-root -h 127.0.0.1 --port 13306\n  ```\n\n  Then, run migrations:\n\n  ```\n  DB_PORT=13306 lein migrate migrate\n  ```\n\n  (Please note that using a bare password in command line command is insecure. Consider changing the default password.)\n\n1. Start the services\n\n  After the database is set up you can now start the API service:\n\n  ```\n  docker-compose up api\n  ```\n\n  Congratulations! The Harmony API Swagger UI is available at [http://localhost:8085/apidoc/index.html](http://localhost:8085/apidoc/index.html).\n\n  Next time, when the database has been setup you can just run\n  `docker-compose up` to start both services in one go.\n\n  ```\n  docker-compose up\n  ```\n\n1. Exiting\n\n  To stop the service, use either `Ctrl+C` or `docker-compose down`\n\n### Rebuild new code\n\n1. Exit the running container.\n\n  ```\n  docker-compose down\n  ```\n\n1. Pull the newest code and checkout the latest version\n\n  ```\n  git pull\n  git checkout latest\n  ```\n\n1. Rebuild and restart the service\n\n  ```\n  docker-compose build\n  docker-compose up\n  ```\n\n1. Run migrations\n\n  ```\n  DB_PORT=13306 lein migrate migrate\n  ```\n\nFor production use we recommend you to upgrade only when new version is released and **not** to follow the master branch.\n\n\n### Cleaning old docker containers:\n\nIn case the old containers are conflicting somehow with new ones or\nthere is a need to remove old exited containers:\n\n```\ndocker-compose rm -v\n```\n\n## Changelog\n\nSee [CHANGELOG.md](./CHANGELOG.md) for detailed list of changes between releases.\n\n## Development\n\nWhen developing Harmony it often easier to run the service outside\nDocker. In this case, you can still use Docker to run the database. In\nthe development configuration everything is already setup to connect\nto the exposed port of `13306` using the correct root user\npassword. Just run `docker-compose up db`, navigate to user-namespace\nin your favourite REPL client and run `(reset)`.\n\n### Database clean up\n\nThe database service data volume is mounted in the host OS to\n`~/.sharetribe/harmony-mysql-data/`. This means that the database\ncontents are persisted even across removing and rebuilding the MySQL\ndb container. To completely clean up your development database just\ndelete the aforementioned directory in your home directory:\n\n  ```\n  rm -r  ~/.sharetribe/harmony-mysql-data/\n  ```\n\n### Architecture and coding conventions\n\nCheck the conventions for code style and architure: [conventions and structure](doc/conventions_and_structure.md).\n\n## Testing\n\nIntegrations tests (`test/harmony/integration/`) run against a live\nMySQL database and a live web server. By default, the web server is\nsetup to run at `localhost:8086`. It assumes this port is available for\nbinding.\n\nThe default configuration also assumes a MySQL server running at\n`127.0.0.1:13306` (the setup provided in `docker-compose`\nconfiguration). To run the integration tests locally you need to have\nthe docker container for db running. By default, the tests use\n`harmony_test_db` database. The contents of this DB are refreshed after\neach test using the Migratus migrations (`resources/migrations/`).\n\n## Using in production\n\nFor production use, we recommend using [Convox](https://convox.com/) and a proper production-ready database, such as [Amazon RDS](https://aws.amazon.com/rds/). The Harmony Docker container is optimized for development use.\n\nBefore going to production, you need to change secret keys and probably some other configurations, e.g. database server, database username and password and authentication tokens. See [./resources/conf/harmony-api.edn](./resources/conf/harmony-api.edn) for more information about all the possible configurations.\n\n## Deploying\n\n1. Make sure you're using the right Convox rack:\n\n  ```bash\n  convox rack\n  ```\n\n  If you need to change the rack, you can first list available racks:\n\n  ```bash\n  convox racks\n  ```\n\n  ...and then switch the rack\n\n  ```bash\n  convox switch \u003crack name\u003e\n  ```\n\n1. Deploy:\n\n  To list all available apps:\n\n  ```\n  convox apps\n  ```\n\n  Deploy:\n\n  ```\n  convox deploy -f docker-compose.harmony-api.yml -a \u003capp name\u003e --wait\n  ```\n\n1. Run migrations (if needed):\n\n  ```\n  convox run api lein migrate migrate -a \u003capp name\u003e\n  ```\n\n## Release\n\nSee [RELEASE.md](./RELEASE.md) for information about how to make a new release.\n\n## License\n\nCopyright 2017 [Sharetribe Ltd](https://www.sharetribe.com).\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharetribe%2Fharmony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharetribe%2Fharmony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharetribe%2Fharmony/lists"}