MATIH Platform is in active MVP development. Documentation reflects current implementation status.
18. CI/CD & Build System
Stage 03: Commons

Stage 03: Commons Libraries

Stage 03 builds the shared commons libraries that provide cross-cutting concerns (security, multi-tenancy, observability) to all services.

Source file: scripts/stages/03-build-commons.sh


Libraries Built

LibraryLanguageKey Modules
commons-javaJava/MavenJWT auth, tenant context, RBAC, metrics
commons-pythonPython/pipFastAPI middleware, structured logging, config
commons-typescriptTypeScript/npmAPI client, shared types, UI components

Build Order

Commons must be built before services because they are direct dependencies:

# 1. Java commons - install to local Maven repo
cd commons/commons-java
./mvnw clean install -DskipTests -q
 
# 2. Python commons - editable install
cd commons/commons-python
python3.11 -m pip install -e ".[dev]"
 
# 3. TypeScript commons - npm install and build
cd commons/commons-typescript
npm install && npm run build

Dependency Verification

# Check for commons-java artifact
[[ -f "${MATIH_ROOT}/commons/commons-java/target/commons-java.jar" ]]

Dependencies

  • Requires: 02-build-base-images
  • Required by: 04-build-service-images