Skip to content

My Fat Senator, part 2

5 min

For part 1, see [here]( https://www.nonsenseless.net/my-fat-senator/).

We’re not quite at a post-mortem here, but it’s well past time to catch up on the state of this project and break out the old “Lessons Learned” chalkboard.

Motivation - Politics and Poland

Let’s address the elephant in the room first. I have not been feeling motivated to work on this project almost at all this last year and a half. The mask-off fascism and the active attacks on the federal bureaucracy, half the populace, and basic rule of law have made it challenging to look at my little macaroni app and feel like it matters in the slightest to ask, “Did you know the senate is fundamentally undemocratic?"

Additionally, my own life hit a turbulent patch during a trip to visit family in Poland last summer. My gran's been declining and we decided to get together so we’d have a last chance to spend time together while she was still able to recognize us. Unfortunately, shortly after arrival, I was hospitalized with a virulent case of strep so the precious memories from that trip aren’t of quite the tenor I might have preferred. I spent three weeks in a Polish hospital, lost thirty pounds, and when I got out my focus shifted to rest and recovery.

So it’s been a time.

We’ve Got So Little To Do And So Much Time

Here’s a quick list of things I wanted to accomplish with this project:

  1. React and Remix experience
  2. Congressional Data Experience
  3. Web Animation Experience
  4. Portfolio Piece

It feels obvious in retrospect, but that’s too many things to cram into a project that is itself crammed into my spare time outside of work. Granting that we tend not to emphasize design at work—I can’t think of a single project where we’ve done more than the most trivial animation—and I didn’t have many examples to draw on for this kind of work, I would have benefited from taking more time to solicit opinions and look for examples of similar work before diving in.

React / Remix

The Bad

The decision to go with React and Remix added to the project scope. Realistically, the heart of the application is an HTML Canvas element with a few CRUD pages attached. The smart move would have been to spin up a dotnet application (with which I am intimately familiar), bang out the animation for a vote, and call it version 1. Particularly for a portfolio piece, it would have made infinitely more sense to focus on something like a system integration with a data import.

Instead I got sidetracked with questions like:

  1. How do you configure a monorepo in a node application?
  2. How do you configure typescript in a node monorepo?
  3. What dependency injection patterns do node applications use?
  4. How do I write sql-backed models with prisma and sqlite?
  5. How do you configure an animation loop in a React application?
  6. Why does every other part of this stack seem to convert my typescript model into its own jsonified-interpretation?

As a learning experience, those questions are all worth exploring, but they slowed progress on the heart of the project—that I was actually interested in—and several nights found me with my head in my hands wondering why I was fighting with a tsconfig file at 10PM.

The Good

Compalints aside, I have deepened my understanding of React and Remix. While I have mixed feelings about the anarchism of the React and Node ecosystem as a whole, I like the structure and approach of Remix. The philosophy behind Remix (now React Router v7) focuses on preserving direct access to web APIs rather than creating wrappers around them (see nextjs and nestjs), and I think anything that encourages developers to deepen their understanding of how the web platform actually works is a net positive for the profession. This project has already paid dividends at work on a project where React and Remix was a more logical choice than our standard dotnet solution.

Congressional Data

The Bad

Did you know that, as of this writing, there’s no dedicated API that returns Senate vote data? House Roll Call votes are available via API but the only source (I know of) for Senate data are the raw XML and JSON files they dump on their website. I had, admittedly, expected the votes of “the world’s greatest deliberative body” to be easily accessible in the year 2026.

Fascinatingly, I found a trail of dead efforts at API-ifying this data. The Sunlight Foundation (RIP) hosted an [API](( https://sunlightlabs.github.io/congress/) for a while. Pro Publica maintained [one](( https://projects.propublica.org/api-docs/congress-api/) for a while and links suggest [the New York Times did as well]( https://developer.nytimes.com/docs/congress_api) though I can’t find any references to it more recent than 2010 and I have to assume that hosting and serving this data isn’t a particularly profitable enterprise.

Luckily, some nerds made a [github project]( https://github.com/unitedstates/congress.git) with scrapers to automate pulling in all that gross XML so I was able to springboard off that and start pulling the data into a database and, from there, it also got easier to pull in supporting data from the Congress.gov API…except did you know that there are multiple different biographical systems for members of congress? [Congress’s bioguide]( https://bioguide.congress.gov) provides biographical data on both Senate and House members and the congress.gov API is searchable by bioguide ID. Unfortunately, only the House roll call votes use the bioguide ID and Senate votes reference the Senate LIS (Legislative Information Service) ID so I had to manually pull in the bioguide IDs for senators.

And, with those minor issues handled, I had access to the data I needed.

The Good

I have a bad habit of encountering a problem spot at work and deciding I need to learn enough about it that it stops being a problem. This approach does ultimately alleviate the pain, but it has the unfortunate side-effect that I've developed a portfolio of all the frustrating problematic crap that nobody else wants to bother with. I can see the trade-off of becoming more fluent in the data doldrums of congressional data, but the biggest win to come out of this project may be the ability to clean up my data import scripts and spin them off into a repository that processes everything into a database capable of serving up something like the API previously supported by Pro Publica and the Sunlight Foundation. That would help other people skip more of the learning steps I ran through without incurring the cost of actively hosting the data.

In The End

There’s still some work to do on version 1—finalizing the details on the animation, tweaking the app shell to support full-screen mode, rendering unrepresented populations (e.g. D.C., Puerto Rico, etc.)—and then I’ll have to decide whether it’s worth working on a version 2. I could spend ages tweaking and making this thing perfect—the final deluxe version in my mind’s eye has a Make Your Own Vote feature, a midi-version of the Star-Spangled Banner playing in the background, a nice clacking sound as votes collide, and maybe even a full-on design commissioned from somebody with a sense of style--but, given everything going on in the world right now, it might be better to spend some time working in my local community on a project with more direct impact.

In conclusion, here are ten more alternate names for this project:

  1. Senate Oligarchs
  2. The Balance of Power
  3. The Weight of Democracy (also includes Weighing Democracy, Weighing Down Democracy, and Wherefore Art Thou, Democracy)
  4. Who Needs The Filibuster?
  5. Well, The Founder’s Vision Was
  6. I Have No Senator And I Must Scream
  7. Actually, It’s a Republic
  8. Structural Imbalances Are Destroying My Country And I Need An Adult
  9. You Think Other Countries Are Any Better?
  10. This Corn Field Deserves Equal Representation With Los Angeles

Subscribe to receive the latest posts in your inbox.