Project Structure
Relevant source files
The following files were used as context for generating this wiki page:
Conduit organizes its codebase as a Flutter mono-repository using a workspace architecture. The project separates concerns into a central Flutter mobile application, specialized shared packages, and third-party submodules to maintain portability and platform consistency.
Sources: pubspec.yaml:10-18, README.md:255-263
Workspace Architecture
The project employs a Flutter workspace where the mobile app serves as the workspace root. This configuration ensures all components share a single lockfile, preventing version drift between the application and its dependencies.
The diagram above illustrates the relationship between the root application and its internal packages and submodules.
Sources: pubspec.yaml:15-20, pubspec.yaml:57-65
Module Breakdown
The system distributes logic across several specialized packages to ensure clean boundaries between UI, business logic, and external integrations.
conduit_core
Contains the business logic of the application. It handles authentication, API communication, database operations (via Drift), and chat state management. This package is "Pure Dart" and permits dart:io usage but excludes Flutter dependencies. This allows the core to be hosted by a sidecar process if required.
Sources: packages/conduit_core/pubspec.yaml:1-6, packages/conduit_core/pubspec.yaml:23-53
conduit_markdown
Implements markdown preprocessing and custom syntaxes. It transforms model output into a block model. The package supports both Flutter rendering and desktop DOM rendering by remaining compatible with dart compile js.
Sources: packages/conduit_markdown/pubspec.yaml:1-5
conduit_ddgs
Provides web search scrapers for providers like DuckDuckGo, Brave, and Wikipedia. This module enables on-device models to perform web searches without relying on external search services.
Sources: packages/conduit_ddgs/pubspec.yaml:1-5
Internal Directory Structure
| Directory | Purpose |
|---|---|
lib/ | Contains the main Flutter application code, including features like auth, chat, and workspace. |
packages/ | Holds shared Pure-Dart workspace members. |
third_party/ | Stores unpublished workspace packages and submodules like the Mermaid renderer and VAD. |
tool/ | Contains developer tools, such as the platform_ui_allowlist for monitoring UI library usage. |
scripts/ | Houses automation scripts for CI/CD and release management. |
assets/ | Stores static resources including icons, model logos, and Chart.js scripts. |
Sources: pubspec.yaml:10-20, pubspec.yaml:57-65, pubspec.yaml:148-160, tool/platform_ui_allowlist.yaml, scripts/release.sh
UI and Platform Strategy
Conduit uses a "Platform UI" seam to manage dependencies on material_ui and cupertino_ui. The project enforces an allowlist to track and migrate direct UI library calls, aiming for a unified adaptive interface.
The diagram shows how the platform seam abstracts specific UI frameworks, monitored by the allowlist tool.
Sources: tool/platform_ui_allowlist.yaml:1-5, pubspec.yaml:24-27
Data and State Management
The project integrates several libraries to handle transient state and persistent storage across the workspace.
- State Management: Uses
riverpodandflutter_riverpod. Non-UI code inconduit_coreimports the Flutter-freeriverpoddirectly. - Database: Employs
driftfor the primary schema, owned byconduit_core. - Secure Storage: Utilizes
flutter_secure_storagefor credentials and API keys. - NoSQL Storage: Uses
hive_cefor lightweight local data.
Sources: pubspec.yaml:34-37, pubspec.yaml:45-50, packages/conduit_core/pubspec.yaml:9-12
Build and Release Process
The scripts/release.sh utility automates version bumping and CI-driven releases. It performs the following sequence:
- Validates baked release notes using Dart tools.
- Updates
pubspec.yamlversion and build numbers. - Generates Fastlane changelogs for Android and iOS.
- Updates the iOS
Deliverfile. - Pushes tags to trigger GitHub Actions workflows.
Sources: scripts/release.sh:80-142
Conduit's structure facilitates multi-platform deployment by isolating high-level Flutter UI from underlying Dart-only logic and specialized search/rendering components.