https://github.com/queritylib/querity-demo
Demo project for the Querity library
https://github.com/queritylib/querity-demo
database elasticsearch java jpa mongodb nosql query-builder spring spring-data sql
Last synced: 7 months ago
JSON representation
Demo project for the Querity library
- Host: GitHub
- URL: https://github.com/queritylib/querity-demo
- Owner: queritylib
- License: apache-2.0
- Created: 2025-03-10T17:35:25.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-21T05:11:31.000Z (7 months ago)
- Last Synced: 2025-07-22T02:04:04.115Z (7 months ago)
- Topics: database, elasticsearch, java, jpa, mongodb, nosql, query-builder, spring, spring-data, sql
- Language: Java
- Homepage: https://querity-demo.onrender.com
- Size: 1.01 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Querity - Demo Application
==========================
Welcome to **Querity Demo** – a minimal yet complete example showcasing the power and simplicity of the
[**Querity**](https://github.com/queritylib/querity) query language for full-stack filtering, sorting, and pagination.
This demo illustrates how to integrate Querity across both backend and frontend:
- **Backend**: A Spring Boot REST API using
[`querity-spring-data-jpa`](https://github.com/queritylib/querity/tree/main/querity-spring-data-jpa) to query an in-memory **H2** database of orders.
- **Frontend**: A React-based UI built with
[`@queritylib/react`](https://github.com/queritylib/querity-react) to construct dynamic queries and display results in a grid.
Querity enables expressive, consistent, and secure querying capabilities across your stack – from API consumers to the database layer – with minimal effort.
> 💡 Whether you're building internal tools or public APIs, Querity helps you deliver powerful query functionality without reinventing the wheel.
See the live demo at ➡️ [Querity Demo](https://querity-demo.onrender.com/) ⬅️.
## Running
Run the application with the following command:
```bash
./mvnw -Pwith-frontend spring-boot:run
```
Then open your browser to `http://localhost:8080`, you should see a simple web page with a form to query the orders.
There's also a Swagger-UI interface available at `http://localhost:8080/swagger-ui/index.html` to test the API.
Now try out the query language by replacing the query string with any valid query (see [Documentation](https://queritylib.github.io/querity/#query-language-syntax)).
Some examples:
`shippingCustomer.address.country="France" sort by placementDate desc page 1,20`
> This query filters by shipping address country, sorts the results by placement date in descending order and paginates
> the results, returning the first page with 20 elements.
`distinct and(rows.totalPrice>1000, currency="EUR") sort by totalPrice desc page 1,10`
> Notice how the above query string filters by a field nested in a collection (`rows.totalPrice`).
>
> In this case the `distinct` keyword is used to avoid duplicate rows and pagination issues.
## Other info
You can view the ER diagram of the database [here](/assets/er-diagram.png).
Test dataset generated with Mockaroo: https://mockaroo.com/85a9ebf0