Inspiration
Reading Congress.gov is like reading a tax form. The information is all there with bills, votes, sponsors, summaries, but the pages are dense, the language is bureaucratic, and finding "what's my representative voting on this week" takes a dozen clicks. We wanted to flip that: take the same authoritative dataset and make it skimmable for everyday constituents.
What it does
Capitol Pulse pulls from the official Congress.gov v3 API and surfaces four flows that an everyday constituent actually cares about:
- Recent Bills — a sortable feed of the latest legislation with sponsor, latest action, and a one-line excerpt
- Bill Detail — full sponsor and cosponsor lists, an action timeline (introduced → committee → floor), and the official CRS plain-language summary
- Find Your Reps — pick a state and optional district to see your two senators and House representative, with photos, party badges, and contact info
- House Roll-Call Votes — recent votes with question, result, party totals, and a per-member breakdown of who voted Yea/Nay
The hero feature: a one-click Gemini-powered AI explainer on every bill that takes the title, policy area, latest action, and CRS summary, and returns 3-5 conversational sentences answering "what does this bill actually do, who does it affect, and is it likely to pass?" Fast enough to read in the time it takes to scroll a tweet.
How we built it
- Next.js with React 19 and Tailwind CSS 4 for the frontend.
- All data fetching lives in Server Components, so the Congress API key never reaches the browser.
- A single typed fetch wrapper,
cget<T>(), centralizes every upstream call: builds the URL, attaches thex-api-keyheader, retries on 5xx with exponential backoff, applies anAbortControllertimeout, and uses Next.js's per-routerevalidatecache so we don't hammer the API on every page view. - The AI explainer is a
POST /api/explainroute handler. It builds a tightly-scoped prompt and callsgemini-2.5-flash. Responses are cached for 7 days per unique payload, so a popular bill costs us one Gemini call per week. - Open source at github.com/vedantpatel021/CapitolPulse.
Accomplishments that we're proud of
- A polished, four-flow app with AI integration shipped in a single hackathon window.
- A retry-and-cache layer that kept the demo working even when the upstream API was returning 503s.
- An AI explainer that actually feels useful — not a tacked-on gimmick. Click one button, get a paragraph any voter can understand.
- Zero secrets in the client bundle; clean separation of server-only fetches.
What we learned
- Defensive client design beats trying to fix the upstream. A retry layer plus aggressive caching means users see a working app even when the source is degraded.
URLSearchParamsis a footgun for already-encoded strings. Always pass the human-readable value and let the formatter encode it.- LLMs as a UI primitive. A single button that turns 400 words of bureaucratic English into 4 sentences feels genuinely transformative — and once the prompt is right, integration is ~50 lines of code.
- Server Components are the right call for API-key apps. Zero client bundles got the key, and route-level caching came free.
What's next for CapitolPulse
- Senate vote data (the API currently only exposes House roll-calls)
- Saved-rep persistence so your senators are pinned to the home page
- A "compare two bills" view powered by a longer Gemini prompt
- Email alerts when a rep you follow votes on a topic you care about
Built With
- congress.gov-api
- git
- github
- next.js
- node.js
- react
- tailwindcss
- typescript
Log in or sign up for Devpost to join the conversation.