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:
- Developers seeking a low-code solution to build scalable, secure, and high-performance APIs.
- Teams aiming to reduce development time and complexity when working with MongoDB.
- Businesses looking for a reliable and efficient way to expose data through REST or GraphQL APIs.
MongoDB has officially announced the deprecation of the Atlas Data API and HTTPS Endpoints for Atlas App Services, with complete removal scheduled for September 30, 2025. If your applications rely on these features, RESTHeart is an alternative solutions to ensure uninterrupted service.
✅ 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.
- MongoDB
- MongoDB Atlas Cloud Database
- Percona Server for MongoDB
- FerretDB (*)
- Amazon DocumentDB (*)
- Microsoft Azure CosmosDB (*)
(*) Might be partially compatibile with MongoDB.
- The default configuration connects to a local MongoDB instance using the connection string
mongodb://127.0.0.1
. - To prevent unintentional exposure of all your data, the API root (
"/"
) 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.
- 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
- 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: text/plain
Content-Length: 25
Date: Wed, 07 Aug 2024 10:48:23 GMT
Greetings from RESTHeart!
- Download a pre-built binary of RESTHeart from the Releases page.
- Uncompress the
restheart.tar.gz
orrestheart.zip
archive cd restheart
- Start MongoDB on
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.
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:
- Open an issue on GitHub to report a specific problem.
- Ask technical questions on Stack Overflow.
- Chat with other users on Slack.
- Book a free 1-to-1 demo with us.
|
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.