(this is a draft)
...
See also: Overview for a new developer and Newcomer's first steps
FOLIO Design & Architecture
- Okapi : Gateway/Discovery service and Security model - https://wikifolio-org.folioatlassian.orgnet/wiki/display/~vijay/FOLIO+-+Developer+Onboarding+Guide#FOLIODeveloperOnboardingGuide-Design&Architecture
- RMB framework : Core module for all Vertx based modules - https://github.com/folio-org/raml-module-builder#overview
...
Some demo videos are useful to understand FOLIO acquisition apps (these are using old versions):
See also: Thunderjet - Guidelines for backend code organization, unit tests and Karate tests
Running in IDEA
Installation
- Install Java JDK 1117
Install IDEA as IDE : https://www.jetbrains.com/idea/
- Install last version of Vagrant : https://www.vagrantup.com/
- Install VirtualBox : https://www.virtualbox.org/
- Alternative to vagrant/virtualBox using less memory: BusyBee
- Install Postman: https://www.postman.com/
- Clone from git modules and add all of them in one IDEA project
- ThunderJet back-end modules : mod-orders, mod-orders-storage, mod-invoice, mod-invoice-storage, mod-finance, mod-finance-storage, mod-organizations, mod-organizations-storage, mod-gobi, edge-orders, edge-common, mod-ebsconet, acq-models
- Modules with integration tests: folio-integration-tests(Karate), folio-api-tests(Postman)
- Up FOLIO platform by using one of the box :
- Back-end + UI : https://app.vagrantup.com/folio/boxes/snapshot
- See build times at https://dev.folio.org/guides/automation/#reference-environments
- Configure VitualBox and IDEA for running FOLIO microservice from IDEA : How to run folio backend modules with IntelliJ Idea and interact with Vagrant box environment
...
Please import this environment configuration with predefined values of variables : {{protocol}}, {url}}, {{okapiport}}
- "Add okapi permission to diku_admin.postman_collection.json" → After you started VagrantBox, then you should add "okapi.all" permission to give ability to deploy modules by "diku_admin" user.
"Redeploy-invoice-storage-module.postman_collection.json" → Please use this collection to deploy mod-invoice-storage
...
If a module was already deployed and a new version needs to be tested for integration tests, it is not necessary to remove the old version: simply add .xxx to the id in the descriptor, with a number higher than the currently deployed one, and the karate tests will automatically use the latest version.
! Important (issue with module upgrade and load sample and reference)
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{{okapiprotocol}}://{{okapiurl}}:{{okapiport}}/_/proxy/tenants/{{xokapitenant}}/install?tenantParameters=loadSample=false,loadReference=false
12:49
@Override
public Future<Integer> loadData(TenantAttributes attributes, String tenantId, Map<String, String> headers, Context vertxContext) {
// log.info("postTenant");
// Vertx vertx = vertxContext.owner();
// Parameter parameter = new Parameter().withKey(PARAMETER_LOAD_SYSTEM).withValue("true");
// attributes.getParameters().add(parameter);
//
// TenantLoading tl = new TenantLoading();
// buildDataLoadingParameters(attributes, tl);
//
// DBClient client = new DBClient(vertxContext, headers);
//
// return Future.succeededFuture()
// .compose(v -> migration(attributes, "mod-invoice-storage-5.2.0",
// () -> migrationService.syncOrderPoNumbersWithInvoicePoNumbers(headers, vertxContext)))
// .compose(v -> {
//
// Promise<Integer> promise = Promise.promise();
//
// tl.perform(attributes, headers, vertx, res -> {
// if (res.failed()) {
// promise.fail(res.cause());
// } else {
// promise.complete(res.result());
// }
// });
// return promise.future();
// })
// .onFailure(throwable -> Future.failedFuture(throwable.getCause()));
return Future.succeededFuture(0);
} |
Debugging
Modules can be executed in debug mode in IDEA, they just need to be deployed as described above.. Unit tests can also be debugged in the same way.
...