Code Monkey home page Code Monkey logo

restaurant-analytics's Introduction

TLDR

Data engineering project to help restaurants and waiters understand through dedicated dashboards:

  • restaurants: sales statistics, key sales drivers and sales based on weather conditions
  • waiters: performance based on sales, customers served and tips

Tech stack: Python, Docker, dbt, Airflow, BigQuery, Looker

Pain

  • Restaurants are making decisions based on gut feeling, potentially missing out on opportunities to make their business more profitable.​
  • Waiters can only rely on subjective performance feedback from managers.

Solution

Restaurant sales report

This Looker dashboard enables restaurants to better understand sales, trends, and predict future sales

Some valuable insights:

  • πŸ“ˆ Sales trend over time
  • πŸ•™ Sales based on time of day / day of week
  • πŸš€ Top-selling drinks and foods
  • β˜€οΈ Weather filter to understand which drinks and food sell better depending on temperature and rainfall/snow

image

Waiter performance report

This dashboard enables waiters to understand their sales, number of customers served, and tips

image

Architecture

Data sources:

  • Sales data: real-world point of sales data (Tiller) of 20 restaurants in Paris over a period of 7 years (2015-2021)
  • Weather data: OpenWeatherMap data

Ingestion:

  • One-off data upload to BigQuery with Python
  • Daily data fetching from OpenWeatherMap API and upload to BigQuery with Python

Transformation:

Since this was real world data from restaurants with different semantics, data transformations concerned 3 categories:

  • Data cleaning: remove all non-relevant order items (e.g. deposits, promotions),
  • Consolidation: unify category types from over 400 to 8 different order categories
  • Value creation: selecting only relevant columns and adding columns allowing for valuable insights (e.g. extraction of tips, dinner duration, dine-in vs take-away, mapping of weather to orders)

All data was ingested in the bronze zone, data was then cleaned and stored in the silver layer, before being aggregated to 2 final tables for exposure in the dashboard (restaurant sales and waiter performance).

Hosting:

Docker compose to ensure availability and scalability

image

restaurant-analytics's People

Contributors

nicolasjonck avatar apollinejauffret avatar dohadata avatar mariamillet avatar

Watchers

 avatar

restaurant-analytics's Issues

Update sales model

Sales table:

  • Make order_item primary key (join order and order_details)
  • Add category column (438 different categories => to be cleaned later)
  • Add order_duration (order_closed - order_opened)
  • Add 'take-away' category to sales table
  • Add tip column (o.m_cached_price < p.m_amount)

Update waiter model

Waiter table:

  • Remove avg_working hours
  • Sum_tip => should be cached_price > m_amount (and not cached_mount)
  • Add store_id

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.