This is a demo repository for Fulcro RAD. It includes a shared source directory of files that would be common to any project, and then separate source directories that have specific files that would be needed to work with specific back-end technologies (currently SQL and Datomic).
You must compile the CLJS source to run the client. If you want to be able to edit it, just start a shadow-cljs watch:
$ yarn
$ shadow-cljs watch main
The example code should work with most SQL databases, and the data source
is configured in the defaults.edn
config file in the sql source
directory. See the HikariCP connection pool documentation.
The SQL example has a custom development
namespace in the src/sql
source
folder, along with components needed to run that server.
You can start the server-side version for SQL using the deps aliases that set up the proper classpath:
$ clj -A:dev:sql
user=> (require 'development)
user=> (development/go)
The example code for Datomic components is in the src/datomic
folder, along with a custom
development.clj
.
Install Datomic, either Pro or Free. Configure Pro for either a PostgreSQL or MySQL storage engine, then update the config parameters
in defaults.edn
in the src/datomic/config
directory to have the correct connection parameters.
For example, something like:
:com.fulcrologic.rad.database-adapters.datomic/databases
{:main {:datomic/schema :production
:datomic/driver :postgresql ;; OR :mysql :free :mem
:datomic/database "example"
:datomic/prevent-changes? true
:postgresql/host "localhost"
:postgresql/port 5432
:postgresql/user "datomic"
:postgresql/password "datomic"
:postgresql/database "datomic"
:free/host "localhost"
:free/port 4334}}
Then you can run it with the :datomic
alias and the chosen storage driver alias:
For Postgresql:
$ clj -A:dev:datomic:postgresql
user=> (require 'development)
user=> (development/go)
Alternatively, for Mysql, Free, or Mem:
$ clj -A:dev:datomic:mysql
# OR
$ clj -A:dev:datomic:free
# OR
$ clj -A:dev:datomic:mem