Sign inSign up

virag/fineract-cockroachdb-demo

By virag

Updated over 1 year ago

Apache fineract with CockroachDB

Image
0

371

virag/fineract-cockroachdb-demo repository overview

🪛 Working Apache Fineract + CockroachDB Demo (With Workaround)

This demo runs Apache Fineract using CockroachDB in PostgreSQL compatibility mode. It uses a prebuilt Docker image with patched Liquibase changelogs to avoid incompatible ALTER statements.

✅ This is a working demo that bypasses known schema incompatibilities. Authentication and tenant provisioning succeed. However, full functionality is not yet fully validated.

🐳 Quickstart
git clone https://github.com/viragtripathi/cockroach-collections.git
cd cockroach-collections/scripts/fineract-cockroachdb-demo

# Start the demo (requires Docker or Podman)
./run-demo.sh

Wait for the startup to complete. You can then test health and login APIs.

✅ Verifying the Demo
curl -k https://localhost:8085/fineract-provider/actuator/health
# {"status":"UP","groups":["liveness","readiness"]}

curl -k -X POST https://localhost:8085/fineract-provider/api/v1/authentication \
  -H "Content-Type: application/json" \
  -H "Fineract-Platform-TenantId: default" \
  -d '{
    "username": "mifos",
    "password": "password"
  }'

Expected output:

{
  "username": "mifos",
  "authenticated": true,
  "roles": ["..."],
  "...": "..."
}
📄 init-tenant.sql

This SQL is executed post-startup to update existing rows instead of creating tables:

-- Safe to run on startup
CREATE DATABASE IF NOT EXISTS fineract_tenants;
CREATE DATABASE IF NOT EXISTS fineract_default;

UPDATE tenant_server_connections
SET
  schema_server = 'cockroachdb',
  schema_server_port = '26257',
  schema_username = 'root',
  schema_password = '',
  schema_connection_parameters = '',
  readonly_schema_server = '',
  readonly_schema_server_port = '',
  readonly_schema_username = '',
  readonly_schema_password = '',
  readonly_schema_connection_parameters = ''
WHERE id = 1;

UPDATE tenants
SET
  name = 'fineract_default',
  identifier = 'default',
  timezone_id = 'Asia/Kolkata',
  created_date = current_timestamp,
  lastmodified_date = current_timestamp,
  oltp_id = 1
WHERE id = 1;
🛠️ Docker Image Used
🏁 What Works
  • Liquibase migrations for fineract_tenants and fineract_default
  • Manual tenant schema re-pointing to CockroachDB
  • Login and healthcheck APIs
⚠️ Known Gaps
  • Not all Liquibase changelog operations (like ALTER) are supported by CockroachDB
  • Long-term CockroachDB support in Apache Fineract will require upstream PRs and schema compatibility work

Tag summary

Content type

Image

Digest

sha256:c7086f5a2

Size

400.9 MB

Last updated

over 1 year ago

docker pull virag/fineract-cockroachdb-demo