Skip to content

Repository files navigation

lasvegasfortransit.org

The website for Las Vegans for Better Transit, a grassroots advocacy organization fighting for world-class public transit and supportive land use in the Las Vegas Valley.

New contributor? You don't need to know our stack to help. Start at docs/tutorials/start-here.md, and keep the glossary open for any unfamiliar term.

Stack

New to any of these? Each links to its glossary entry.

  • Astro — the framework that builds the site into fast static HTML
  • MDX content collections (Markdown-plus-components content) with Zod-validated frontmatter, so a typo fails the build instead of shipping
  • Tailwind CSS v4 (via @tailwindcss/vite)
  • Public Sans (USWDS font, self-hosted; Latin woff2 vendored from @fontsource-variable/public-sans)
  • Hosted on Cloudflare Workers with static assets and server routes.

Getting started

To preview the site on your own computer — all most contributors ever need:

pnpm install   # one-time: install dependencies
pnpm dev       # start the local site at https://lvbt.localhost

That's it: edit a file, see it update live. New to the project or our tools? docs/tutorials/start-here.md walks through this from scratch, and the glossary defines any unfamiliar term.

Full setup (deploying your own copy)

pnpm bootstrap is a single command that takes an empty checkout all the way to a deployed site. It runs eight phases in order — install → auth → workspace → env → repo → deploy → domain → secrets. Every phase checks what already exists first, so running it again is safe and an interrupted run picks up where it stopped:

pnpm install
pnpm bootstrap   # full interactive setup; add --local-only to skip GitHub/Cloudflare

For what each phase does, the other flags, and how to add a phase, see the bootstrap reference; the first-time-setup tutorial is the hand-held version.


Day-to-day commands

Run these from the repository root. They are the same commands every LVBT repository uses.

Command Action
pnpm dev Local dev server at https://lvbt.localhost
pnpm build Build the site to apps/site/dist/ and its Worker to apps/site/.wrangler/worker
pnpm preview Build, then serve the site and Worker locally
pnpm check Everything CI checks: formatting, docs, lint, types, tests, the build
pnpm check:fix Apply formatting and lint fixes
pnpm check-types Type-check the site and its scripts
pnpm lint Lint the code, stylesheets, and brand tokens
pnpm format Format the codebase with Prettier
pnpm test Run the unit tests
pnpm test:e2e Run the Playwright suites, including the visual-regression sweep
pnpm preflight Re-check readiness without making changes

Commands only the site has live in apps/site/package.json. Run them with pnpm -C apps/site <command>, for example pnpm -C apps/site test:update to refresh the visual-regression baselines (see apps/site/tests/README.md) or pnpm -C apps/site test:install to download the Chromium build Playwright uses.

Editing content

The full docs live in docs/, organized so you can find things by what you're trying to do (the Diátaxis system). New here? Begin at Start here; for everything else, the docs index lists it all. Common entry points:

Adding an event

Events live in the LVBT Google Calendar, not in this repo. Create the event there; the site rebuilds against the calendar hourly. For events that need long-form copy on their detail page, scaffold an optional MDX body fragment with pnpm -C apps/site event:new. Full reference: docs/explanation/events-pipeline.md.

Project structure

The repository is a Turborepo workspace that follows the organization's repository standard. The site lives in apps/site; the root holds the repository's own tooling.

apps/site/                  # The website (package @lasvegasfortransit/site)
  src/
    content/                # All editable content (MDX + JSON)
      docs/                 # Long-form essays
      pages/                # Page body copy
      event-bodies/         # Optional long-form body per event (events live in Google Calendar)
      projects/             # Project briefs
      initiatives/          # Project tags (JSON)
    layouts/                # BaseLayout, DocLayout
    components/             # Reusable UI
    pages/                  # Astro file-based routing
    lib/site.ts             # Single source of truth for org metadata (reads from PUBLIC_LVBT_*)
    styles/global.css       # Tailwind + design tokens
    content.config.ts       # Zod schemas for content collections
  public/                   # Static assets, favicon, robots.txt
  functions/                # The Worker routes (join, sign-in, account, intake APIs)
  platform/                 # The Organizing Platform code and database migrations
  scripts/bootstrap/        # The bootstrap CLI (TypeScript via tsx)
  scripts/audit/            # Build, bundle, and Worker audits
  tests/                    # Unit tests; tests/e2e holds the Playwright suites (see tests/README.md)
  astro.config.mjs          # Astro + integrations
  wrangler.jsonc            # The Cloudflare Worker that serves the site
  playwright.config.ts      # Playwright config (webserver, viewports, snapshot path)
  .env.example              # Documents PUBLIC_LVBT_* env vars
docs/                       # Repository documentation
.lvbt/                      # Commit scopes and the vendored repository standard
turbo.json                  # The tasks every package runs, in order

Deployment

Pushes to main update preview.lasvegasfortransit.org behind Cloudflare Access. Explicit promotion publishes the selected saved release at lasvegasfortransit.org. Same-repository PRs receive independent, protected Worker preview URLs. Full pipeline (build settings, env vars, rollback, manual deploys) is documented in docs/reference/deployment-pipeline.md.

If anything breaks in your environment, run pnpm preflight first — it usually points at the missing piece.

CI/CD

Several workflows in .github/workflows/ build on three reusable composites in .github/actions/ (setup-node-pnpm, build-site, deploy-cloudflare-pages). The ones that talk to Cloudflare:

Workflow Trigger What it does
deploy-production.yml (Deploy staging) Main pushes and manual dispatch Save a release and verify protected staging
deploy-worker-preview.yml Same-repository PR updates Verify and comment an independent protected preview
deploy-worker-candidate.yml (Promote website release) Explicit selection of a successful staging run Publish the saved release after candidate checks

ci.yml (the required Validate check: pnpm check, a dependency audit, and a secret scan, no deploy), audit.yml, audit-scheduled.yml, cron-rebuild.yml, seed-baselines.yml and standard-update.yml (daily: opens a pull request when a newer repository standard is released) need no Cloudflare credentials. The full pipeline — every setting and the exact dashboard clicks for each token — is in docs/reference/deployment-pipeline.md and docs/guides/test-the-workers-candidate.md.

Workers credentials are scoped to the worker-preview and worker-candidate GitHub environments. The preview environment also needs a Cloudflare Access service token. Credentials remain outside release artifacts; the account ID is a repository variable. See the linked pipeline reference for exact secret names and review/promotion steps.

License

Site code: MIT. Editorial content (the org's vision, strategy, etc.): all rights reserved by Las Vegans for Better Transit.

About

The home for Las Vegans for Better Transit.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages