How joalroselin/civicsync-ph works
CivicSync PH is a Philippine legislation discovery app: users search lawmakers or bills, review authorship and live bill details, then bookmark bills for status updates. The core flow combines Open Congress authorship/history with BatasWatch’s current-congress filings and status. Separate branches cover CMS-managed site content and intake, plus install/offline behavior. Some subsystem links are documented in the README; unsampled implementation details and unshown call relationships are not inferred.
Main entry points: bills.ts Bill merger · WatchlistProvider.tsx Watchlist state · batasWatch.ts BatasWatch client · page.tsx Home feed
Components 26
Bill discovery
- Home feed
app/page.tsx - Receipts search
app/receipts/page.tsx - Lawmaker bills
app/people/[id]/page.tsx - Bill detail
app/bills/[id]/page.tsx - Bill JSON API
app/api/bills/[id]/route.ts - Open Congress client
lib/openCongress.ts - BatasWatch client
lib/batasWatch.ts - Bill merger
lib/bills.ts - Bill cards
app/components/BillCard.tsx - Search navigation
app/components/SearchNavigation.tsx
Watchlist
- Watch controls
app/components/WatchButton.tsx - Watchlist state
app/components/WatchlistProvider.tsx - Watchlist page
app/watchlist/page.tsx - Cloud sync
lib/watchlistSync.ts - Firestore
Content and intake
- CMS pages
lib/content.ts - Sanity client
lib/sanity.ts - Fallback content
lib/content-defaults.ts - Intake endpoint
app/api/intake/route.ts - Intake rules
lib/intake.ts - Sanity Studio schemas
studio/schemaTypes - Revalidation endpoint
app/api/revalidate/route.ts
App platform
- Offline service worker
public/sw.js - Offline fallback
app/offline/page.tsx
Other components
- Site visitor
- Google sign-in
Connections 30
- Site visitor → Home feed: opens
README.md - Site visitor → Receipts search: searches
README.md - Home feed → BatasWatch client: lists filings
app/page.tsx - Home feed → CMS pages: loads suggestions
app/page.tsx - Home feed → Bill merger: summarizes filings
app/page.tsx - Receipts search → Open Congress client: searches records
app/receipts/page.tsx - Receipts search → BatasWatch client: checks new bills
app/receipts/page.tsx - Receipts search → Bill cards: renders results
app/receipts/page.tsx - Lawmaker bills → Open Congress client: loads authorship
app/people/[id]/page.tsx - Lawmaker bills → BatasWatch client: loads live bills
app/people/[id]/page.tsx - Lawmaker bills → Bill merger: uses bill summaries
app/people/[id]/page.tsx - Bill detail → Bill merger: loads detail
app/bills/[id]/page.tsx - Bill merger → Open Congress client: reads records
lib/bills.ts - Bill merger → BatasWatch client: reads live status
lib/bills.ts - Bill JSON API → Bill merger: serves detail
app/api/bills/[id]/route.ts - Bill detail → Watch controls: offers bookmarking
app/bills/[id]/page.tsx - Bill cards → Watch controls: renders control
app/components/BillCard.tsx - Watch controls → Watchlist state: updates watchlist
app/components/WatchButton.tsx - Watchlist page → Watchlist state: reads items
app/watchlist/page.tsx - Watchlist state → BatasWatch client: refreshes status
README.md - Watchlist state → Cloud sync: syncs account data
app/components/WatchlistProvider.tsx - Cloud sync → Firestore: stores remotely
README.md - Google sign-in → Watchlist state: enables sign-in
README.md - CMS pages → Sanity client: fetches published content
lib/content.ts - CMS pages → Fallback content: falls back to
lib/content.ts - Intake endpoint → Intake rules: validates submissions
app/api/intake/route.ts - Intake endpoint → Sanity client: stores submissions
README.md - Sanity Studio schemas → Intake endpoint: reviews inbox entries
README.md - Revalidation endpoint → Sanity client: handles webhook
app/api/revalidate/route.ts - Offline service worker → Offline fallback: falls back offline
README.md