Google Sign-In Required

Use your company Google account to access the BetterFleet private content.

Back to private home

BetterFleet Support Private
Skip to content
BetterFleet Dev Wiki
bf-manage-core
Initializing search
    bf-dev
    • Home
    • Product Capabilities
    • Process
    • Current Work
    • System Design
    • Software Reference
    • Operations
    bf-dev
    • Home
      • Overview
      • Manage
      • Overview
      • Product Engineering Workflow
      • Product Engineering Delivery
      • Product Engineering Workflow in Linear
        • GitLab Feature Flags
        • In-App Docs Authoring
        • Release Notes
      • Templates
      • Publishing
      • Workflow Companions
      • Overview
      • Active Artifacts
      • Backlog Artifacts
      • Archived Artifacts
      • Overview
      • Microgrid
      • OSCP
        • Challenge
        • Specification
        • Spec
        • Architecture
        • Overview
        • Script Runtime Model
        • Compose Profiles and Modes
        • Repo Topology
        • CI and Release Integration
        • Overview
        • Internal Application Diagrams
          • Overview
          • Web Model
          • Core Model
        • Service Interaction Flows
        • Data and State
          • Index
          • bf-manage-web
          • bf-manage-core
            • What this service is
            • Code anatomy
            • Architectural characteristics
            • Documentation and tests in-repo
            • Internal request lifecycle
            • Internal component map
            • Cloud dependency map
          • bf-manage-connect
          • bf-manage-sitepwrmon
          • bf-manage-incidents
          • bf-telematics
          • bf-depot-sim
          • bf-manage-roaming
          • bf-support-microsite
          • bf-digital-twin
          • bf-schedule-creator
        • Overview
        • Internal Application Diagrams
        • Migration and Flags
        • Simulation Request Lifecycle
          • Index
          • bf-bnl-ui
          • bf-bnl-settings
          • bf-bnl-schedule-analysis-compute
          • bf-route-modelling
          • bf-schedule-creator
          • bf-digital-twin
        • Overview
        • Secrets and Env Strategy
        • Vendors and Local Dependencies
        • ADRs
        • Service Matrix
        • Cloud Dependencies
        • Ports and URLs
      • Onboarding
      • Daily Operations Runbook
        • Overview
        • Staging Hotfix Release
        • Production Hotfix Release
        • Terraform Plan Dry Runs
      • Troubleshooting
      • Testing Guide
    • What this service is
    • Code anatomy
    • Architectural characteristics
    • Documentation and tests in-repo
    • Internal request lifecycle
    • Internal component map
    • Cloud dependency map

    bf-manage-core¶

    What this service is¶

    bf-manage-core is the central Manage backend. It owns most domain APIs and orchestration logic, and coordinates data/state with DB, MQ, cache, and integration services.

    Code anatomy¶

    • src/main.py: FastAPI application assembly and router wiring.
    • src/api/*: internal/manage APIs split by domain (charge_point, depot, dispatch, transaction, vehicle, resource_groups, etc.).
    • src/api_public/*: externally exposed/public API surface with separate auth and endpoint boundaries.
    • src/adapters/*: persistence/integration adapters by domain (vehicle, transaction, priority, charts, system admin, reports).
    • src/charging/*: charging and transaction service-layer behavior.
    • src/connect_router/*: integration path for connect-related protocol routing.
    • src/OCPI/*: OCPI-specific modules (payments, services, UoW abstractions).
    • src/db and migration tooling via Alembic scripts.

    Architectural characteristics¶

    • Large modular monolith with domain-partitioned router and adapter layers.
    • Separate public-vs-internal API boundaries.
    • Mature test footprint across API, service, power, scheduling and reporting areas.

    Documentation and tests in-repo¶

    • docs/DDD/* includes DDD and hexagonal architecture materials.
    • Extensive tests under test/ with many domain sub-suites.

    Internal request lifecycle¶

    sequenceDiagram
      participant Client
      participant Router as api router
      participant Service as service layer
      participant Adapter as adapter layer
      participant Store as persistence
    
      Client->>Router: http request
      Router->>Service: validated command
      Service->>Adapter: domain data operation
      Adapter->>Store: read or write
      Store-->>Adapter: data result
      Adapter-->>Service: mapped entity
      Service-->>Router: response model
      Router-->>Client: http response

    Internal component map¶

    flowchart TD
      Main[main app] --> Api[api and api public]
      Api --> ServiceLayer[service modules]
      ServiceLayer --> Adapters[adapters]
      ServiceLayer --> Charging[charging modules]
      ServiceLayer --> Ocpi[ocpi modules]
      Adapters --> Db[(database)]
      ServiceLayer --> Events[event and queue integration]

    Cloud dependency map¶

    flowchart LR
      Core[bf-manage-core] --> S3[(aws s3)]
      Core --> DDB[(aws dynamodb)]
      Reports[scheduled reports] --> S3
      Reports --> DDB
      MsgLogs[message logger] --> DDB
      Core --> Reports
      Core --> MsgLogs
    Made with Material for MkDocs