Skip to content

Backend framework that turns MongoDB into secure REST, GraphQL, and WebSocket APIs — no SDKs or backend code required.

License

SoftInstigate/restheart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RESTHeart

The backend framework that instantly turns MongoDB into REST, GraphQL, and WebSocket APIs — no code required.

GitHub last commit Build snapshot release Github stars Maven Central Version javadoc Docker Pulls Join the chat on Slack


What is RESTHeart?

RESTHeart is a Java backend framework that instantly exposes your MongoDB database through secure REST, GraphQL, and WebSocket APIs — no backend code required.

The framework allows direct data access through standard HTTP clients, without requiring SDKs or specialized libraries.

For example, MongoDB documents can be queried directly from a browser using standard JavaScript:

const url = encodeURI('https://demo.restheart.org/messages?filter={"from":"Bob"}&pagesize=1');

fetch(url)
  .then(response => response.json())
  .then(json => console.log(JSON.stringify(json, null, 2)));

📄 Complete documentation available at https://restheart.org/docs/


Why RESTHeart?

RESTHeart isn’t just a MongoDB REST layer — it’s a complete backend foundation.

Capability Description
🧩 Automatic API generation Exposes MongoDB collections and documents via REST and GraphQL
⚙️ Plugin framework Extend functionality with custom services, interceptors, and validators in Java or JavaScript
🔐 Security layer Built-in authentication, authorization, role-based access control, and TLS support
💬 WebSocket support Real-time data updates and change stream notifications
🚀 Undertow-based runtime Non-blocking I/O with Virtual Threads (Project Loom) support
🌐 Polyglot plugins Run JavaScript or Python plugins when using GraalVM
📈 Monitoring Prometheus metrics, health checks, and observability endpoints
🧰 Development tools CLI tooling, hot-reload support, Docker images, and native compilation

RESTHeart is suitable for:

  • 🚧 Rapid prototyping and MVPs
  • 🧠 Scalable microservices architectures
  • 🧩 Enterprise backends extending MongoDB with custom logic
  • ☁️ Deployments on AWS, GCP, Azure, or RESTHeart Cloud

Quick Start

Run MongoDB + RESTHeart in 30 seconds:

curl https://raw.githubusercontent.com/SoftInstigate/restheart/master/docker-compose.yml --output docker-compose.yml && docker compose up --pull=always --attach restheart

Verify the deployment:

curl localhost:8080/ping

RESTHeart is now running and connected to MongoDB.


Examples

Query documents via REST

curl 'http://localhost:8080/people?filter={"age":{"$gt":30}}'

Query documents via GraphQL

{
  people(filter: "{'age': {'$gt': 30}}", pagesize: 5) {
    _id
    name
    age
  }
}

Receive real-time updates via WebSocket

const ws = new WebSocket("wss://demo.restheart.org/ws/messages");
ws.onmessage = e => console.log("New message:", e.data);

Configuration

RESTHeart configuration is managed through a YAML file or the RHO environment variable for runtime overrides.

Configurable components include:

  • MongoDB connection strings and client settings
  • Authentication mechanisms and user management
  • Authorization policies and ACL rules
  • Plugin configuration and registration
  • Metrics collection and logging levels

See the Configuration Guide.


Plugin Architecture

The plugin architecture allows extending RESTHeart with custom services, interceptors, and validators.

  • Implement custom APIs in Java, JavaScript and other GraalVM suported languages
  • Register plugins via configuration or programmatically at runtime
  • Use the restheart-cli tool for scaffolding, testing, and hot-reload during development

RESTHeart Cloud

Want RESTHeart as a managed service?
RESTHeart Cloud provides:

  • Managed deployment and infrastructure
  • Automatic scaling and load balancing
  • Centralized monitoring and logging
  • API management and publishing capabilities

Suitable for production deployments or development environments.


Supported Databases

  • ✅ MongoDB / MongoDB Atlas
  • ✅ Percona Server for MongoDB
  • ⚙️ FerretDB (partial)
  • ⚙️ Amazon DocumentDB (partial)
  • ⚙️ Azure CosmosDB (partial)

Compatibility depends on MongoDB wire protocol support.


Community and Support

  • 📄 Documentation - Comprehensive configuration, development and deployment documents.
  • 🤖 Ask Sophia — AI-powered documentation assistant
  • 💬 Slack — Community discussion channel
  • 🐛 GitHub Issues — Bug reports and feature requests
  • 💡 Stack Overflow — Technical questions
  • 📅 Book a demo — Schedule a consultation

Made with ❤️ by SoftInstigate

About

Backend framework that turns MongoDB into secure REST, GraphQL, and WebSocket APIs — no SDKs or backend code required.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors 30