Skip to content

leihs/leihs-borrow

Folders and files

NameName
Last commit message
Last commit date
Oct 4, 2021
Feb 13, 2025
Mar 20, 2025
Mar 20, 2025
Mar 20, 2025
Mar 20, 2025
Dec 29, 2021
Mar 24, 2025
Apr 4, 2022
Mar 12, 2025
Mar 24, 2025
Mar 24, 2025
Mar 24, 2025
Feb 13, 2025
May 22, 2023
Feb 13, 2020
Jul 8, 2024
Jul 20, 2023
Jun 8, 2023
Sep 6, 2023
Nov 7, 2019
Aug 11, 2020
Mar 13, 2025
Mar 13, 2025
Mar 20, 2025
Mar 13, 2025
Mar 13, 2025
Mar 17, 2025
Dec 27, 2024
Mar 20, 2025
Nov 27, 2023
Jan 29, 2025
Jul 5, 2022
Mar 24, 2025
Mar 28, 2024

Repository files navigation

leihs-borrow

Stack

App (frontend)

UI component library and theme (borrow-ui)

See: ui/README.md

Translations

DEV

For seamless dependency installation: use asdf version manager

Quickstart (shell):

# ENV config: copy from template
cp .env.local-example .env.local.dev
cp .env.local-example .env.local.test
ln -sf .env.local.dev .env.local
# ln -sf .env.local.test .env.local # to switch settings to dev env

# == prepare ==

# ensure correct version of shared code (UI/React and ClojureScript) and DB migrations
git submodule update --init --recursive --force

# prepare UI (npm install and build)
bin/ui-build

# prepare DB
source bin/set-env && bin/db-migrate

# == run the services (in separate shells) ==

# run backend
source bin/set-env && bin/dev-run-backend

# run frontend
source bin/set-env && bin/dev-run-frontend

# run ui watch (only when working on ui components and theme)
cd ui && npm run watch

# run storybook (only when working on ui components and theme)
cd ui && npm run storybook

# open in browser:
open "http://localhost:3250/borrow/"  # borrow
open "http://localhost:6006/"         # storybook

Quickstart (VS Code Task Runner)

  • Make sure .env.local.dev is configured for your development DB
  • Cmd-Shift-R and type "Run Task"
  • Task "Development Preparations Steps"
  • Task "Frontend Development Services (including UI)"

See .vscode/tasks.json for infos and more options

GraphiQL (GraphQL console)

There is a built-in console for the GraphQL API, but it needs some manual configuration to work. It is enabled in all environments (so it can also be used on a server, not just the local development env).

shadow-cljs watcher

$ shadow-cljs watch <ID>

shadow-cljs repl

  1. $ shadow-cljs clj-repl
  2. [1:0]~shadow.user=> (shadow/watch <ID>)
  3. Open the app in browser.
  4. [1:1]~cljs.user=> (shadow/repl <ID>)
  5. [1:1]~cljs.user=> (js/console.log "hello")

vim-fireplace & shadow-cljs

https://github.com/nimaai/vim-shadow-cljs

TEST

Start in prod mode:

bin/run

...or start in dev mode (instructions see above), but you might want to comment-out :preloads [day8.re-frame-10x.preload] in shadow-cljs.edn to prevent the re-frame-10x debugger from covering buttons etc.

Then run a spec:

./bin/rspec spec/features/smoke.feature

PROD

compile it:

bin/build

start it:

# TODO: document

Known issues

app framework

  • i18n: formatting numbers in translated messages uses browser locale instead of message locale.

Formatting Code

Clojure

Use ./bin/cljfmt check and ./bin/cljfmt fix.

From vim you can use :! ./bin/cljfmt fix % to format the current file.

Formatting Code

Ruby

Use ./bin/rblint and ./bin/rblint --fix.