Coreflux Templates
General

MongoDB Journal API with Live Summaries

Append-only journal ingest for MongoDB with live MQTT summaries and daily rollups on Coreflux LoT.

Dataflow

How it flows

Actions, models, routes and the topics that link them. Click a node to trace its flow.

How it works

This Coreflux LoT Notebook implements an append-only journal backed by MongoDB. A REST API writes new entries once, while MQTT topics carry live counters, window summaries, events, and scheduled reports for consumers.

Key features

  • REST ingest: POST /entries creates a journal entry on demo/journal/intake/create.
  • MongoDB persistence: JournalDB inserts documents into the entries collection and serves recent history.
  • Live broker state: today, this_week, metrics, and KPI values are maintained on topics with PUBLISH and KEEP.
  • Domain events: EntryAdded publishes each new note to demo/journal/events/entry_added.
  • Scheduled reporting: midnight actions publish a daily report and reset daily state; Monday resets the weekly window.
  • Error mirror: DB route error totals are mirrored from $SYS/Coreflux/Routes/JournalDB/status.

Prerequisites

  • MongoDB connection string and database name in JOURNAL_DB_URI and JOURNAL_DB_NAME
  • Coreflux broker access with HTTP enabled on port 9091
  • A broker clock aligned to the desired report timezone
The notebook

What’s inside

Browse the markdown and code cells before you download.

LoT Notebook:demo_journal.lotnb
Related use cases

Similar templates

Templates chosen for overlap in routes, tags, and category.

View all in General

Get this template

1 file