How sm85-code/sm85-arch works
This repository is a multi-tenant business application: a shared FastAPI entry point mounts separate Bumi Lestari finance, madrasah administration, marketplace ERP, and online-store APIs. The principal workflow is an API request routed to a tenant’s application logic and its isolated database; commerce and education add distinct operational capabilities. The README is empty, so capabilities and relationships here are based on the file tree and SOURCE INDEX references; unsampled subsystems are represented at directory level where needed.
Main entry points: main.py FastAPI application · keu_services.py Finance services · madrasah_router.py Madrasah API · bumi_lestari_router.py Bumi API
Components 28
Shared runtime
- FastAPI application
main.py - Tenant security
shared/security.py
Bumi finance
- Bumi API
tenants/bumi_lestari/adapters/api/v1/bumi_lestari_router.py - Finance API
tenants/bumi_lestari/adapters/api/v1/keu_router.py - Bumi services
tenants/bumi_lestari/modules/bumi_lestari/application/services.py - Finance services
tenants/bumi_lestari/modules/bumi_lestari/application/keu_services.py - Ledger operations
tenants/bumi_lestari/modules/bumi_lestari/application/keu_ledger.py - Accounting operations
tenants/bumi_lestari/modules/bumi_lestari/application/keu_accounting.py - Finance records
tenants/bumi_lestari/modules/bumi_lestari/infrastructure/models.py - Finance models
tenants/bumi_lestari/modules/bumi_lestari/infrastructure/models_keu.py - Bumi database
tenants/bumi_lestari/modules/bumi_lestari/infrastructure/database.py
Madrasah operations
- Madrasah API
tenants/madrasah/adapters/api/v1/madrasah_router.py - Madrasah services
tenants/madrasah/modules/madrasah/application/services.py - Family-card parser
tenants/madrasah/modules/madrasah/application/kk_parser.py - OCR adapter
adapters/external/ocr_space_adapter.py - Madrasah records
tenants/madrasah/modules/madrasah/infrastructure/models.py - Madrasah database
tenants/madrasah/modules/madrasah/infrastructure/database.py
Commerce
- Marketplace API
tenants/marketplace_erp/adapters/api/v1/marketplace_erp_router.py - Marketplace services
tenants/marketplace_erp/modules/marketplace_erp/application/services.py - Marketplace channels
tenants/marketplace_erp/modules/marketplace_erp/infrastructure/adapters - Marketplace database
tenants/marketplace_erp/modules/marketplace_erp/infrastructure/database.py - Store admin API
tenants/store/adapters/api/v1/store_admin_router.py - Store buyer API
tenants/store/adapters/api/v1/store_buyer_router.py - Store services
tenants/store/modules/store/application/services.py - Media storage
tenants/store/modules/store/infrastructure/media_storage.py - Store integrations
tenants/store/modules/store/infrastructure - Store database
tenants/store/modules/store/infrastructure/database.py
Other components
- API user
Connections 26
- API user → FastAPI application: sends request
main.py - FastAPI application → Bumi API: mounts routes
main.py - FastAPI application → Bumi database: initializes tenant
main.py - FastAPI application → Madrasah API: mounts routes
main.py - FastAPI application → Madrasah database: initializes tenant
main.py - FastAPI application → Marketplace API: mounts routes
main.py - FastAPI application → Marketplace database: initializes tenant
main.py - FastAPI application → Store admin API: mounts routes
main.py - FastAPI application → Store buyer API: mounts routes
main.py - FastAPI application → Store database: initializes tenant
main.py - Bumi API → Bumi services: calls
tenants/bumi_lestari/adapters/api/v1/bumi_lestari_router.py - Bumi API → Finance records: uses records
tenants/bumi_lestari/adapters/api/v1/bumi_lestari_router.py - Finance API → Finance services: calls
tenants/bumi_lestari/modules/bumi_lestari/application/keu_services.py - Finance services → Ledger operations: uses ledger
tenants/bumi_lestari/modules/bumi_lestari/application/keu_services.py - Finance services → Accounting operations: records orders
tenants/bumi_lestari/modules/bumi_lestari/application/keu_services.py - Finance services → Finance models: queries records
tenants/bumi_lestari/modules/bumi_lestari/application/keu_services.py - Madrasah API → Madrasah services: calls
tenants/madrasah/adapters/api/v1/madrasah_router.py - Madrasah API → Family-card parser: uses parser
tenants/madrasah/adapters/api/v1/madrasah_router.py - Madrasah API → OCR adapter: uses OCR
tenants/madrasah/adapters/api/v1/madrasah_router.py - Madrasah services → Madrasah records: queries records
tenants/madrasah/modules/madrasah/application/services.py - Marketplace API → Marketplace services: calls
tenants/marketplace_erp/adapters/api/v1/marketplace_erp_router.py - Marketplace services → Marketplace channels: uses channels
tenants/marketplace_erp/modules/marketplace_erp/application/services.py - Store admin API → Store services: calls
tenants/store/adapters/api/v1/store_admin_router.py - Store buyer API → Store services: calls
tenants/store/adapters/api/v1/store_buyer_router.py - Store services → Media storage: stores media
tenants/store/modules/store/application/services.py - Store buyer API → Store integrations: uses integrations
tenants/store/adapters/api/v1/store_buyer_router.py