Skip to content

fdhenard/cledgers-kit-1

Repository files navigation

cledgers

[toc]

kit project creation (generation) notes

clj -Ttools install com.github.seancorfield/clj-new '{:git/tag "v1.2.399"}' :as clj-new

clojure -Tclj-new create :template io.github.kit-clj :name fdhenard/cledgers :args '[+sql]'
mv cledgers cledgers-kit-1

in repl

(kit/sync-modules)
(kit/install-module :kit/cljs)

dev prereqs

  • install asdf

    • brew install asdf
  • install asdf dependencies (clojure, and nodejs as of 10/27/23).

    cd ~/dev/repos/cledgers-kit-1
    # below installs from .tool-versions
    asdf install
  • db setup

    • postgresql installed

      • use homebrew to install and use $ brew services start postgresql
      • if first time installing, you may need to run $ createdb to create the db with username
    • $ psql postgres

    • > create role cledgers with createdb login;

    • exit psql ^d

    • $ createdb cledgers -O cledgers

    • run migrations

      • see readme for DDDL
      • as of 6/16/2021
        • $ cd ~/dev/repos/declarative-ddl

        • dry run

            $ lein run -d ../cledgers-kit-1 -b "postgresql://localhost/cledgers?user=cledgers" migrate
          
        • execute:

            $ lein run -d ../cledgers-kit-1 -b "postgresql://localhost/cledgers?user=cledgers" -e migrate
          
    • insert self as user

      • eval the code in the Rich Comment of fdhenard.cledgers.dev.scripts

REPLs

CIDER

clojure -M:dev:cider

Use the cider alias for CIDER nREPL support (run clj -M:dev:cider). See the CIDER docs for more help.

Note 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.

Start the server with:

(go)

The default API is available under http://localhost:3000/api

System configuration is available under resources/system.edn.

To reload changes:

(reset)

Clojurescript

cd ~/dev/repos/cledgers-kit-1
npx shadow-cljs watch app
In emacs
  • M-x cider-connect
  • host: localhost
  • port: see shadow-cljs output. eg. shadow-cljs - nREPL server started on port 7002
  • shadow.user> (shadow/repl :app)
  • test repl?: (js/alert "Hi")

Command Line

Run clj -M:dev:nrepl or make repl.

Note that, just like with 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.

provision server

prereqs

  • babashka installed

steps

terraform

  • put credentials in env vars or in .zshrc

     export AWS_ACCESS_KEY_ID=xxxx
     export AWS_SECRET_ACCESS_KEY=xxxx
    
  • this stuffs

     brew install tfenv
     cd infrastructure/terraform/prod
     tfenv install
     terraform init
     terraform plan
     terraform apply

babashka

  • ssh into the server

    • acquire the ip address from aws console

    • do this

      ssh -i "Dropbox/Programming/frank-key-pair.pem" [email protected]
  • add machine ssh key to the server .ssh/authorized_keys

  • execute babashka code in infrastructure/babashka/src/up.clj

  • run migrations - see dev instructions

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published