Quickstart ๐ฎ
Get started with Propel in 5 minutesโ
This guide explains how to set up Propel in under 5 minutes. We will go over how to:
- Create a Propel account
- Create a Data Pool with sample data
- Define a Metric
- Query the data
- Create a Propel Application and get the API credentials
- Run the Propel Next.js Starter App
At Propel, we love tacos. So our demo data for the quickstart is "TacoSoft", an imaginary SaaS application for taquerias to sell tacos ๐ฎ!
Let's get started ๐
1. Create a Propel accountโ
Creating a Propel account is straightforward. Navigate to theย sign-up page, provide an email, provide a password, and select your data residency region. Accept the Terms of Service and clickย "Get Started".
You will receive a confirmation email. Click on the link to confirm your email and log in again.
Once you log in, your account will be created, and you will land in the Propel Console.
2. Create a Data Pool with sample dataโ
Next, we need to get the TacoSoft data into Propel.
You'll need to create a Data Pool (Propel's high-speed data store and cache) based on this data.
Go to Data Pools, then click "Create Data Pool". You will see all data sources supported, as well as the "TacoSoft Demo Data".
Select the "TacoSoft Demo Data", then click Create Data Pool.
Once you create it, you will see the "TacoSoft Demo Data" Data Pool.
You can click on it and the Data Pool will start syncing.
Once it's finished, on the "Preview Data" tab, you can see the actual data.
3. Define a Metricโ
Now that you have loaded the TacoSoft demo data into your Propel account, you can model it into a metric representing a business key performance indicator (KPI).
For our quickstart, we are going to create a "Revenue" metric to uncover insights about our taco sales. We not only want to see taco sales over time but also want to be able to filter and break the revenue down by restaurant name, taco name, sauce name, toppings, and tortilla name.
Go to the Metrics section and click "Create Metric". Enter the following information:
- Give your Metric a unique name: "Revenue"
- Give your Metric a description: "The taco sales in dollars. Sums the taco_total_price of order items."
- Select the "TacoSoft Sales Data" Data Pool to power your Metric.
- Select the "SUM" Metric type. Once you select the "SUM" type, you'll be prompted to select a measure that represents the column you need to sum.
- To represent sales, we'd want to sum the
taco_total_price
column. - You can optionally add filters if you need to exclude certain records from the sum calculation. For our quickstart, we are going to leave the metric without filters.
- Click "Next".
Next, we'll want to select the Data Pool columns that we want to have as dimensions on our metric to break down and filter by. Select the taco_name
, sauce_name
, restaurant_name
, tortilla_name
, and toppings
columns.
Once your Metric is created, you'll see that you don't have any query activity yet. This is expected behavior.
4. Query the dataโ
Now that you have a Data Pool with data and a Metric defined, let's query it!
While on the "Revenue" Metric, click on the "Playground" tab, then click "Run query".
The Playground will help you explore the data, and on the right-hand side, it will show you the GraphQL API request for that query. You can try out the different queries: Time Series, Counter, and Leaderboard.
๐๐พ๐ You've made your first query!
5. Create a Propel Application and get the API credentialsโ
Next, you'll want to make queries from an application. You'll need to create a Propel Application to make API requests to Propel from your application. Propel Applications provides the API credentials allowing your client- or server-side app to access the Propel API.
Go to the Applications section and click "Create Application". Enter the following information:
- Give your Application a unique name: "TacoSoft App"
- Give your Application a description: "The TacoSoft sample app."
- For the API scopes, you'll want your Propel Application to have the "METRIC_QUERY" scope. This allows your app to list the available metrics and query their data.
- The Propeller is the serverless compute for your Propel Application. The larger the compute, the faster the queries. For our Quickstart, you can select "P1_X1_SMALL".
- Click "Create"
6. Run the Propel Next.js Starter Appโ
The Propel Next.js Starter App is a simple web application that demonstrates how to use the Propel GraphQL API and our open-source UI Kit library to display data visualizations in a web browser. Install it using the following commands.
First, clone the repo for the Propel Next.js Starter App:
git clone https://github.com/propeldata/propel-nextjs-starter-app.git
or
gh repo clone propeldata/propel-nextjs-starter-app
Once you've cloned the repo, cd
into its directory:
cd propel-nextjs-starter-app
You'll need to set your Propel Application's client ID and secret in a .env.local
file. To do this, first make a copy of the .env.sample
included in the app's root directory:
cp .env.local.sample .env.local
Then, update the .env.local
file to include your Propel Application's client ID and secret:
CLIENT_ID=1jbโฆ
CLIENT_SECRET=1ogโฆ
Install dependencies:
npm install
Now you are good to run the app locally!
npm start
Go to http://localhost:3000. Select the "Revenue" metric you created.
Then click on the different visualizations to learn different ways to visualize the data.
Now you have a working Next.js app serving data from Propel.