~/danroylex
Danroylex Mboya
All work
2025·Solo backend engineer · cloud-native learning project

Restaurant Analytics Platform

Cloud-native, event-driven analytics on GCP

GoCloud RunPub/SubBigQueryCloud StorageOpenAI APIGitHub Actions
//0x01problem

Restaurant operators have order data, but turning it into revenue and volume trends usually means a manual export-and-spreadsheet routine that lags behind the business.

//0x02architecture
Order EventAPI writesPub/Sub TopicdecoupledCloud Run WorkersubscriberBigQuerypartitioned by dateAI InsightsClaude / OpenAI
//0x03technical challenges
  • Reporting workloads shouldn't compete with the latency-sensitive order-taking path
  • Revenue and volume queries need to stay fast as historical data grows
  • Raw metrics tables are not useful to a non-technical restaurant owner
  • The pipeline needed to be deployable and observable without a platform team
//0x04solutions

Pub/Sub-decoupled ingestion

Order events are published to a Pub/Sub topic the moment they occur. A separate Cloud Run worker subscribes and writes to BigQuery — so reporting load never touches the order-taking path.

Partitioned BigQuery tables

Order and revenue events land in date-partitioned BigQuery tables, keeping trend queries over weeks or months fast and cost-predictable as data accumulates.

Natural-language insight layer

A small Go service aggregates BigQuery results and passes them to the OpenAI API to generate plain-language summaries — turning 'revenue by hour' tables into a sentence an owner can act on.

CI/CD to Cloud Run

GitHub Actions builds and deploys each service to Cloud Run on push, with environment-scoped configuration for staging and production.

//0x05results
  • Order ingestion fully decoupled from analytics processing via Pub/Sub
  • Date-partitioned BigQuery schema for revenue and volume trend queries
  • Aggregated metrics translated into plain-language summaries via an LLM layer
  • Automated build-and-deploy to Cloud Run on every push