Virtual Threads Powered API Framework with ✅ Instant REST, GraphQL and Websockets APIs for MongoDB and ✅ Declarative SecurityMongoDB
RESTHeart is a Java backend framework that facilitates the rapid development of REST, GraphQL, and WebSocket APIs, leveraging MongoDB for data storage.
RESTHeart is designed for:
✅ 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.
(*) Might be partially compatibile with MongoDB.
mongodb://127.0.0.1
."/"
) is, by default, mapped to a database named "restheart"
. If you want to expose existing databases and collections through the API, you must update your configuration by replacing the default admin password and explicitly mapping your own databases to API endpoints.Before digging the full documentation, our AI assistant Sophia can quickly help you with any question about RESTHeart.
$ curl https://raw.githubusercontent.com/SoftInstigate/restheart/master/docker-compose.yml \
--output docker-compose.yml \
&& docker compose up --pull=always --attach restheart
$ 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.
restheart.tar.gz
or restheart.zip
archivecd restheart
localhost:27017
and then run RESTHeart with its default configuration:$ java -jar restheart.jar
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
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.
To build from source or to run the integration tests suite look at BUILD.md.
The full documentation is available on restheart.org/docs.
To explore the APIs, start with:
![]() |
If you enjoy using this open-source project, you can support the development of RESTHeart via the GitHub Sponsor program.
Made with ❤️ by SoftInstigate. Follow us on Twitter.