Framework Modules

The Bosca Framework is composed of a rich set of modules, primarily split between the backend and general framework libraries. Each domain follows a pattern of a core-* module (interfaces and models) paired with an implementation module.

Framework Modules

The Bosca Framework is composed of a rich set of modules, primarily split between the backend and general framework libraries. Each domain follows a pattern of a core-* module (interfaces and models) paired with an implementation module.

Backend Framework (:backend:framework)

This set of modules implements the core business logic of the Bosca platform.

Core Layer

These modules define the fundamental interfaces, data structures, and utilities.

  • core: Base definitions, utilities, GraphQL scalars, attribute types, and find/query primitives.
  • core-annotations: Annotations for KSP code generation (@TypeController, @Repository, @JobDefinition, @PageController, @RouteController, @ServiceImplementation).
  • core-ksp: KSP symbol processor that generates GraphQL dispatchers, DI registrations, and repository implementations from annotations.
  • core-ai: AI model, agent, prompt, tool, and chat service interfaces.
  • core-analytics: Analytics dashboard, query, visualization, and event pipeline interfaces.
  • core-comments: Comment model and service interfaces.
  • core-configuration: Configuration key-value store interfaces.
  • core-content: Content model definitions (collections, metadata, documents, guides, categories, traits, templates, time events, workflow states, and transitions).
  • core-languages: Language model and service interfaces.
  • core-messages: Message, channel, and template interfaces for transactional messaging.
  • core-profile: Profile, attribute, bookmark, mark, rating, and relationship interfaces.
  • core-scheduler: Scheduled job, cron, and execution history interfaces.
  • core-scripting: Script model, execution context, and trigger binding interfaces.
  • core-search: Search abstraction interfaces.
  • core-security: Security primitives (Principals, Credentials, Groups, Permissions, Encryption).
  • core-storage: Storage system and URL signing interfaces.

Implementation Layer

These modules provide the concrete implementations of the core interfaces.

  • ai: Agent system (built on Google ADK), model registry, prompt management, chat sessions, MCP server registration, and GraphQL controllers.
  • analytics: Dashboard, query execution, visualization services, and GraphQL controllers.
  • analytics-ai: AI-powered analytics features.
  • analytics-models: Analytics event and data models.
  • backup: Platform data export and import with conflict resolution.
  • bible: Bible data processing (USX format parsing, style registry, chapter/verse organization).
  • configuration: Configuration key-value store implementation and GraphQL controllers.
  • content: Content management, collections, metadata, documents, guides, categories, traits, templates, time events, workflow states, transitions, and GraphQL controllers.
  • docs: API documentation extraction from source code with search indexing.
  • languages: Language registry, GraphQL controllers, and default language installer.
  • mcp: Model Context Protocol server (SSE transport, GraphQL introspection tools, schema caching).
  • messages: Transactional email delivery (SendGrid), job-based async processing, and template rendering.
  • profile: User profiles, attributes, bookmarks, marks, ratings, relationships, organizations, and GraphQL controllers.
  • scheduler: Cron-based job scheduling, execution history, catch-up behavior, and GraphQL controllers.
  • scripting: Kotlin Script (KTS) execution engine, trigger bindings, and GraphQL controllers.
  • search: Meilisearch integration, indexing, Jsonata transformations, and GraphQL controllers.
  • security: Authentication (Argon2id, scrypt, OAuth2), JWT tokens, GraphQL controllers, and email templates.
  • slugs: URL-friendly slug generation with transliteration and collision resolution.
  • storage: S3-compatible object storage, signed URLs, and GraphQL controllers.

General Framework (:framework)

These are lower-level libraries that can be used across different types of applications (not just backend).

  • di: Dependency Injection framework (multiplatform, suspend-friendly).
  • di-ksp: KSP processor for DI annotations.
  • service: Base service interface (multiplatform).
  • service-ksp: KSP processor for service annotations.
  • base-ksp: Shared KSP utilities.

Backend Utilities (:backend:utilities)

Infrastructure libraries used by the backend services:

  • sharedqueue: Distributed job queue supporting Redis and NATS backends, with parent-child job relationships, failure tracking, and configurable retry limits.
  • collaboration: Real-time collaborative editing engine using Rust-based CRDT (Yjs) with Kotlin FFI bindings via Uniffi. Tracks dirty state for collections, relationships, and attributes.
  • diagnostics: System monitoring with GraphQL API for job queue introspection and status inspection.
  • firebase-scrypt: Firebase-compatible password hashing (Rust FFI) for migrating Firebase users to Bosca authentication.

Kit (AI Agent Orchestration) (:backend:kit)

The Kit module provides the AI agent orchestration layer built on Google ADK. It includes:

  • Agent Builder: Constructs agent hierarchies from database definitions with recursive sub-agent resolution, dynamic tool loading, and MCP server integration.
  • Tool Library: Content browsing, GraphQL queries, SQL analytics, Bible search, script management, document processing, image generation/editing, PDF extraction, and search tools.
  • Chat Dispatcher: Routes chat requests to the appropriate agents with session management and streaming responses.

Applications Framework (:apps)

  • Compose Multiplatform client application (Android, iOS, Desktop).