Skip to main content

MagnexisDB - a developer-first document database with realtime observability.

Project description

MagnexisDB

Magnexis logo

License: All Rights Reserved Status: Private Python FastAPI WebSockets CLI

MagnexisDB is a production-oriented document database built for developer experience, realtime updates, and transparent observability created by Magnexis.

Proprietary status

This repository is proprietary Magnexis software.

  • External contributions are not being accepted.
  • This is not an open contribution project.
  • All rights are reserved by Magnexis.

See LICENSE for the full terms.

What changed

This repo now has a Railway deployable split:

  • frontend: React + Vite admin console, deployable as a Railway frontend service
  • backend: Railway-ready FastAPI service entrypoint
  • api, core, models, realtime, utils: shared database engine and HTTP surface
  • cli: expanded operator CLI with local, remote, and release-oriented commands

Highlights

  • JSON document storage with nested fields and dynamic schemas
  • Query engine with equality, comparison, inclusion, sorting, and pagination
  • Field indexes backed by SQLite persistence and WAL durability
  • FastAPI HTTP API plus WebSocket live collection streams
  • React operator console for collections, queries, tracing, and insights
  • Typer CLI for local administration, remote calls, streaming, and release metadata
  • Query Replay and Smart Query Insights built in
  • Snapshot export, snapshot import, operation-log recovery replay, and collection introspection
  • Mongo-like find, findOne, insertOne, updateOne, replaceOne, deleteOne, countDocuments
  • Mongo-like insertMany, updateMany, deleteMany, aggregation pipelines, $lookup, $facet, $bucket, and array filters
  • Built-in execution tracing, natural query language, zero-setup sync import/deploy, and REST-style collection endpoints

Monorepo layout

MagnexisDB/
|-- backend/          # Railway entrypoint and env config
|-- frontend/         # React operator console for Railway
|-- api/              # FastAPI routes and app factory
|-- cli/              # Typer CLI
|-- core/             # storage, query engine, indexes, orchestration
|-- models/           # request/response models
|-- realtime/         # subscription hub
|-- assets/           # shared Magnexis branding
|-- scripts/          # smoke and release helpers
`-- packaging/        # PyInstaller spec for CLI artifacts

Local quick start

python -m venv .venv
.venv\Scripts\activate
pip install -e .
magnexisdb serve --host 127.0.0.1 --port 8000

Frontend:

cd frontend
npm install
npm run dev

Set VITE_MAGNEXISDB_API_URL if your backend is not on http://127.0.0.1:8000.

Railway deployment

Deploy the repository as two Railway services: one for the FastAPI backend and one for the Vite frontend.

Backend service

Set the Railway root directory to the repository root. The root railway.json provides this start command:

python -m backend.main

Recommended backend environment:

MAGNEXISDB_DB_PATH=data/magnexis.db
MAGNEXISDB_ALLOWED_ORIGINS=https://your-railway-frontend.up.railway.app
MAGNEXISDB_LOG_LEVEL=info
MAGNEXISDB_VERSION=0.1.0

Health endpoint:

GET /health

Frontend service

Set the Railway root directory to:

frontend

The frontend service uses the start script in frontend/package.json:

Build command: npm run build
Start command: npm start

Set:

VITE_MAGNEXISDB_API_URL=https://your-railway-backend.up.railway.app

CLI surface

Local commands:

  • magnexisdb serve
  • magnexisdb health
  • magnexisdb doctor
  • magnexisdb create-collection users
  • magnexisdb list-indexes users
  • magnexisdb describe users
  • magnexisdb insert users "{\"name\":\"John\"}"
  • magnexisdb query users --filter "{\"age\":{\"$gt\":18}}"
  • magnexisdb explain .\query.json
  • magnexisdb trace .\query.json
  • magnexisdb profile-query .\query.json
  • magnexisdb watch users --filter "{\"status\":\"active\"}"
  • magnexisdb shell
  • magnexisdb release-manifest

Remote commands:

  • magnexisdb remote health --url https://your-backend
  • magnexisdb remote collections --url https://your-backend
  • magnexisdb remote query .\query.json --url https://your-backend
  • magnexisdb remote explain .\query.json --url https://your-backend
  • magnexisdb remote trace .\query.json --url https://your-backend
  • magnexisdb remote insert users "{\"name\":\"John\"}" --url https://your-backend

Release artifacts

The repo now includes:

  • packaging/magnexisdb-cli.spec for PyInstaller
  • scripts/build_release.py for local wheel + binary builds
  • .github/workflows/release-cli.yml for cross-platform CLI release artifacts

Local build:

python -m pip install build pyinstaller
python scripts/build_release.py

Developer scripts

PowerShell helpers are in scripts/dev.ps1:

powershell -ExecutionPolicy Bypass -File .\scripts\dev.ps1 install
powershell -ExecutionPolicy Bypass -File .\scripts\dev.ps1 start
powershell -ExecutionPolicy Bypass -File .\scripts\dev.ps1 smoke

Validation

  • powershell -ExecutionPolicy Bypass -File .\scripts\dev.ps1 smoke
  • python -m compileall api backend cli core models realtime utils scripts
  • npm run build from frontend

Mongo-like behavior

MagnexisDB supports a familiar subset of MongoDB-style operators:

  • query: $and, $or, $nor, $not, $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, $regex, $elemMatch
  • update: $set, $unset, $inc, $push
  • bulk: insertMany, updateMany, deleteMany
  • single-write parity: replaceOne, deleteOne, countDocuments, upsert
  • array-filtered updates: arrayFilters
  • aggregation stages: $match, $sort, $sortByCount, $skip, $limit, $project, $group, $unwind, $addFields, $count, $lookup, $facet, $bucket
  • group accumulators: $sum, $avg, $min, $max, $first, $last
  • expression helpers: $concat, $add, $subtract, $setUnion

API docs are available at /docs.

License

Copyright Magnexis. All rights reserved.

No license is granted for public use, redistribution, modification, or contribution without prior written permission from Magnexis.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

magnexisdb-0.1.0.tar.gz (40.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

magnexisdb-0.1.0-py3-none-any.whl (43.1 kB view details)

Uploaded Python 3

File details

Details for the file magnexisdb-0.1.0.tar.gz.

File metadata

  • Download URL: magnexisdb-0.1.0.tar.gz
  • Upload date:
  • Size: 40.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for magnexisdb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ba954c366de101eef11c4f28446d7cc0017b1dd39846a472a37b070fb702e7fc
MD5 5c9e881e15ca34b83c975668f378c2df
BLAKE2b-256 eb7ca48b872d0e6a9a5389f3db2d1020a930f6cc96d21cac2e2584d5a5a6d7e2

See more details on using hashes here.

File details

Details for the file magnexisdb-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: magnexisdb-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 43.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for magnexisdb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c776186bc18cb4fcf97c519f9e3f7e8abe281cb456fb7cd57118e78319a7bf45
MD5 3758948fc6f2bc92eadc03aef454374d
BLAKE2b-256 3a55bd53082d1b8bd1bfd508267635364826e5f16debc9b999aee8c67de4c28a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page