How lightningbolts/state-pulse works
StatePulse is a civic-information web application that aggregates legislation and representative data, makes it easier to understand, and supports civic action and personal tracking. The principal user journey is to find legislation, review summaries and related activity, then bookmark or follow it or engage through community and representative-contact tools. The README documents the wider feature set; sampled route code confirms MongoDB-backed representative and dashboard data access, while wiring among many unsampled pages and services is not asserted.
Main entry points: (main)/page.tsx StatePulse web app · legislation/page.tsx Legislation pages · representatives/page.tsx Representative pages · dashboard/page.tsx Personal dashboard
Components 20
Civic experience
- StatePulse web app
src/app/(main)/page.tsx - Legislation pages
src/app/(main)/legislation/page.tsx - Representative pages
src/app/(main)/representatives/page.tsx - Community pages
src/app/(main)/posts/page.tsx - Personal dashboard
src/app/(main)/dashboard/page.tsx
Legislation insight
- Legislation API
src/app/api/legislation/route.ts - Legislation services
src/services/legislationService.ts - AI summaries
src/ai/flows/summarize-legislation.ts - Related bills
src/services/relatedBillsService.ts - Vote predictions
src/services/votingPredictionService.ts
Civic tools
- Representative API
src/app/api/representatives/route.ts - Civic lookup
src/app/api/civic/route.ts - Message generator
src/app/api/generate-message/route.ts - Policy tracking
src/app/api/policy-tracker/route.ts - Community API
src/app/api/posts/route.ts - Bookmarks API
src/app/api/bookmarks/route.ts
Application services
- MongoDB
src/lib/mongodb.ts - Clerk authentication
src/middleware.ts - State vote ingestion
src/scrapers/stateVotes/orchestrator.ts
Other components
- Citizen
Connections 21
- Citizen → StatePulse web app: uses
- StatePulse web app → Legislation pages: browses
- StatePulse web app → Representative pages: finds officials
- StatePulse web app → Community pages: joins discussion
- StatePulse web app → Personal dashboard: tracks activity
- Legislation pages → Legislation API: requests bills
- Legislation API → Legislation services: delegates
- Legislation services → MongoDB: reads data
- Legislation pages → AI summaries: requests summaries
- Legislation pages → Related bills: explores links
- Legislation pages → Vote predictions: views predictions
- Representative pages → Representative API: requests officials
- Representative API → MongoDB: reads and writes
- Representative pages → Civic lookup: locates district
- Representative pages → Message generator: creates message
- Personal dashboard → Policy tracking: tracks policies
- Personal dashboard → Bookmarks API: manages saved bills
- Community pages → Community API: loads posts
- Community API → MongoDB: stores content
- Personal dashboard → Clerk authentication: requires account
- State vote ingestion → MongoDB: stores vote records