Skip to content

frolicorg/frolic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frolic Logo

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.

GitHub contributors GitHub issues GitHub stars GitHub closed issues GitHub pull requests GitHub commit activity GitHub license Twitter Follow

Web App Reference Architecture-2

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", // <table_name>.<column_name>
          "aggregate_operator": "sum"
        }
      ],
      "dimensions": [
        {
          "field": "products.category" // <table_name>.<column_name>
        }
      ]
}
'

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. Clone the project

git clone https://github.com/frolicorg/frolic.git

2. Configure your database

Configure your database in config.toml.

3. 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, Postgres & Clickhouse 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.

💬 Ask for help on Discord

⚠️ Open an issue right here on GitHub

How to Contribute

We ❤️ our contributors. We're committed to fostering an open, welcoming, and safe environment in the community.

📕 We expect everyone participating in the community to abide by our Code of Conduct. Please read and follow it.

🤝 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