{"id":26022978,"url":"https://github.com/agrison/hello-clj-clever-cloud","last_synced_at":"2025-10-29T15:41:28.618Z","repository":{"id":42403489,"uuid":"61868118","full_name":"agrison/hello-clj-clever-cloud","owner":"agrison","description":"Sample clojure app running on clever-cloud","archived":false,"fork":false,"pushed_at":"2016-06-24T11:20:34.000Z","size":9094,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-06T10:43:04.997Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/agrison.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-24T08:05:02.000Z","updated_at":"2016-06-24T08:05:34.000Z","dependencies_parsed_at":"2022-09-05T12:10:40.610Z","dependency_job_id":null,"html_url":"https://github.com/agrison/hello-clj-clever-cloud","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/agrison/hello-clj-clever-cloud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fhello-clj-clever-cloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fhello-clj-clever-cloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fhello-clj-clever-cloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fhello-clj-clever-cloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agrison","download_url":"https://codeload.github.com/agrison/hello-clj-clever-cloud/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrison%2Fhello-clj-clever-cloud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281650117,"owners_count":26537952,"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","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-03-06T10:37:40.096Z","updated_at":"2025-10-29T15:41:28.583Z","avatar_url":"https://github.com/agrison.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sample Clojure webapp running on clever-cloud\n\n## Why?\n\nThere is no official `clojure` \u0026 `leiningen` support at the moment on clever-cloud, even if I'm sure that this is totally on track? 😃.\n\nBut it's really easy to achieve it by building locally (or Jenkins or whatever) and using the [JAR deployement support of clever-cloud](https://www.clever-cloud.com/doc/java/java-jar/).\n\n## Prerequisites\n\nYou will need Java and Leiningen installed on your machine, but if you are already a fan of Clojure, you got this covered.\n\n## Create the application\n\n### Bootstrap\n\n    lein compojure new app\n\n### Edit the app\n\nThen just for fun, bump some versions, in order to use bleeding edge state-of-the-art fully unicorn-approved awesome technology.\n\nEdit **project.clj**:\n\n```clojure\n(defproject app \"0.1.0-SNAPSHOT\"\n  :description \"FIXME: write description\"\n  :url \"http://example.com/FIXME\"\n  :min-lein-version \"2.0.0\"\n  :dependencies [[org.clojure/clojure \"1.9.0-alpha5\"]\n                 [compojure \"1.5.1\"]      \n                 [ring/ring-defaults \"0.2.1\"]\n                 [ring/ring-jetty-adapter \"1.5.0\"]   \n                 [ring \"1.5.0\"]]                     \n  :plugins [[lein-ring \"0.9.7\"]]\n  :ring {:handler app.handler/app}\n  :profiles\n  {:dev {:dependencies [[javax.servlet/servlet-api \"2.5\"]\n                        [ring/ring-mock \"0.3.0\"]]}}\n  :main app.handler)\n```\n\nWe will need a standalone JAR, in order to do that, our `handler` namespace needs to generate a Java class using `(:gen-class)` and we need a `main` method that starts jetty on port `8080` (default port for a clever-cloud application).\n\nEdit **src/app/handler.clj**:\n\n```clojure\n(ns app.handler\n  (:gen-class)\n  (:require [compojure.core :refer :all]\n            [compojure.route :as route]\n            [compojure.handler :as handler]\n            [ring.adapter.jetty :as jetty]]))\n\n(defroutes app-routes\n  (GET \"/\" [] \"Hello World\")\n  (route/not-found \"Not Found\"))\n\n(def app\n  (handler/site app-routes))\n\n(defn -main [\u0026 args]\n  (jetty/run-jetty app {:port 8080}))\n```\n\n### clever-cloud specifics\n\nAs explained on the clever-cloud docs regarding JAR deployment, add a `jar.json` file to the `clevercloud/` directory:\n\n    cat \u003c\u003cEOF \u003e clevercloud/jar.json\n    {\n      \"deploy\": {\n        \"jarName\": \"target/app-0.1.0-SNAPSHOT-standalone.jar\"\n      }\n    }\n    EOF\n\nThat way, clever-cloud knows what JAR to deploy \u0026 run.\n\n### That's it\n\nYes, that's all there is to it.\n\n## Build\n\n    lein uberjar\n    # add the jar to repository\n    git add -f target/app-0.1.0-SNAPSHOT-standalone.jar\n    git push -u origin master\n\n## clever-cloud\n\nGo sign-in or create an account on [clever-cloud](https://clever-cloud.com) then load your personal dashbord.\n\n### Add an application\n\n![](tutorial/1-add-application.png)\n\n### Create an application from a Github repository\n\n![](tutorial/2-add-github-application.png)\n\n### Select `Java + Maven`\n\n![](tutorial/3-select-java-maven.png)\n\nNewly created java applications run on java 8 by default.\nYou can set the java version with the `JAVA_VERSION` environment variable.\n\n### Edit the instance (if you want)\n\nBy default it will select an XS instance, for such a hello world application, I will select a pico instance.\n\nClick the **EDIT** button:\n![](tutorial/4-edit-instance.png)\n\nClick the **pico** circle button, then **NEXT**:\n![](tutorial/5-select-pico.png)\n\n### Create the application\n\nClick the **CREATE** button:\n![](tutorial/6-click-create.png)\n\n### Select your addons\n\nFor this simple hello world app I click **I DON'T NEED ANY ADD-ON**:\n![](tutorial/7-no-addon.png)\n\n### Start the application\n\nClick the play button under **This app is currently stopped**:\n![](tutorial/8-start-app.png)\n\nThen click the **read logs** link above that pretty little orange circle:\n![](tutorial/9-read-logs.png)\n\n### Wait for the build to success\n\n![](tutorial/10-build-success.png)\n\n### Wait for the app to deploy\n\n![](tutorial/11-deploy-success.png)\n\n### Check that the application is UP\n\nIf you can see that little comforting green circle:\n\n![](tutorial/12-app-is-up.png)\n\n### Open the application\n\nClick that **Open the application** button:\n![](tutorial/13-open-app.png)\n\n### Profit!\n\nYou're awesome.\n![](tutorial/14-profit.png)\n\n## Downside\n\n- The uberjar can become large.\n- You have to build locally and push that artifact.\n\nHopefully clever-cloud will support clojure and leiningen soon enough? 😃\n\n## Disclaimer\n\nI'm not at all affiliated with clever-cloud even if I find [@waxzce](https://twitter.com/waxzce), [@clementd](https://twitter.com/clementd) and the rest of the clever-cloud team totally awesome for what they have built so far 😎 \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrison%2Fhello-clj-clever-cloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagrison%2Fhello-clj-clever-cloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrison%2Fhello-clj-clever-cloud/lists"}