RESTHeart - Ready to use backend for the modern Web.
REST, GraphQL and WebSocket APIs for MongoDB.
RESTHeart offers the following features:
Declarative authentication, authorization, and user management for your applications.
With RESTHeart, you can harness 100% of MongoDB's capabilities using simple HTTP calls, eliminating the need for programming!
Note: Schedule a free 1-to-1 demo and feel free to ask us anything!
During startup, RESTHeart automatically establishes a connection to the configured MongoDB database and provides comprehensive API access. Refer to the example session below, which employs HTTPie for making REST calls:
Developers can reduce backend code by at least 80% when managing security and delivering content to mobile apps, Angular, React, Vue, or other single-page application (SPA) frameworks.
RESTHeart works with any MongoDB compatible database. The actual features supported depend on the level of compatibility of the database with the official MongoDB Java driver.
Note: RESTHeart releases are tested in continuous integration with official MongoDB distributions only (from MongoDB 4.2 to 7.0).
- MongoDB Community, Enterprise and Atlas Cloud are 100% supported in all their functionalities.
- Azure Cosmos DB and Amazon DocumentDB offer partial support for the MongoDB API, but most common RESTHeart features work as expected.
- FerretDB offers partial support for the MongoDB API on top of PostgreSQL, but its level of compatibility with MongoDB is growing daily. FerretDB plans to support more relational databases in the future.
- Percona Server for MongoDB is, in general, fully compatible with MongoDB, so RESTHeart usually works perfectly with it.
RESTHeart incorporates Undertow, a versatile and high-performance web server crafted in Java. Undertow furnishes both blocking and non-blocking HTTP APIs built upon NIO. Notably, Undertow serves as the foundational HTTP server for RedHat's Wildfly.
Setting up RESTHeart is effortless, as it operates seamlessly after installation and configuration. It is exceptionally well-suited for deployment within a Docker container, making it a natural fit for deployment in Kubernetes and AWS ECS clusters.
RESTHeart additionally provides support for GraalVM, an innovative Java Virtual Machine developed by Oracle. GraalVM introduces a polyglot runtime environment and the ability to compile Java applications into native binary images.
To enhance the default functionality, you can implement the following Java interfaces:
- Service - Expands the API by introducing new web services.
- Interceptor - Observes and modifies requests and responses at various stages of the request lifecycle.
- Initializer - Executes initialization logic during startup.
- Providers - Implements the Dependency Injection mechanism to supply objects to other plugins using the @Inject annotation.
The default GraphQL plugin seamlessly coexists with the existing REST endpoints, yielding a managed and unified GraphQL API tailored for modern applications.
Furthermore, the embedded WebSocket server can expose MongoDB's Change Streams, permitting applications to access real-time data alterations.
Given these considerations, RESTHeart emerges as the ideal "low code," self-contained backend solution for contemporary web and mobile applications. Its design is centered on streamlining development and deployment processes.
Download prebuilt packages from releases
Find setup instructions at Setup documentation page.
Build from source
Note: Building RESTHeart from scratch requires at least Java 17 and maven 3.6.
$ ./mvnw clean package
You can then run it with (make sure to have
mongod running on
$ java -jar core/target/restheart.jar
Execute the integration tests suite
To execute the integration test suite:
$ ./mvnw clean verify
verify goal starts the RESTHeart process and a MongoDB Docker container before running the integration tests.
To avoid starting the MongoDB Docker container, specify the system property
The integration tests use the MongoDB connection string
mongodb://127.0.0.1 by default. To use a different connection string, specify the property
The following example shows how to run the integration test suite against an instance of FerretDB running on
# run FerretDB $ docker run -d --rm --name ferretdb -p 27017:27017 ghcr.io/ferretdb/all-in-one # execute the integration tests $ ./mvnw clean verify -DskipUTs -P-mongodb -Dtest-connection-string="mongodb://username:password@localhost/ferretdb?authMechanism=PLAIN" -Dkarate.options="--tags ~@requires-replica-set"
This example also specifies the karate options to skip tests tagged with
requires-replica-set (FerretDB does not supports change stream and transactions) and
-DskipUTs to skip the execution of unit tests.
Automatic snapshot builds
Snapshot builds are available from sonatype.org
Docker images of snapshots are also available:
$ docker pull softinstigate/restheart-snapshot:[commit-short-hash]
For commit short hash you need the first 7 digits of the hash, e.g.
$ git log commit 2108ce033da8a8c0b65afea0b5b478337e44e464 (HEAD -> master, origin/master, origin/HEAD) Author: Andrea Di Cesare <firstname.lastname@example.org> Date: Fri Oct 22 12:46:00 2021 +0200 :bookmark: Bump to version 6.2.0-SNAPSHOT ...
The short hash is
2108ce0 and the docker pull command is therefore
$ docker pull softinstigate/restheart-snapshot:2108ce0
The full documentation is available here.
You can also have a look at our introductory video on Youtube:
Contacts and Support
- Open a issue on GitHub to report a specific problem.
- Ask technical questions on Stackoverflow.
- Chat with other users on Slack.
- Book a free 1-to-1 demo with us.
- Write us an e-mail.
Become a Sponsor
You can support the development of RESTHeart via the GitHub Sponsor program and receive public acknowledgment of your help.