{"id":28840532,"url":"https://github.com/dfuenzalida/petclinic","last_synced_at":"2025-10-26T14:04:46.001Z","repository":{"id":299159897,"uuid":"1002227130","full_name":"dfuenzalida/petclinic","owner":"dfuenzalida","description":"Implementation of the Spring Petcinic using Clojure and the Kit Framework.","archived":false,"fork":false,"pushed_at":"2025-07-13T04:19:01.000Z","size":566,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-13T05:27:27.757Z","etag":null,"topics":["clojure","kit-framework","repl","webapp"],"latest_commit_sha":null,"homepage":"","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/dfuenzalida.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2025-06-15T02:00:30.000Z","updated_at":"2025-07-13T04:19:04.000Z","dependencies_parsed_at":"2025-07-13T05:19:59.344Z","dependency_job_id":"dd9d878b-a605-478d-b607-2427be729e55","html_url":"https://github.com/dfuenzalida/petclinic","commit_stats":null,"previous_names":["dfuenzalida/petclinic"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dfuenzalida/petclinic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfuenzalida%2Fpetclinic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfuenzalida%2Fpetclinic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfuenzalida%2Fpetclinic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfuenzalida%2Fpetclinic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfuenzalida","download_url":"https://codeload.github.com/dfuenzalida/petclinic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfuenzalida%2Fpetclinic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281114802,"owners_count":26446046,"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-26T02:00:06.575Z","response_time":61,"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":["clojure","kit-framework","repl","webapp"],"created_at":"2025-06-19T15:09:18.367Z","updated_at":"2025-10-26T14:04:45.996Z","avatar_url":"https://github.com/dfuenzalida.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PetClinic Sample Application\n\nThis petclinic is an implementation of the [Spring Petcinic](https://github.com/spring-projects/spring-petclinic) using Clojure and the [Kit Framework](https://kit-clj.github.io/) with the default modules and trying to stick to its defaults.\n\nI implemented this version to refresh my knowledge of web development in Clojure and the development experience using [Calva](https://calva.io), with an application that was not trivial but not too big either while trying to keep feature parity with the orignal PetClinic as close as possible.\n\n## Highlights\n\n* Written in Clojure with the Kit framework and standard modules (kit-html, kit-sql)\n* Uses Selmer for HTML templates (instead of Thymeleaf on Spring Petclinic)\n  * Custom functions for pagination and i10n/language support (uses the language translation files from Spring Petclinic)\n* SCSS support via [sass4clj](https://github.com/Deraen/sass4clj/) (uses the same SCSS files from the Spring Petclinic with minimal changes)\n* Web assets (Bootstrap/Font Awesome) served with [ring webjars](https://github.com/weavejester/ring-webjars)\n* For simplicity, the only database engine is H2 (e.g. no PostgreSQL, etc.)\n* Spring logo replaced with an awesome emoji-in-SVG logo.\n\n## Requirements\n\n* Java (version 17+ preferred)\n* Clojure ([install guide](https://clojure.org/guides/install_clojure))\n\n**Optional**\n\n* Docker/Podman (to build a container with this app)\n* GNU Make to run the commands from the `Makefile`: `make run`, `make repl`, `make test` or `make uberjar`\n\n\n## Running the Petclinic locally\n\nThe natural way for Clojure development is to start a [REPL](#repls) for this project in your editor or terminal of choice.\n\nStart the server at the REPL with:\n\n```clojure\n(go)\n```\n\nIf you use an editor, after the REPL starts, open the file `env/dev/clj/user.clj` and evaluate the file. Then you can evaluate the expression `(go)` in the file to launch the server.\n\nThe website will be available at http://localhost:3000/ and the default API is available under http://localhost:3000/api\n\nSystem configuration is available under `resources/system.edn`.\n\nTo reload changes:\n\n```clojure\n(reset)\n```\n\n## Building\n\n### Building an Uberjar\n\nRun `clj -Sforce -T:build all` to compile everything into a JAR file which will be created at `target/petclinic-standalone.jar`.\n\nThe resulting JAR file can be run after setting the `JDBC_URL` and `PORT` environment variables:\n\n```shell\nexport JDBC_URL=jdbc:h2:mem:prod\nexport PORT=8080\njava -jar target/petclinic-standalone.jar\n```\n\n### Building and running the app in a container\n\nBuild the container with Docker/Podman:\n\n```shell\ndocker build --pull --rm -f Dockerfile -t petclinic:latest .\n```\n\nTo run the container, remember to provide the JDBC URL and the port, like this:\n\n```shell\ndocker run -it --rm -p 3000:3000 -e PORT=3000 -e JDBC_URL=jdbc:h2:mem:prod petclinic:latest\n```\n\n## Database configuration\n\nThe `dev` and `test` environments use an in-memory H2 Database. For the Prod environment, the JDBC URL of the H2 database needs to be supplied in the `JDBC_URL` environment variable.\n\nTo support other database engines, the following changes are needed:\n\n* Add the JDBC driver dependency in `deps.edn`.\n* Edit the JDBC URLs entries under `:db.sql/connection` in the file `system.edn`.\n* Update SQL DDL/inserts in the migration files using the SQL dialect of choice (these can be borrowed from the [Spring Petclinic files](https://github.com/spring-projects/spring-petclinic/tree/main/src/main/resources/db)).\n* Update the queries in [resources/sql/queries.sql](resources/sql/queries.sql) with the SQL dialect of choice.\n\n## Running the tests\n\nRun `clj -M:test` from the terminal, or use the REPL/Editor integrations to run the tests for a given namespace.\n\nFor running tests on controllers from your editor, you'll want to start the application as mentioned previously.\n\n## Compiling the CSS\n\nYou need to compile the SCSS files at least once to generate CSS files to see the correct styling of the web pages.\n\nDuring development, you can run the following commands in the REPL (e.g. `clj -M:dev`):\n\n```clojure\n(require '[sass4clj.main :as sass])\n(sass/-main \"--source-paths\" \"./resources/scss\" \"-t\" \"./resources/public/css\")\n```\n\nIf you make changes to the SCSS files, you'll need to compile them manually again (there's no watcher installed for them yet).\n\nThe CSS files are automatically compiled when building the uberjar and container image.\n\n\n## REPLs\n\n### Visual Studio Code\n\nUse the [Calva extension](https://calva.io/getting-started/), then follow the instructions on how to [Start a Project REPL and Connect](https://calva.io/connect/).\n\n### Cursive\n\nConfigure a [REPL following the Cursive documentation](https://cursive-ide.com/userguide/repl.html). Using the default \"Run with IntelliJ project classpath\" option will let you select an alias from the [\"Clojure deps\" aliases selection](https://cursive-ide.com/userguide/deps.html#refreshing-deps-dependencies).\n\n### CIDER\n\nUse the `cider` alias for CIDER nREPL support (run `clj -M:dev:cider`). See the [CIDER docs](https://docs.cider.mx/cider/basics/up_and_running.html) for more help.\n\nNote that this alias runs nREPL during development. To run nREPL in production (typically when the system starts), use the kit-nrepl library through the +nrepl profile as described in [the documentation](https://kit-clj.github.io/docs/profiles.html#profiles).\n\n### Command Line\n\nRun `clj -M:dev:nrepl` or `make repl`.\n\nNote that, just like with [CIDER](#cider), this alias runs nREPL during development. To run nREPL in production (typically when the system starts), use the kit-nrepl library through the +nrepl profile as described in [the documentation](https://kit-clj.github.io/docs/profiles.html#profiles).\n\n## License\n\nThis PetClinic application is released under version 2.0 of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfuenzalida%2Fpetclinic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfuenzalida%2Fpetclinic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfuenzalida%2Fpetclinic/lists"}