Skip to content

FirstFlush/streetlight-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Streetlight API

WIP

This repo is in active early-stage development. Expect bugs, breakage, and rapid iteration.

Streetlight API is the public infrastructure layer of the Street Ninja ecosystem — a clean, standards-based API for exposing real-time resource data to support homeless and low-income individuals in Vancouver.

The goal is to make Streetlight API the most accurate and up-to-date source of crisis resources available, built not just for Street Ninja, but for any nonprofit, outreach team, or civic tech project that wants to help.

This app is responsible for:

  • Scheduling scraping jobs (HTML, PDF, API)
  • Passing raw content to the Python-powered Ninja Crawl scraping engine
  • Validating, normalizing, and storing structured resource data (shelters, meals, hygiene, etc.)
  • Exposing a clean, public-facing API

🔗 Architecture

Streetlight API delegates all parsing logic to Ninja Crawl, a standalone Python FastAPI service. This app never scrapes HTML or PDFs directly — instead, it handles orchestration:

  1. Fetches raw content (using Axios, Playwright, or external APIs)
  2. Sends raw data to Ninja Crawl (POST /scrape)
  3. Validates the response using Zod schemas
  4. Saves the result to PostgreSQL via Prisma

🧱 Tech Stack

  • Language: TypeScript (strict)
  • Framework: Express
  • HTTP Client: Axios
  • Browser Automation: Playwright & Chromium
  • Database: PostgreSQL (Prisma ORM)
  • Scraping Queue: BullMQ (Redis-backed jobs)
  • Validation: Zod
  • Scheduling: node-cron
  • Logging: Pino
  • Testing: Jest

🔍 Know a Data Source?

Know of a website, PDF, or open data portal that lists services for unhoused or low-income people in BC?

Please reach out. I’m always looking to expand the dataset that powers Street Ninja.

Start a discussion, open an issue, or email me.

🕸 Street Ninja Ecosystem

☕ Support This Project

If you believe in what I'm building and want to help cover hosting or SMS costs:

Buy Me a Coffee

About

An Express.js backend that aggregates shelters, food programs, and other local resources into a single unified API. Built to strengthen nonprofit infrastructure and support those serving homeless and low-income communities in Greater Vancouver.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors