I rather enjoy being referred to as a "DoorDash VIP" when I call their customer support, despite the fact that being a DoorDash VIP is probably not a good thing. I knew my DoorDash spending habits were bad, but how bad warranted VIP status?
I wrote a couple scripts to web scrape and transform my order history data from the DoorDash website. The data (in the form of a JSON file) can be supplied to the dashboard.
The dashboard is initialized with random data. The randomized data can be shuffled by clicking the refresh icon in the navbar. Actual data in the form of a properly formatted JSON file can be supplied to the dashboard via clicking the attach/add icon in the navbar.
JSON data should be of the following format:
[
{
"storeName": "Store 1",
"date": "Oct 13 2023",
"cost": 121.67,
"itemCount": 3,
"items": ["item1", "item2", "item3"],
"wasCancelled": false,
"dayOfWeek": "Mon"
},
...
]
- React
- TypeScript
- JavaScript
- Python
- HTML
- CSS
- Material UI (for inputs)
- Material UI X Charts (for charts and data grid)
- Zod
- Jest
- Docker
- Vite
It is assumed all command line commands will be executed in a UNIX based command line environment.
Note: Confirm that Docker is running prior to proceeding and that port 8080
is not being used by another program.
- Clone this repository.
- cd into
docker
directory
cd docker/
- Build docker image and start container
docker compose up --build
- Visit http://localhost:8080
Note: Node is required to run the dashboard locally. This was developed using Node version v20.3.0
. git is used to download this repository in the steps below. It is assumed you are already familiar with both.
-
Clone this repository
-
Run the following commands from the root of this project on your local machine
cd app/
npm i
npm run dev
If you're interested, you can use my scripts and follow the method I used to grab my order history data (for your order history data). However, the method I used is relatively primitive and volatile, considering it isn't fully automated and is based on a particular version of the DoorDash website. If DoorDash updates the order history page, the script used to grab the order history will likely fail. This was sufficient for the scope of the project as I didn't anticipate much value in repeating this process (I wanted to identify trends but not monitor them).
Two scripts are used to get the order history and prepare the data for analysis. One script parses the data scripts/webScraper.js
. The other script transforms that data into a format better suited for performing analysis scripts/transform_data.py
.
- Log in to your DoorDash account via the DoorDash website.
- Visit the Order History page on the DoorDash website.
- Open the "developer tools" from the Order History page.
- Copy and paste the JavaScript from
scripts/webScraper.js
into the dev console. - Press Enter key and wait for script to finish running.
- Once the script is complete, copy the message printed in the dev console into an empty JSON file.
The data created from the web scraping steps need to be transformed before performing analytics. The file @ scripts/transform_data.py
is used to transform the data.
Note: Python is required to run the transform_data.py
script.
- Run the
transform_data.py
script and point it to the JSON file created of the order data printed fromwebScraper.js
.