Frolic is an open source backend service (written in Rust) to build customer facing dashboards 10x faster. You can directly connect your database to the project and use ready made APIs to query data. You no longer have to write custom APIs for different dashboard components and create/maintain SQL queries for them.
You can also use frolic-react for your UI along with frolic to create full stack dashboards much faster.
Use single API to query data for all your dashboard components
You can use a single API endpoint provided by this project to query data for your dashboard.
Sample API Request:
curl --location 'http://localhost/api' \
--header 'Content-Type: application/json' \
--data '{
"metrics": [
{
"field": "products.price",
"aggregate_operator": "sum"
}
],
"dimensions": [
{
"field": "products.category"
}
]
}
'
You can pass the metrics you require in the metrics
field as an array. The field
of the metric is written in <table_name>.<column_name>
format. The aggregate_operator
can be used to specifiy what operation you want to apply on the specified <table_name>.<column_name>
.
The dimensions
field allows you to categorize the metrics returned by the API. To specify the column by which you want to categorize the metrics
, use the field
operator and specify the column name in <table_name>.<column_name>
format.
The data returned by the API will be a list of JSON which contains the dimensions and the attributes specified in the request.
The output of the above request will be as follows:
{
"data": [
{
"products.price": "51",
"products.category": "Gizmo"
},
{
"products.category": "Doohickey",
"products.price": "42"
},
{
"products.category": "Gadget",
"products.price": "53"
},
{
"products.category": "Widget",
"products.price": "54"
}
]
}
Running Project
1. Configure your database
Configure your database in config.toml.
2. Run the Project
Use docker to run the database
docker-compose up --build
You can start using the docker container path to query your data.
Features
-
🚀 Fast and Scalable APIs with Rust - Single API for all your dashboard requirements
- Automatically generates and execute SQL queries on your database
- Automatically handles complex table relationships
- Caching of API Calls (using memcached)
Integrations
We currently support MySQL database. We will add integrations with other databases in the future.
Why Rust?
Rust is much faster and performant compared to other web frameworks. We have build this project using actix-web
, which is one of the fastest web frameworks in the world. Checkout the comparison between ExpressJS and Actix-Web here.
Support and Community
Issues are inevitable. When you have one, our entire team and our active developer community is around to help.
How to Contribute
We ❤️ our contributors. We're committed to fostering an open, welcoming, and safe environment in the community.
🤝 If you'd like to contribute, start by reading our Contribution Guide.
Lets build great software together.
License
This project is available under the Apache License 2.0