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/dband 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