sdairs / gsd_delivery_demo

Demo for Getting Stuff Done With Data conference

Home Page:gsd-delivery-demo.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parcel Delivery Demo

This is a demo built for the Getting Stuff Done With Data conference.

It shows how you can built data-driven applications using Tinybird.

You can find the live deployment here to play with the application.

Creating a free Tinybird account

First sign up for a free Tinybird account at tinybird.co.

Getting your Admin token

When logged into the Tinybird UI, go to 'Manage Auth Tokens' and copy your Admin token.

Running the demo locally

There are three parts to this demo:

  • a web application frontend
  • python scripts to simulate activity
  • Tinybird data projects

Start by cloning the repo.

Web application

Install the dependencies

npm install

Run the dev server

npm run dev -- --open

This will open the application in your browser.

By default, some tokens are hardcoded into the application that let you interact with the demo environment, hosted in a Tinybird managed account.

If you want to connect the web application to your own Tinybird account:

  1. See the Creating a free Tinybird account section.
  2. See the Getting your Admin token
  3. Modify the URL in your browser and add ?token=PASTE_YOUR_TOKEN_HERE at the end.

Tinybird data projects

The Tinybird data project can be found in tinybird/project.

To use the Tinybird data project, first:

  1. See the Creating a free Tinybird account section.
  2. See the Getting your Admin token

Now change to the Tinybird dir.

cd tinybird

Create a Python virtual environment.

python3 -m venv .venv

Activate the Python virtual environment.

source .venv/bin/activate

Install the dependencies.

pip install -r requirements.txt

Now change to the Tinybird project dir.

cd project

Authenticate the tinybird-cli with your Admin token.

tb auth

Paste your Admin token into the prompt.

Push the Tinybird project to Tinybird.

tb push

You can now refresh the Tinybird UI and you project will be ready.

Python scripts

Enter the event_processor directly.

cd event_processor

Create a Python virtual environment.

python3 -m venv .venv

Activate the Python virtual environment.

source .venv/bin/activate

Install the dependencies.

pip install -r requirements.txt

(Optional) Create a .env file and add your own Admin token.

The contents should look like

TB_TOKEN=PASTE_YOUR_TOKEN_HERE

In one shell session run:

python journey_completer.py

In another shell session run:

python order_event_generator.py

If you did not create a .env file, the scripts will prompt you to paste your Admin token before they start.

About

Demo for Getting Stuff Done With Data conference

gsd-delivery-demo.vercel.app


Languages

Language:Python 53.3%Language:Svelte 43.8%Language:JavaScript 1.4%Language:HTML 1.0%Language:TypeScript 0.4%