Skip to content

SlugLoop/SlugLoop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

531 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SlugLoop mark

SlugLoop

Real-time tracking for UC Santa Cruz's loop shuttles — field notes from a hackathon that went further than expected.

Four Baskin Engineering students reprogrammed the campus's decade-old GPS hardware over a weekend, put a live bus map online, and ended up the only U.S. team in the 2023 Google Solution Challenge global Top 10.


Live Demo video UCSC News Top 10 Global


Stars Forks License


Next.js React Firebase Express Google Maps Tailwind CSS PWA



Demo reel ↗  ·  The problem  ·  What it does  ·  Architecture  ·  Run it  ·  The team


Watch the SlugLoop demo

▶ SlugLoop product demo — real-time loop & Metro buses on one map.


▌ TL;DR

What A real-time map of UC Santa Cruz's loop shuttles (and nearby Santa Cruz Metro lines), built as an installable PWA.
Why The campus loop runs on no reliable schedule, so students crowd the Metro or gamble on a bus that may never come.
How Reprogrammed the campus's existing GPS hardware → an Express /ping ingest → Firestore → a live Google Map in the browser.
Result Top 10 global finalist — the only U.S. team in the 2023 Google Solution Challenge — covered by UCSC News, the Santa Cruz Sentinel, and Santa Cruz Works.

Note

This repo is a preserved case study. The map you see today is a frozen field-notebook demo. The original build ran a live hardware feed on Azure during the 2023 season. See Build context for the diff.


▌ The problem

UC Santa Cruz sprawls across a redwood hillside with serious elevation changes — getting to class on time means catching a loop shuttle. But the loop runs on no predictable schedule. So students either pile onto the city Metro (taking seats from people actually leaving campus) or wait for a loop that may not show, and end up late anyway.

There was no way to see where the buses actually were. The data existed — campus had installed GPS-emitting hardware on the buses years earlier — it just wasn't going anywhere useful.

SlugLoop's bet: don't deploy new hardware, revive the hardware already on the buses and put its signal on a map.


▌ Awards & recognition

Recognition Awarded by
🏆 Top 10 Global Finalist — only U.S. team Google Solution Challenge 2023
🥇 Best Use of GitHub CruzHacks 2023
📰 Featured: "UCSC team a Google Solution Challenge finalist" UCSC News, Santa Cruz Sentinel, Santa Cruz Works

SlugLoop began at CruzHacks 2023, then advanced through the Google Solution Challenge to a global Top 10 finish — the sole U.S. team in that round.


▌ What it does

🗺️ Live bus map

Every tracked loop shuttle as a moving marker on a Google Map, refreshed in real time straight from Firestore.

🚌 Loop + Metro in one view

Campus loop shuttles and nearby Santa Cruz Metro lines on the same map, so you can decide which to take.

🧭 Direction & nearest stop

Heading and next-stop logic so you know not just when a bus is near, but where it's going.

📲 Installable PWA

Standalone install, offline shell, and home-screen shortcuts to the map and timeline — no app store.

📓 Field-notebook site

A preserved case-study experience: the build journey, a project timeline, and a frozen demo of the map.

🔓 Open source

Apache-2.0, built to be handed off to the next cohort of UCSC students.


▌ Architecture

From the bus antenna to the browser
flowchart LR
  subgraph Field["▌ On the buses"]
    GPS["GPS units<br/>(reprogrammed)"]
    BS["Campus basestations"]
  end
  subgraph Cloud["▌ Backend"]
    PING["POST /ping<br/>Express API"]
    CRON["cronJob<br/>Metro poller"]
    FS[("Cloud Firestore")]
  end
  subgraph App["▌ Client"]
    PWA["Next.js 16 PWA"]
    MAP["Google Maps<br/>live markers"]
  end

  GPS -->|C / libcurl| BS
  BS -->|HTTP POST + PING_KEY| PING
  PING --> FS
  CRON -->|Metro lines| FS
  FS -->|realtime subscribe| PWA
  PWA --> MAP

  classDef field fill:#FFE8A3,stroke:#A8801F,color:#3a2f00;
  classDef cloud fill:#CDE7FF,stroke:#3E6CA8,color:#0a2440;
  classDef app fill:#C9F5D9,stroke:#2F8A57,color:#06321c;
  class GPS,BS field;
  class PING,CRON,FS cloud;
  class PWA,MAP app;
