An end-to-end data engineering portfolio project: GitHub Public Events API โ GCS โ BigQuery โ dbt โ Looker Studio
๐ Live dashboard: https://datastudio.google.com/reporting/2e818060-5605-4271-b210-12f480cc8903
ServerlessPulse collects events from GitHub's public events API, stores raw files in Google Cloud Storage (GCS), loads data into BigQuery, transforms it with dbt, and presents insights in a three-page Looker Studio dashboard. Cloud Run Jobs, Cloud Workflows, and Cloud Scheduler automate the pipeline.
Warning
Data-scope warning: Metrics represent observed public GitHub events collected by ServerlessPulse during the selected period. They do not represent all GitHub activity or all GitHub developers. GitHub's public events API is a limited, changing feed, not a complete historical archive.
- Project overview
- Architecture
- Dashboard showcase
- Technology stack
- Pipeline and storage
- BigQuery and dbt models
- Dashboard calculations
- Setup and execution
- Deployment and orchestration
- Validation
- Limitations and data quality
- Security
- Troubleshooting and costs
- Repository structure
- Future improvements
- License and contact
ServerlessPulse explores observed public GitHub events to understand event types, repository activity, and activity patterns over time. It demonstrates API ingestion, raw-file landing storage, data warehousing, SQL transformations, testing, cloud orchestration, and dashboard delivery.
- Python ingestion from the GitHub Public Events API.
- Hourly automated runs: Cloud Scheduler triggers Cloud Workflows every hour (UTC) to fetch new events, then refresh the dbt models, so the dashboard
stays current without manual work. - Bounded pagination, retries for selected transient errors, rate-limit logging, and event-ID deduplication within an ingestion run.
- JSON, NDJSON, and run-metadata files stored in GCS.
- BigQuery RAW, staging, and analytics layers.
- dbt models for event-level, hourly, repository-level, and event-type analysis.
- pytest unit tests and configured dbt data tests.
- Dockerized Cloud Run Jobs orchestrated by Cloud Workflows and Cloud Scheduler.
- Interactive Overview, Repository, and Developer dashboard pages.
flowchart LR
A[GitHub Public Events API] --> B[Python ingestion]
B --> C[Cloud Storage: JSON, NDJSON, metadata]
C --> D[BigQuery RAW]
D --> E[dbt staging view]
E --> F[dbt analytics models]
F --> G[Looker Studio dashboard]
flowchart TD
A[Cloud Scheduler<br/>hourly UTC] --> B[Cloud Workflows]
B --> C[Cloud Run ingestion job]
C --> D[Cloud Run dbt job]
D --> E[BigQuery analytics refreshed]
Ingestion and dbt are separate Cloud Run Jobs. The workflow coordinates ingestion first, then transformation. Retry and failure behavior is defined in the deployed workflow.
The Looker Studio report has three pages with a dark, GitHub-inspired theme and an original project logo. The project is independent and is not affiliated with GitHub.
Live dashboard: https://datastudio.google.com/reporting/2e818060-5605-4271-b210-12f480cc8903
- KPIs: Total Observed Events, Active Repositories, Active Developers, and Events per Active Hour.
- Charts: observed events over time, event mix, event-type table with heatmap, and an hour-by-weekday UTC heatmap.
- Controls: Event and Weekday.
- Default date window: last 30 days.
- KPIs: Repositories Observed, Organizations, Events per Repository, and Repeat Repositories.
- Charts/tables: top 10 repositories by events, top 10 organizations by events, newly observed repositories per day, and repository details with clickable GitHub links.
- Controls: searchable Organization and Repository dropdowns.
- KPIs: Active Developers, Peak Developers / Hour, Bot Accounts, and Bot Share of Events.
- Charts: active developers per hour, human-versus-bot event mix, event groups by developer type, and average developers by UTC hour.
- Default date window: last 7 days.
| Area | Technologies |
|---|---|
| Language / ingestion | Python 3.11, Requests; Pandas where used |
| Cloud | Google Cloud Platform |
| Storage | Google Cloud Storage |
| Warehouse | BigQuery |
| Transformations | dbt Core, dbt-bigquery |
| Containers | Docker, Artifact Registry |
| Execution | Cloud Run Jobs |
| Orchestration | Cloud Workflows, Cloud Scheduler |
| Visualization | Looker Studio |
| Testing | pytest, configured dbt tests |
| Tools | Git, GitHub, Google Cloud CLI, BigQuery CLI |
- Python fetches events from the GitHub Public Events API.
- The client uses bounded pagination, selected transient-error retries, and API/rate-limit logging.
- Event IDs are deduplicated within the current ingestion run.
- The job creates JSON, NDJSON, and run metadata files.
- Files are uploaded to GCS.
- NDJSON is loaded into the BigQuery RAW table using the configured schema.
- dbt structures fields in staging and builds analytical models.
- Python and dbt tests validate configured behaviors and data assumptions.
- Looker Studio visualizes the BigQuery data.
- Cloud Scheduler triggers Cloud Workflows, which runs ingestion before dbt.
| Resource | Name |
|---|---|
| Project | serverlesspulse |
| Region | asia-south1 |
| GCS bucket | gs://serverlesspulse-raw-85927034024 |
| RAW table | serverlesspulse.serverlesspulse_raw.github_events_raw |
| Staging view | serverlesspulse.serverlesspulse_staging.stg_github_events |
| Main fact | serverlesspulse.serverlesspulse_analytics.fct_github_events |
| Ingestion job | serverlesspulse-ingestion-job |
| dbt job | serverlesspulse-dbt-job |
| Workflow | serverlesspulse-pipeline |
| Scheduler | serverlesspulse-dbt-hourly |
| Artifact Registry | asia-south1-docker.pkg.dev/serverlesspulse/serverlesspulse-dbt |
The scheduler runs on 0 * * * * in Etc/UTC, meaning hourly at minute 00 UTC.
gs://serverlesspulse-raw-85927034024/
โโโ github_events/
โโโ ingestion_date=YYYY-MM-DD/
โโโ hour=HH/
โโโ github_events_YYYYMMDD_HHMMSS.json
โโโ github_events_YYYYMMDD_HHMMSS.ndjson
โโโ github_events_YYYYMMDD_HHMMSS_metadata.json
Files follow this naming convention; individual runs may not produce identical sets of files.
github_events/: root prefix for event data.ingestion_date=YYYY-MM-DD/: groups objects by ingestion date.hour=HH/: groups objects by ingestion hour..json: event payload in JSON format..ndjson: one JSON record per line, suitable for BigQuery loading._metadata.json: run metadata generated by the ingestion process.
GCS is the raw-file storage layer; BigQuery is the warehouse used for SQL analysis. To inspect the bucket:
gcloud storage ls gs://serverlesspulse-raw-85927034024/
gcloud storage ls --recursive gs://serverlesspulse-raw-85927034024/github_events/serverlesspulse
โโโ serverlesspulse_raw
โ โโโ github_events_raw
โโโ serverlesspulse_staging
โ โโโ stg_github_events [VIEW]
โโโ serverlesspulse_analytics
โโโ fct_github_events
โโโ fct_hourly_activity
โโโ dim_repositories
โโโ agg_repository_activity
โโโ agg_event_type_trends
- RAW: ingested source records and event payload.
- STAGING: cleaned and structured fields;
stg_github_eventsis a view. - ANALYTICS: models intended for analysis and dashboard use.
| Model | Materialization | Purpose |
|---|---|---|
stg_github_events |
View | Extracts useful fields from raw JSON and structures IDs, types, actors, repositories, organizations, and timestamps. |
fct_github_events |
Incremental table | Main event-level analytical dataset; uses event_id as its unique key. |
fct_hourly_activity |
Table | Hourly event counts and distinct actors/repositories. |
dim_repositories |
Table | Repository attributes, organization where available, counts, and first/last observed timestamps. |
agg_repository_activity |
Table | Repository event counts, unique actors, and push/create/delete counts. |
agg_event_type_trends |
Table | Event counts grouped by event date and event type. |
github_events_raw
|
v
stg_github_events
|
v
fct_github_events ---> Overview and developer event analysis
stg_github_events
|----> fct_hourly_activity
|----> dim_repositories
|----> agg_repository_activity
โ----> agg_event_type_trends
Important
Distinct counts (actors, repositories) cannot be summed across hourly buckets to get overall distinct totals.
The dashboard uses these calculated fields:
- Hour of Day: hour extracted from
created_atoractivity_hour. - Weekday: weekday number and short label, sorted Monday through Sunday.
- Event Group: Push, Create, Delete, Pull request, Other.
- Developer Type: Bot when
actor_loginends in[bot]; otherwise Human. - Bot Accounts / Bot Share of Events: bot-account count and proportion of events classified as bot events.
- Repository Link: clickable URL to the public GitHub repository.
- Events per Repository / Repeat Repositories / Organization Name: repository-level calculations and display fields.
Date fields such as created_at, first_observed_at, and activity_hour are retyped as date/time fields for grouping.
- Python 3.11 and Git.
- Google Cloud CLI.
- A Google Cloud project with billing enabled and appropriate IAM access.
- Docker if building/testing containers locally.
- Looker Studio access to reproduce or edit the report.
Official documentation: Python ยท Git ยท Google Cloud CLI ยท BigQuery ยท Cloud Run Jobs ยท dbt BigQuery setup ยท Looker Studio
git clone https://github.com/Hemang648/serverlesspulse.git
cd serverlesspulseWindows CMD virtual environment:
py -3.11 -m venv .venv
.venv\Scripts\activateInstall dependencies if requirements.txt exists:
python -m pip install --upgrade pip
pip install -r requirements.txtAuthenticate for local development:
gcloud auth login
gcloud config set project serverlesspulse
gcloud config set run/region asia-south1
gcloud auth application-default loginTip
Use least-privilege access. Do not download or commit service-account private keys for convenience.
python -m pytestRun from the directory containing dbt_project.yml, after configuring a local dbt profile:
dbt debug
dbt run --select stg_github_events
dbt run --select fct_github_events
dbt run
dbt testdbt debugchecks project/profile configuration and connectivity.- Selecting
stg_github_eventsbuilds the staging view. - Selecting
fct_github_eventsbuilds or updates the fact model according to its materialization. dbt runruns models according to project configuration and dependencies.dbt testruns tests defined in the project.
Keep local profile files such as profiles.yml out of version control.
The pipeline is deployed as two separate container images: Dockerfile.ingestion for ingestion and a dbt Dockerfile for transformation.
Deployment sequence:
- Build the appropriate image.
- Tag it with the Artifact Registry path.
- Push it to Artifact Registry.
- Update the corresponding Cloud Run Job.
- Run a manual job execution and inspect logs.
- Execute the workflow and verify ingestion completes before dbt starts.
- Confirm analytics reflects the latest RAW batch.
Do not rebuild the dbt image when only ingestion code changes.
Inspect scheduler and workflow history:
gcloud scheduler jobs describe serverlesspulse-dbt-hourly --location=asia-south1
gcloud workflows executions list projects/serverlesspulse/locations/asia-south1/workflows/serverlesspulse-pipeline --limit=5Review Cloud Run and Workflows logs when troubleshooting.
Validate each layer independently:
| Layer | What to check |
|---|---|
| Python | pytest output |
| GCS | Expected JSON, NDJSON, and metadata objects exist |
| RAW | Latest batch row counts and event IDs |
| dbt | Run results and configured data tests |
| Analytics | Compare latest ingestion timestamps in RAW and analytics |
| Orchestration | Scheduler configuration and recent Workflow execution states |
| Dashboard | Refresh the report, check data sources and date controls, and test its viewer link privately |
Warning
Data Scope: Metrics represent observed public GitHub events collected by ServerlessPulse during the selected period. They do not represent all GitHub activity or all GitHub developers.
- Limited source history: The public events API is a changing, limited feed, not a complete historical archive. The oldest returned event does not prove continuous coverage from that date.
- Bounded pagination: The client fetches up to 10 pages per run; this does not guarantee complete historical coverage.
- Deduplication scope: Event IDs are deduplicated within one ingestion run. The RAW table uses append behavior, so duplicates across runs may exist unless downstream logic removes them.
- Incremental model:
fct_github_eventsis incremental withevent_idas its unique key, so repeated IDs and null keys are worth testing. - Bot definition: An account is classified as a bot when
actor_loginends in[bot], a naming convention used by automation accounts such as Dependabot or GitHub Actions. These are apps that run automatically, not people. This rule misses bots that do not use that suffix and may not identify every automation account correctly. - Repository identity: Grouping only by repository name can combine different repositories with the same name. Prefer a stable repository ID or owner/name key where available.
- Missing fields: Some events may not have actor, repository, or organization details.
- Partial days: The latest day may contain only partial data; spikes and daily totals require care.
- Newly observed is not created: The dashboard records when the pipeline first observed a repository, not when it was created.
- UTC: Time-based dashboard titles specify UTC.
- Quiet periods: A quiet day may reflect a collection gap rather than no GitHub activity.
Before making the repository public:
- Do not commit
.envfiles, service-account JSON keys, tokens, local dbt profiles, or other secrets. - Review
.gitignore,.dockerignore, tracked files, and commit history. - Prefer attached service accounts and Application Default Credentials over downloaded private keys.
- Grant only required IAM permissions; do not use broad Owner/Editor roles as a shortcut.
- Check Looker Studio data-source credentials before enabling public viewing.
- Remember that a public dashboard can expose public repository and organization names.
Example ignore rules (adapt to the actual project)
.venv/
venv/
__pycache__/
.pytest_cache/
*.py[cod]
.env
.env.*
!.env.example
profiles.yml
.user.yml
target/
dbt_packages/
logs/
raw_data/
*.key
*service-account*.jsonCaution
Ignoring a file does not remove it from Git history if it was committed previously. Review existing commits before publishing.
Troubleshooting table
| Symptom | Checks |
|---|---|
| Authentication failure | Check gcloud auth list and gcloud config list. |
| Permission denied | Verify the runtime identity and minimum required IAM permissions. |
| Bucket/dataset not found | Check project, bucket, dataset, and location names. |
| BigQuery schema mismatch | Inspect the actual table schema and compare it with the load config and dbt SQL. |
| Cloud Run image pull failure | Confirm image path/tag and Artifact Registry permissions. |
| Container startup failure | Review Cloud Run logs, command, dependencies, and environment configuration. |
| dbt profile failure | Check dbt_project.yml, local profile path, adapter, and region. |
| dbt tests fail | Inspect failing rows, nulls, unique-key assumptions, and incremental behavior. |
| Workflow fails | Identify the failing step and inspect the corresponding job logs. |
| GitHub rate limit | Review rate-limit logs and the configured retry behavior. |
| Docker build/push failure | Confirm Docker is running, authentication, project/region, and repository name. |
Potential charges include BigQuery storage/query processing, Cloud Run executions, Workflows, Scheduler, Artifact Registry, GCS storage/operations, and logging.
- Set billing budgets and alerts.
- Monitor query and storage usage.
- Avoid unnecessary full refreshes.
- Disable scheduled runs when not needed.
- Review resources before leaving the project running.
- Verify targets before destructive cleanup; deleting buckets, tables, or images can permanently remove data.
serverlesspulse/
โโโ ingestion/
โ โโโ main.py
โ โโโ github_client.py
โ โโโ bigquery_loader.py
โ โโโ storage_uploader.py
โโโ dbt_project/
โ โโโ dbt_project.yml
โ โโโ models/
โ โโโ staging/
โ โโโ analytics/
โโโ tests/
โ โโโ test_github_client.py
โโโ docs/
โ โโโ architecture.png
โ โโโ architecture.mmd
โ โโโ dashboard-overview.png
โ โโโ dashboard-repository.png
โ โโโ dashboard-developer.png
โโโ Dockerfile
โโโ Dockerfile.ingestion
โโโ requirements.txt
โโโ workflow.yaml
โโโ .gitignore
โโโ .dockerignore
โโโ README.md
Do not commit local virtual environments, generated event dumps, caches, or credential-bearing profile files.
Potential next steps:
- Robust cross-run deduplication.
- Better backfill support where a suitable historical source exists.
- More orchestration retries, alerts, and pipeline-health monitoring.
- Broader data-quality checks and CI testing.
- Partitioning/clustering where justified by workload.
- Stable repository identity handling.
- Bot classification beyond the
[bot]suffix heuristic. - Dashboard data-freshness and pipeline-health indicators.
- A daily developer aggregate if distinct-developer trend queries become expensive.
No license has been selected yet.
This is an independent portfolio project using public GitHub event data and Google Cloud services. It is not affiliated with, endorsed by, or sponsored by GitHub, Google Cloud, or Looker Studio. All names and marks belong to their respective owners.
Hemang Joshi



