{"id":21038617,"url":"https://github.com/degree9/enterprise","last_synced_at":"2025-09-08T22:44:40.785Z","repository":{"id":24655839,"uuid":"102153007","full_name":"degree9/enterprise","owner":"degree9","description":"D9 Enterprise Platform","archived":false,"fork":false,"pushed_at":"2023-01-23T20:08:29.000Z","size":1700,"stargazers_count":8,"open_issues_count":41,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-25T17:53:40.167Z","etag":null,"topics":["clojure","clojurescript"],"latest_commit_sha":null,"homepage":"http://enterprise.degree9.io","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/degree9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"degree9"}},"created_at":"2017-09-01T21:05:59.000Z","updated_at":"2023-03-01T17:40:07.000Z","dependencies_parsed_at":"2023-02-13T02:45:16.210Z","dependency_job_id":null,"html_url":"https://github.com/degree9/enterprise","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/degree9/enterprise","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/degree9%2Fenterprise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/degree9%2Fenterprise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/degree9%2Fenterprise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/degree9%2Fenterprise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/degree9","download_url":"https://codeload.github.com/degree9/enterprise/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/degree9%2Fenterprise/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260245322,"owners_count":22980191,"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":["clojure","clojurescript"],"created_at":"2024-11-19T13:33:37.478Z","updated_at":"2025-06-16T21:34:53.720Z","avatar_url":"https://github.com/degree9.png","language":"Clojure","funding_links":["https://patreon.com/degree9","https://www.patreon.com/degree9"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"/.github/D9 Enterprise.png\" alt=\"d9enterprise\" width=\"445px\"\u003e\u003c/p\u003e\n\n[![Clojars Project](https://img.shields.io/clojars/v/degree9/enterprise?include_prereleases)](https://clojars.org/degree9/enterprise)\n[![Clojars Project](https://img.shields.io/clojars/v/degree9/enterprise.svg)](https://clojars.org/degree9/enterprise) \u003c!-- [![Dependencies Status](https://versions.deps.co/degree9/enterprise/status.svg)](https://versions.deps.co/degree9/enterprise)--\u003e [![Downloads](https://versions.deps.co/degree9/enterprise/downloads.svg)](https://versions.deps.co/degree9/enterprise) [![Slack][slack]][d9-slack]\n\nA commercially supported ClojureScript platform by Degree9.\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://degree9.io\" align=\"center\"\u003e\n    \u003cimg width=\"135\" src=\"/.github/logo.png\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003cb\u003eD9 Enterprise is developed and maintained by Degree9\u003c/b\u003e\n\u003c/p\u003e\n\n---\n\nThis library is provided as an extension to [degree9/meta](http://github.com/degree9/meta).  \nWhere [meta] only provides the basic application server/client, D9 Enterprise provides a collection of services which can be mounted to server endpoints, as well as helpful service hooks and client components.\n\n## Environment variables\n\nThis library supports nodejs process environment variables and [dotenv](https://github.com/motdotla/dotenv).\n\nThere is a convenience namespace `degree9.env` that inits dotenv and exposes the\nnative nodejs functionality.\n\nSee `.env.example` in the root of the repository for an example that can be\ncopied into place and updated with real secrets.\n\n- `degree9.env/get`: Takes a key and optional fallback value, returns the value,\n  fallback or empty string as appropriate. Accepts keyword and string keys in\n  all casings. e.g.\n  ```clojure\n  (degree9.env/get :home) ; \"/Users/foo\"`\n  (degree9.env/get \"HOME\") ; \"/Users/foo\"`\n  ```\n- `degree9.env/keys`: Returns the list of all available env map keywords.\n\n## CLJS REPL\n\nUsing shadow cljs + node + REPL is the easiest way to develop without including\nand rebuilding `enterprise` as an embedded dependency of some other repository.\n\nWe can't reliably use the browser REPL approach because some code must be\nexecuted in node. For example, the Shopify API doesn't allow CORS, so browser\nbased POST is not an option.\n\nShadow CLJS is being used simply because it seemed to provide what we need and\nI wasn't sure how to setup the equivalent through Boot.\n\nAll the REPL config for shadow is in `shadow-cljs.edn`.\nThe dependencies are being parsed from `shadow-cljs.edn` into `build.boot`.\n\nThe shadow CLJS docs are pretty good:\n\nhttps://shadow-cljs.github.io/docs/UsersGuide.html\n\nThe default shadow cljs config is for `app` and targets `node-script`, but also\ncan support the `browser` target too (the config covers both options).\n\n### Work with nix-shell\n\nNix can provide all the tooling needed to run tests and the repl.\n\nThis is how Circle CI is configured, using the official alpine based NixOS docker box.\n\nIf you don't already have nix-shell then install it:\n\nhttps://nixos.org/nix/download.html\n\n```\ncurl https://nixos.org/nix/install | sh\n```\n\nNix will run `npm install` and set environment variables etc. when entering the shell.\n\nThis includes wrapping `shadow-cljs` so that it appears to be installed globally while in the shell (without installing it globally).\n\nA few nix specific commands are available:\n\n`flush`\n\nDelete all built artifacts and dependencies that may become stale.\n\n```\nnix-shell --run flush\n```\n\n`node-test`\n\nRun all the node tests under the `:node-test` shadow-cljs target.\n\n```\nnix-shell --run node-test\n```\n\n`browser-test`\n\nRun all browser tests with `karma` against a headless firefox against the `:browser-test` shadow-cljs target.\n\nOn linux a copy of firefox will be shipped by nix-shell, on Mac you may need to BYO firefox.\n\n```\nnix-shell --run browser-test\n```\n\n### Install shadow CLJS\n\nShadow CLJS is a dev dependency for npm in this repo.\n\nIt might be easier to install it globally though:\n\n`$ npm install -g shadow-cljs`\n\n### Shadow CLJS + Node + REPL\n\nFirst run `watch` to compile the needed JS file.\n\n`$ shadow-cljs watch app`\n\nThis will start a REPL server, watch files and output to `repl-node/main.js`.\n\nNext, in a new terminal tab, run the compiled file with node.\n\n`$ node repl-node/main.js`\n\nThis will provide the execution context for the REPL, as a browser normally\nwould. All `prn` and console logs will show up here.\n\nFinally, in a new terminal tab, start the CLJS REPL connected to the server.\n\n`$ shadow-cljs cljs-repl app`\n\nThis allows for executing cljs code in the node execution environment.\n\nNote that the `watch` command from shadow cljs WILL reload files dynamically but\ndoes NOT automatically reload the _state_ of namespaces from the perspective of\nthe REPL.\n\nTo reload an already-loaded namespace, use `:reload` or `:reload-all`.\n\nFor example:\n\n`(require 'degree9.repl :reload)`\n\nWould allow edits to `degree9.repl/foo` to appear in the REPL client without\nneeding to stop and start the REPL server.\n\n### Shadow CLJS + Browser + REPL\n\nEdit `shadow-cljs.edn` so that the `:target` for `:app` is `:browser`.\n\nRun the watch command:\n\n`$ shadow-cljs watch app`\n\nThis will output compiled browser-friendly JS files to `repl-public/js/main.js`.\n\nA web server will also be available at `http://localhost:8020`.\n\nOpen a browser (e.g. Chrome) to the localhost web server URL. All `prn` and\nconsole logs will show up here.\n\nIn a new terminal tab, start the browser REPL.\n\n`$ shadow-cljs browser-repl app`\n\nBe careful not to refresh the browser as it can mess with the state of the REPL.\n\nTo reload namespaces, see the node instructions above.\n\n### Shadow CLJS + Testing\n\nShadow CLJS runs tests for us too, but uses the `test` build rather than `app`.\n\nThe node test runner in shadow CLJS does NOT need a standalone node instance\nrunning as it is configured with `:autorun`.\n\n`$ shadow-cljs compile test`\n\nThis only runs once though. The `watch` tool can help, install on Mac OS with\n`brew install watch` and wrap shadow CLJS with it.\n\n`$ watch shadow-cljs compile test`\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.patreon.com/degree9\" align=\"center\"\u003e\n    \u003cimg src=\"https://c5.patreon.com/external/logo/become_a_patron_button@2x.png\" width=\"160\" alt=\"Patreon\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003cb\u003eD9 Enterprise is only supported for Enterprise tier patrons.\u003c/b\u003e\n\u003c/p\u003e\n\n---\n\n[slack]: https://img.shields.io/badge/clojurians-degree9-%23e01563.svg?logo=slack\n[d9-slack]: https://clojurians.slack.com/channels/degree9/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdegree9%2Fenterprise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdegree9%2Fenterprise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdegree9%2Fenterprise/lists"}