Loading
  1. On the bus — reprogrammed GPS units emit position; campus basestations receive it (some receivers push over HTTP using custom C + libcurl).
  2. Ingest — basestations POST /ping to the Express server with a shared PING_KEY secret; the server validates, parses bus ID / lat / lng / route, and writes to Firestore.
  3. Metro — a Dockerized cronJob polls nearby Santa Cruz Metro lines and writes them alongside the loop data.
  4. Client — the Next.js PWA subscribes to Firestore in real time and renders live markers on Google Maps. No polling the server — the map updates as the database does.

▌ Tech stack

Layer Tools
Frontend Next.js 16 (App Router), React 19, Framer Motion, Radix UI, Tailwind CSS v4
Maps Google Maps (google-maps-react-markers)
Realtime data Firebase · Cloud Firestore
Backend Node.js, Express 4, express-rate-limit, Swagger / OpenAPI validator
Hardware pipeline Reprogrammed campus GPS units & basestations, C + libcurl, /ping ingest
Jobs Dockerized cronJob Metro poller
PWA Web manifest, service worker, install + offline shell
Testing Jest, React Testing Library, Playwright (e2e)
Analytics / hosting Vercel Analytics · originally hosted on Microsoft Azure

▌ Page map

The live site is itself part of the story — a field notebook, not just a map.

Route Purpose
/ Field-notebook landing — the hook and the headline
/map The live demo map: loop shuttles + Metro
/journey How the build happened, weekend to finals
/timeline Project milestones
/about The team
/contact Reach the team

▌ Run it

Local setup — frontend & backend
# 1. Clone
git clone https://github.com/SlugLoop/SlugLoop.git
cd SlugLoop

# 2. Frontend (Next.js PWA)
cd client
pnpm install
pnpm dev            # http://localhost:3000

# 3. Backend (Express ingest API) — separate terminal
cd ../server
npm install
npm start

Tests

# client (unit + RTL)        # client (e2e)
cd client && pnpm test       cd client && pnpm test:e2e
# server
cd server && npm test

[!IMPORTANT] The backend needs environment variables that are not in this repo: Firebase Admin credentials, a Google Maps API key, and the PING_KEY ingest secret. Without them the client runs against the preserved demo data; the live hardware feed does not. Contact the team for production values.


▌ The team

Four Baskin Engineering students (UCSC, B.S. Computer Science '23).

Bill Zhang
Bill Zhang
Lead Developer · Full-Stack / PM

GitHub LinkedIn

Alex Liu
Alex Liu
Backend / Data Pipeline · Frontend

GitHub LinkedIn

Annie Liu
Annie Liu
Frontend · UI / UX Lead

GitHub LinkedIn

Nick Szwed
Nick Szwed
Hardware / Embedded · Backend

GitHub LinkedIn


▌ Repository layout

What's where
SlugLoop/
├── client/              # Next.js 16 PWA — the preserved case-study site + demo map
│   ├── app/             # App Router routes: map, journey, timeline, about, contact
│   ├── src/             # components, lib, firebase client
│   ├── __tests__/       # Jest + React Testing Library
│   └── e2e/             # Playwright parity tests
├── client-legacy/       # Original Create React App + Material UI build (2023)
├── server/              # Express ingest API — POST /ping, Metro routes, Firestore writes
│   ├── routes/          # index (bus ingest), metro
│   ├── functions/       # direction, convert, soonBusStop, pingHelper
│   └── initialization/  # firebase admin init
├── cronJob/             # Dockerized Santa Cruz Metro poller
├── SlugLoop.png         # project mark
└── LICENSE              # Apache-2.0

▌ Build context & what's in this repo

A hackathon project is a weekend, not a product — and this repo is honest about that. SlugLoop was rebuilt afterward as a preserved case study, so what you clone is not byte-for-byte what ran live in 2023.

Original build (2023) This repo
Frontend Create React App + Material UI Next.js 16 + React 19 (rebuilt) — original kept in client-legacy/
Hardware feed Live GPS units → basestations → /ping Preserved demo data on the map
Hosting Microsoft Azure Static preserved site
Purpose Live campus utility Field-notebook case study of the build

Known limits of the weekend scope: hardware coverage was never the full fleet (some receivers were broken), and arrival-time prediction (an ML ETA model) was always a "what's next," not a shipped feature.


▌ License

Apache-2.0 — built to be forked, learned from, and carried forward by the next cohort of UCSC students.


📑 Sources & footnotes
Built at CruzHacks 2023 by four UCSC Baskin Engineering students · slugloop.tech · GitHub

↑ back to top

About

WebApp for tracking Campus and Metro Buses at UCSC | GDSC 2023 Top 10 Global

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

 
 
 

Contributors