# to build latest FE and run BE
npm inst
npm run build
bin/dev-run-backendInstall and start:
bin/dev-run-frontendFor a quicker start when already installed before:
npm run devnpx i18next-locales-sync -p de -s en -l resources/public/inventory/assets/locales/ --spaces 2 --useEmptyString trueThen discard changes in zod.json files
Use ./bin/cljfmt check and ./bin/cljfmt fix.
From vim you can use :! ./bin/cljfmt fix % to format the current file.
Use standardrb and standardrb --fix.
See ./bin/build
-
/inventory
http://localhost:8080/# leihs/inventory ./bin/dev-run-backend
/inventory
http://localhost:3260/
SeeSESSION_HANDLING_ACTIVATED?# leihs/inventory ./bin/dev-run-backend
- Proxy
http://localhost:3200/# leihs/integration-tests ./bin/start-reverse-proxy /inventory
http://localhost:3260/# leihs/inventory ./bin/dev-run-backend/my(provides simple login)
http://localhost:3240/# leihs/my ./bin/dev-run-backend- Legacy (not required)
# leihs/legacy ./bin/rails server -p 3210
- always a dedicated handler per route (no reuse of handlers between multiple routes)
- mapping of routes to file structure and namespaces (example:
/inventory/:pool-id/models/:model-id/entitlements->/inventory/inventory-pool/models/model/entitlements.clj) - maintain parity between frontend and backend routes as far as possible (in frontend as well as in legacy all views/resources are scoped under
:pool-id-> do the same for backend routes -> no global resources like e.g./inventory/modelsbut/inventory/:pool-id/models) - no configs in yml files. following system is setup in other leihs apps which has to be followed like this:
- default in namespace
- ENV overrides default in namespace
- CLI parameter overrides ENV and namespace default
- no temporary personal debug stuff under main namespace
/inventory/inventory-pool/...(if desired than place it under another namespace and don't include it in production build) - no versioning of routes until prod release (afterwards ok). keep always the actual version depending on the specification and test.
- no grouping of routes in swagger. all routes are listed flat and alphabetically sorted.
- don't use native clojure print facilities (like
println) for debug log statements. they are active always irrespective of log level! usedebug,warnetc. instead always making an adequate judgement what and what not to have in prod log. we don't want to clutter prod log (performance and readability). debug statements are safe in general even if one forgets them in a particular file: they don't clutter prod log and even development log unless the respective namespaces is activated for debug logging. - eliminate dead code (unused vars, etc.). also keep number of unused
:requireslow (you can use clojure-lsp "clean ns" command) - keep field definitions in context of entities; don't create a centralized field registry:
utils/coercion/spec_alpha_definition*.cljutils/helper.clj->convert-map-if-exist
- use canonical routes
- middlewares location - always place middlewares in
src/leihs/inventory/server/middlewares - utils location - always place utilities/helpers in
src/leihs/inventory/server/utils
./bin/build
scp leihs-inventory.jar <user>@<server>:/leihs/inventory/leihs-inventory.jar
systemctl restart leihs-inventory.service# additional clojure-tests can be triggered by:
clojure -X:test