Skip to content

Read data from the official Congress.gov API, stores it locally, and displays it in the interface.#3

Open
rafaelhbarreto wants to merge 28 commits intoVictoryCTO:mainfrom
rafaelhbarreto:feature/read-and-show-congress-data
Open

Read data from the official Congress.gov API, stores it locally, and displays it in the interface.#3
rafaelhbarreto wants to merge 28 commits intoVictoryCTO:mainfrom
rafaelhbarreto:feature/read-and-show-congress-data

Conversation

@rafaelhbarreto
Copy link

@rafaelhbarreto rafaelhbarreto commented Nov 25, 2025

Description

This application read congress members data from Congress member data from the official Congress.gov API. (https://api.congress.gov), store locally and show in the frontend.

All instructions on Readme.md

Functional Requirements

  • System fetches Congress member data from official API
  • Data is stored in PostgreSQL with proper relationships (members + terms)
  • Import process is idempotent (safe to run multiple times)
  • Only updates records when API data is newer than local data
  • Web interface displays paginated list of members
  • Users can filter by name (case-insensitive), party, and state
  • Users can sort by name, party, state, district, or updated date
  • Detail page shows complete member information with terms history
  • Manual import command available with optional limit parameter
  • Automated daily sync scheduled at 00:00 UTC

How to Test

Follow the README.md instructions and run the project.

Expected Results

  • Application accessible at http://localhost/congress/members
  • Database tables created (members, member_terms, jobs, failed_jobs)
  • Environment configured correctly
  • Assets compiled

ROADMAP — Congress Members Platform

Phase 1 — Foundation & Architecture

  • — Setup Laravel data
  • — Define the data layer on database
  • — Create members table migration with indexes
  • — Create member_terms table with relationships
  • — Define the structure of queues
  • — Create factories for testing
  • — Implement DTO Layers with Spatie Laravel Data
  • — Create CongressApiClientInterface
  • — Implement CongressApiClient with retry logic
  • — Add CongressApiException with factory methods
  • — Configure congress.php config file
  • — Implementing useCases layer
  • — Create Jobs to fetch and store data
  • — Add retry logic (3 attempts)
  • — Implement failed() methods with logging
  • — Add job chaining for pagination
  • — Create congress:fetch-members command
  • — Add --limit option with validation
  • — Configure daily scheduled task (00:00 UTC)

Phase 2 — Backend to Frontend Delivery

  • — Create CongressMemberController
  • — Implement index() with filters/sorting/pagination
  • — Implement show() with eager loading
  • — Create MemberResource
  • — Create MemberTermResource
  • — Define web routes

Phase 3 — Web Interface (Frontend)

  • — Create app layout (Blade + TailwindCSS)
  • — Build members index view with filters
  • — Build member detail view with terms
  • — Style party badges with colors
  • — Add pagination component

Phase 4 — Testing & Polish

  • — Ensure all tests pass
  • — Verify zero external dependencies in tests
  • — Test queue workers functionality
  • — Test scheduled task configuration
  • — Verify idempotency (run imports multiple times)
  • — Final code review and cleanup

Phase 5 — Documentation

  • — Write comprehensive CLAUDE.md
  • — Polish the prompts for each phase
  • — Create README.md with setup instructions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant