Skip to main content

Technology Stack

Core Technologies

ComponentTechnologyVersionPurpose
LanguageGo1.24+Primary programming language
RPC FrameworkgRPCv1.xService-to-service communication
REST GatewaygRPC-Gateway v2v2.xREST API translation from gRPC
API DefinitionProtocol Buffersproto3Message and service definitions
ORMGORMv2.xDatabase operations and migrations
ConfigurationViperv1.xConfiguration management
CLICobrav1.xCommand-line interface
LoggingUber Zapv1.xStructured logging

Data Layer

ComponentTechnologyPurpose
Primary DatabasePostgreSQL 15Production data persistence
Development DBSQLiteLocal development and testing
CacheRedisOptional caching layer
ORMGORMMulti-dialect database abstraction

Database Configuration

  • Max connections: 100 (configurable)
  • Max idle connections: 10
  • Max open connections: 50
  • Connection max lifetime: 1 hour
  • Supported dialects: PostgreSQL, SQLite, MySQL

Security

ComponentTechnologyPurpose
AuthorizationCustom License (JWT-based)System-level authorization
Password HashingbcryptSecure credential storage
Field EncryptionAES / SHA-256Sensitive data protection
OIDCCoreOS go-oidcOpenID Connect support
CORSrs/corsCross-origin request handling
TLSGo stdlibTransport encryption

Infrastructure

ComponentTechnologyPurpose
ContainerizationDockerApplication packaging
OrchestrationKubernetesProduction deployment
ConfigurationKustomizeK8s config management
Live ReloadAirDevelopment hot-reload
BuildMakeBuild automation
ReleaseGoReleaserAutomated release builds

External Integrations

ServicePurposeIntegration Type
BLNKCore banking engine for Kulpay digital walletREST API (Adapter)
MiniAiLiveBiometric liveness detection and face matchingREST API
SMS ProviderOTP delivery for phone verificationREST API
NUIB APINational identity verification (Mozambique)REST API
MinioSelf-hosted object storage for documents and imagesS3-compatible API
QR Code ServiceIn-house QR code generation and scan trackingREST API
Card SimoCard payment processing via SIMORedeAdapter
BankTraditional banking operationsAdapter

Key Technical Decisions

DecisionRationale
GoHigh performance, low memory footprint, strong concurrency primitives, ideal for financial middleware
gRPC + gRPC-GatewayDefine APIs once in Proto, get both gRPC (internal) and REST (client-facing) with zero drift
GORM multi-dialectSQLite for development speed, PostgreSQL for production reliability, same codebase
BLNK as core bankingBattle-tested double-entry ledger — avoids building financial accounting from scratch
Minio (self-hosted)Full data sovereignty for sensitive identity documents within partner infrastructure
Adapter patternNew payment providers can be added without modifying the instruction engine
License-based authAuthorizes the deployment itself; per-user auth planned for multi-tenant scenarios

Project Structure

katembed-server/
├── cmd/ # CLI entry points
│ ├── kuloffice/ # Main API server
│ ├── kuloffice-license/ # License management tool
│ ├── kuloffice-migrate/ # Database migration tool
│ └── kuloffice-bootstrap/# System bootstrap
├── config/ # Configuration files (YAML)
├── deploy/ # Kubernetes/Kustomize configs
├── docker/ # Docker Compose files
├── internal/ # Core business logic (private)
│ ├── adapter/ # Payment adapter implementations
│ ├── customer/ # Customer service
│ ├── kyc/ # KYC service
│ ├── instruction/ # Transaction instruction engine
│ ├── interceptors/ # gRPC middleware
│ ├── model/ # Database models & migrations
│ └── ... # Other service packages
├── pkg/ # Shared packages (public)
│ ├── cache/ # Caching utilities
│ ├── crypto/ # Encryption utilities
│ ├── database/ # Database connection management
│ ├── logger/ # Logging utilities
│ └── ...
├── proto/ # Protocol Buffer definitions
│ └── kuloffice/v1/ # v1 API definitions
└── tests/ # Integration tests