{"id":15010414,"url":"https://github.com/dvingo/dv.fulcro-template","last_synced_at":"2025-04-09T18:33:48.499Z","repository":{"id":49037231,"uuid":"267749400","full_name":"dvingo/dv.fulcro-template","owner":"dvingo","description":"Fulcro full stack application template using clj-new","archived":false,"fork":false,"pushed_at":"2022-09-03T17:58:17.000Z","size":144,"stargazers_count":38,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-18T16:55:50.237Z","etag":null,"topics":["clj","clj-new","cljs","fulcro"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvingo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-29T02:45:39.000Z","updated_at":"2024-08-19T15:28:55.000Z","dependencies_parsed_at":"2022-09-20T08:21:22.069Z","dependency_job_id":null,"html_url":"https://github.com/dvingo/dv.fulcro-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvingo%2Fdv.fulcro-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvingo%2Fdv.fulcro-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvingo%2Fdv.fulcro-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvingo%2Fdv.fulcro-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvingo","download_url":"https://codeload.github.com/dvingo/dv.fulcro-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248088181,"owners_count":21045661,"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":["clj","clj-new","cljs","fulcro"],"created_at":"2024-09-24T19:34:07.548Z","updated_at":"2025-04-09T18:33:48.468Z","avatar_url":"https://github.com/dvingo.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fulcro app template\n\n[![Clojars Project](https://img.shields.io/clojars/v/dv.fulcro-template/clj-template.svg)](https://clojars.org/dv.fulcro-template/clj-template)\n\nA Clojure tools.deps template for quickly creating a fulcro application.\n\nThis is a work in progress and reflects one style of app layout.\n\nFeel free to remove or change any parts of the generated code.\n\nIt was based on the fulcro3 template: https://github.com/fulcrologic/fulcro-template\nbut differs in backend tech and will continue to diverge as features are added to this template.\n\n## Tech Stack\n\n- Fulcro\n  - Dead code elimination of guardrails (expound and pprint) during release builds.\n  - reagent rendering middleware of fulcro components.\n- styling with cljs-emotion with two example themes\n- shadow-cljs clojurescript compiler    \n  - frontend config via shadow.resource/inline\n- malli with custom registry on the client\n- reitit for URL routing, can be used with malli for parameter coercion\n- pathom 2.4.0\n- pedestal web server using jetty\n- XTDB database\n  - uses single rocks-db node in dev\n  - uses in memory node during testing\n  - uses rocksdb node + postrgres tx+docs store in production.\n  - stores ring sessions in XTDB.\n- Component driven development tooling, choice of:\n  - workspaces (add link)\n  - devcards\n  - storybook\n\n# Use it\n\n## TLDR\n\nInstall `clj-new` as a tool if you don't have it installed (this only needs to be done once).\n\n```bash\n# Only needs to be done once, to install the tool:\nclojure -Ttools install com.github.seancorfield/clj-new '{:git/tag \"v1.2.381\"}' :as clj-new\n```\n\nAdd these aliases to your ~/.clojure/deps.edn\n\n```clojure\n  :fulcro-app {:extra-deps {com.github.seancorfield/clj-new {:mvn/version \"1.2.381\"}}\n               :exec-fn clj-new/create\n               :exec-args {:template \"dv.fulcro-template\" :args [\"+test\" \"+node-server\"]}}\n\n  :full-fulcro-app {:extra-deps {com.github.seancorfield/clj-new {:mvn/version \"1.2.381\"}}\n               :exec-fn clj-new/create\n               :exec-args {:template \"dv.fulcro-template\" :args [\"+all\"]}}\n```\n\nNow you can run:\n\n```bash\n# for a js only app:\nclj -X:fulcro-app :name pro.my-org/app-name\n\n# with pedestal + pathom + xtdb server:\nclj -X:full-fulcro-app :name pro.my-org/app-name\n```\n\nFor even more convenience you can make shell function helpers (this is bash):\n\n```bash\nnew_fulcro_app () {\n  if [ -z $1 ]; then echo \"You must supply a project name, optionally clj-new args.\"; return; fi\n  clojure -X:fulcro-app :name \"${@}\"\n}\n\nnew_full_fulcro_app () {\n  if [ -z $1 ]; then echo \"You must supply a project name, optionally clj-new args.\"; return; fi\n  clojure -X:full-fulcro-app :name \"${@}\"\n}\n```\nAnd invoke them like so:\n```bash\nnew_fulcro_app co.my-org/my-app\n# override the args:\nnew_fulcro_app co.my-org/my-app :args '[\"+test\"]'\n\n# overwrite existing directory:\nnew_fulcro_app co.my-org/my-app :force true\n# et cetera\n```\n\n### Start development proceses:\n\n```bash\ncd app-name\n# Requires node \u003e 16\nnvm use\n\n# Start compiling ClojureScript\n\nbb fe\n# or pass any deps aliases:\nbb fe :dev/my-alias\n\n# Connect your editor of choice and start the server if you have one via src/dev/user.clj.\n# You can also start an nREPL server via:\n\nbb be-repl\n# or pass any deps aliases:\nbb be-repl :dev/my-alias\n```\n\n## Have time, will read\n\nclj-new can be invoked as a clojure tool or via a deps.edn alias,\n\nYou can install clj-new as a tool with:\n```bash\nclojure -Ttools install com.github.seancorfield/clj-new '{:git/tag \"v1.2.381\"}' :as clj-new\n```\nOr add a `new` alias to your user deps.edn file. For instructions see:\n\nhttps://github.com/seancorfield/clj-new\n\nThen construct a new project as specified below\n\nAfter your project is generated you should run:\n\n```bash\nyarn\nyarn outdated\n```\n\nand\n\n```bash\nclojure -Sdeps '{:deps {com.github.liquidz/antq {:mvn/version \"RELEASE\"}}}' -m antq.core\n```\n\nwhich will list out of date dependencies for you to update.\n\n----\nCommands to make a new project directory from this template.\n\nIf you installed clj-new as a tool replace `clj -X:new` with `clj -Tclj-new create` in the commands below.\nIf you didn't install the alias above in your ~/.clojure/deps.edn , then use: `clj -X:new :template dv.fulcro-template`\n\nUsing Clojure CLI version 1.10.1.727 or later\n```bash\n# Frontend only app\nclj -X:fulcro-app :name my-username/my-project-name\n\n# Pass one or more options\nclj -X:fulcro-app :name my-username/my-project-name :args '[\"+devcards\" \"+workspaces\" \"+test\" \"+node-server\" \"+server\"]'\n\n# Or include them all:\nclj -X:fulcro-app :name my-username/my-project-name :args '[\"+all\"]'\n\n# output to another directory name, and overwrite if it already exists:\nclj -X:fulcro-app :name my-username/my-project-name :output '\"my-preferred-project-name\"' :force true\n```\n\nIf you're working on the template itself, you can generate a project from the filesystem:\n\n```bash\nclj -X:new :template '\"/home/my-user/dv.fulcro-template::dv.fulcro-template\"' :name my-group/my-project\n```\n\nYou can also add this to your ~/.clojure/deps.edn file in an alias for convenience.\n\n## Options\n\n```\n+devcards\n+storybook\n+workspaces\n+test\n+node-server\n+server\n```\n\nYou can include all the above options by just passing:\n```\n+all\n```\n\nWith no options you get a client-only fulcro app with a dev webserver handled by shadow-cljs.\n\nThe node-server is used for server-side rendering, it is not fully baked.\nIt has code to render the root fulcro component to a string, but some more work is needed\nto ask the clojure server for the start data and inject that into the resulting page and pick it up\non the client.\n\nThe `+server` option produces a pedestal+jetty server with reitit for routing and muuntaja\nto handle content negotiation.\n\nThe template uses helpers from https://github.com/dvingo/my-clj-utils\nto setup a pathom parser and a XTDB standalone rocksdb node.\n\nThe server has simple password auth using cryptohash-clj to hash passwords with argon2.\n\nHere is sample output of the template with these arguments: \n\n`'[\"+server\" \"+workspaces\" \"+test\" \"+node-server\"]'`\n```\n$ tree -a\n.\n├── .clj-kondo\n│   └── config.edn\n├── deps.edn\n├── .gitignore\n├── guardrails.edn\n├── karma.conf.js\n├── Makefile\n├── package.json\n├── README.md\n├── resources\n│   ├── logback.xml\n│   └── public\n│       └── workspaces\n│           └── workspaces.html\n├── scripts\n│   ├── node_server_start.sh\n│   └── start_dev.sh\n├── shadow-cljs.edn\n├── src\n│   ├── dev\n│   │   └── user.clj\n│   ├── main\n│   │   ├── config\n│   │   │   ├── defaults.edn\n│   │   │   ├── dev.edn\n│   │   │   ├── fe-config.edn\n│   │   │   ├── prod.edn\n│   │   │   └── test.edn\n│   │   └── space\n│   │       └── matterandvoid\n│   │           └── template_test\n│   │               ├── auth\n│   │               │   ├── login.cljs\n│   │               │   ├── session.clj\n│   │               │   ├── session.cljs\n│   │               │   ├── signup.cljs\n│   │               │   ├── user.clj\n│   │               │   └── user.cljs\n│   │               ├── client\n│   │               │   ├── application.cljs\n│   │               │   ├── client_entry.cljs\n│   │               │   ├── development_preload.cljs\n│   │               │   ├── malli_registry.cljs\n│   │               │   ├── prn_debug.cljs\n│   │               │   ├── prn_debug_noop.cljs\n│   │               │   └── ui\n│   │               │       ├── root.cljs\n│   │               │       └── styles\n│   │               │           ├── app_styles.cljs\n│   │               │           ├── global_styles.cljs\n│   │               │           └── style_themes.cljs\n│   │               ├── node_server.cljs\n│   │               ├── server\n│   │               │   ├── config.clj\n│   │               │   ├── xtdb_node.clj\n│   │               │   ├── pathom_parser.clj\n│   │               │   ├── pathom_playground.clj\n│   │               │   ├── server.clj\n│   │               │   ├── server_entry.clj\n│   │               │   └── service.clj\n│   │               └── task\n│   │                   ├── data_model.cljc\n│   │                   ├── db_layer.clj\n│   │                   ├── task_resolvers.clj\n│   │                   └── ui\n│   │                       ├── task_item.cljs\n│   │                       └── task_page.cljs\n│   ├── test\n│   │   └── space\n│   │       └── matterandvoid\n│   │           └── template_test\n│   │               └── app_tests.cljc\n│   └── workspaces\n│       └── space\n│           └── matterandvoid\n│               └── template_test\n│                   └── main_ws.cljs\n└── yarn.lock\n\n27 directories, 51 files\n\n```\n\n# Building the template repo itself\n\nBuild a deployable jar of this template:\n\n    clojure -X:jar\n\nInstall it locally:\n\n    clojure -M:install\n\nDeploy it to Clojars -- needs `CLOJARS_USERNAME` and `CLOJARS_PASSWORD` environment variables:\n\n    clojure -M:deploy\n\nSteps to deploy:\n\nIncrement pom.xml version\ncommit all changes, push to remote.\n```bash\nmake\n```\nrun deploy\n\nReferences:\n\nThis was adapted from:\n\nhttps://clojars.org/re-frame-template/clj-template\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvingo%2Fdv.fulcro-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvingo%2Fdv.fulcro-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvingo%2Fdv.fulcro-template/lists"}