RESTHeart

RESTHeart is a Java backend framework that facilitates the rapid development of REST, GraphQL, and WebSocket APIs, leveraging MongoDB for data storage.

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

Who Benefits from RESTHeart?

RESTHeart is designed for:

Key Features

Low-Code Development: Create APIs with minimal coding effort.
Seamless MongoDB Integration: Instantly expose your MongoDB collections via REST, GraphQL, and WebSocket APIs.
Built-in Security: Provides declarative authentication and authorization mechanisms.
High Performance: Utilizes Java 21 Virtual Threads for efficient concurrency.
Customizable: Flexible architecture that adapts to your specific needs.

Compatible Databases

(*) Might be partially compatibile with MongoDB.

Default Configuration

Ask Sophia AI!

Before digging the full documentation, our AI assistant Sophia can quickly help you with any question about RESTHeart.

Quick Start with Docker Compose

  1. Run both RESTHeart and MongoDB with Docker Compose using the following one-liner:
$ curl https://raw.githubusercontent.com/SoftInstigate/restheart/master/docker-compose.yml \
  --output docker-compose.yml \
  && docker compose up --pull=always --attach restheart
  1. Call RESTHeart's ping service with curl to verify it's running:
$ curl -i localhost:8080/ping

HTTP/1.1 200 OK
Connection: keep-alive
Access-Control-Allow-Origin: *
X-Powered-By: restheart.org
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: Location, ETag, Auth-Token, Auth-Token-Valid-Until, Auth-Token-Location, X-Powered-By
Content-Type: application/json
Content-Length: 112
Date: Fri, 21 Mar 2025 10:27:26 GMT

{"message": "Greetings from RESTHeart!", "client_ip": "127.0.0.1", "host": "localhost:8080", "version": "8.4.0"}

ℹ️ Look at Setup with Docker for more.

Running Without Docker

  1. Download a pre-built binary of RESTHeart from the Releases page.
  2. Uncompress the restheart.tar.gz or restheart.zip archive
  3. cd restheart
  4. Start MongoDB on localhost:27017 and then run RESTHeart with its default configuration:
$ java -jar restheart.jar

Connect to a remote MongoDB

To connect to a MongoDB server running in a remote host, you can quickly modify the configuration with the RHO env var.

Example:

$ RHO='/mclient/connection-string->"mongodb://127.0.0.1"' java -jar restheart.jar

Native executables

Or CI/CD pipeline builds native executables for main MacOS, Linux and Windows. Have a look at the Native Executables document for more information.

ℹ️ The native executables use the same configuration approach as the Java version.

Build from Source

To build from source or to run the integration tests suite look at BUILD.md.

Documentation

The full documentation is available on restheart.org/docs.

To explore the APIs, start with:

Community Support

Sponsors

If you enjoy using this open-source project, you can support the development of RESTHeart via the GitHub Sponsor program.

Made with :heart: by SoftInstigate. Follow us on Twitter.