Skip to content

chiefdfo/monasticx

Repository files navigation

🕯️ Monasticx

A disciplined data monastery — synchronizing MongoDB and Elasticsearch in silent harmony.


🧘 About

Monasticx is a TypeScript-based sync service designed to maintain perfect order between MongoDB and Elasticsearch.
Inspired by monastic discipline, it performs its work quietly and reliably — bringing structure, devotion, and clarity to your data flow. No noise. No chaos. Just disciplined synchronization.


⚙️ Features

  • 🔁 Real-time Sync: Uses MongoDB Change Streams to instantly capture and sync inserts, updates, and deletes.
  • 🧩 Self-Healing Reconciliation: A quiet, polling job runs every 2 minutes to scan for and repair any data that was missed during a connection drop or downtime.
  • ⚡ Batch-Powered Initial Sync: A simple API endpoint (POST /sync/initial) triggers a full, high-speed, batch-processed sync of your entire collection.
  • 🧘 Silent operation — runs continuously with minimal overhead
  • 🔍 Built-in Embeddings: Generates all-MiniLM-L6-v2 embeddings for all documents out-of-the-box. Models are downloaded on install, requiring no external API keys.

🚀 Getting Started

# Clone the repository
git clone https://github.com/chiefdfo/monasticx.git
cd monasticx

# or Install through npm
npm install -g monasticx

# Configure your environment variables
cp .env.example .env

# Run the service
npx monasticx

🪶 Philosophy

In monasteries, monks preserve knowledge through quiet devotion.
Monasticx follows the same principle — preserving data integrity and order between systems.
No noise. No chaos. Just disciplined synchronization.


📖 The API Scriptorium (Endpoints)

Once running, monasticx exposes a small API (defaulting to http://localhost:3000):

GET /sync/stats

Provides a real-time JSON object detailing the syncer's health, including total documents processed, error counts, and whether the change stream is running.

POST /sync/initial

Triggers a full re-sync of the entire collection. This is a "fire and forget" background task—the API will return a 202 Accepted message immediately while the sync begins.


🧠 Tech Stack

  • TypeScript
  • MongoDB
  • Elasticsearch
  • Node.js

📜 License

MIT License © chiefdfo

About

A disciplined data monastery — synchronizing MongoDB and Elasticsearch in silent harmony.

Topics

Resources

Stars

Watchers

Forks