A web application for tracking federal and state legislation and executive orders.
- Track federal legislation from Congress.gov
- Monitor state-level legislation
- Follow executive orders from the Federal Register
- Real-time search and filtering
- Mobile-first responsive design
- Dark mode support
- Python 3.8 or higher
- Node.js 14 or higher
- Docker and Docker Compose (optional)
- Git
Before running the application, you'll need to obtain the following API keys:
-
Congress.gov API
- Register at: https://api.congress.gov/sign-up/
- Required for federal legislation data
- Rate limit: 1000 requests per hour
-
State Legislature APIs (Optional)
- Requirements vary by state
- Some states only offer web scraping
- Check individual state legislature websites for API access
- Clone the repository:
git clone https://github.com/glavanet/legislation-tracker.git
cd legislation-tracker- Set up environment files:
# Backend environment
cp backend/.env.example backend/.env
# Frontend environment
cp frontend/.env.example frontend/.env- Configure API keys in backend/.env:
CONGRESS_API_KEY=your_api_key_here
NY_LEGISLATURE_API_KEY=your_optional_key_here
CA_LEGISLATURE_API_KEY=your_optional_key_here- Run the setup script:
chmod +x scripts/setup.sh
./scripts/setup.shStart the development servers:
./scripts/dev.shThis will start:
- Backend server at http://localhost:8000
- Frontend server at http://localhost:3000
- API documentation at http://localhost:8000/docs
- Build and start containers:
docker-compose up -d- Stop containers:
docker-compose downlegislation-tracker/
├── backend/
│ ├── app/
│ │ ├── api/
│ │ ├── models/
│ │ └── scrapers/
│ └── tests/
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── hooks/
│ │ └── utils/
│ └── tests/
└── scripts/
- API key required
- 1000 requests per hour
- Tracks federal legislation
- No API key required
- 1000 requests per hour
- Tracks executive orders
- Varies by state
- Some require API keys
- Some only allow web scraping
- Rate limits vary
Update backend/.env:
# Required
CONGRESS_API_KEY=your_api_key_here
# Optional
DATABASE_URL=sqlite:///./legislation.db
API_V1_STR=/api/v1Update frontend/.env:
VITE_API_URL=http://localhost:8000
VITE_API_VERSION=v1Run backend tests:
cd backend
pytestRun frontend tests:
cd frontend
npm testOnce running, view the API documentation at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
The application implements:
- API rate limiting
- Response caching
- Concurrent request limiting
Configure these in backend/app/config.py:
RATELIMIT_STORAGE_URL = "memory://"
DEFAULT_RATE_LIMIT = "100/minute"- Fork the repository
- Create your feature branch
- Follow coding standards
- Add tests for new features
- Submit a pull request
See CONTRIBUTING.md for details.
- Never commit API keys
- Use environment variables
- Keep dependencies updated
- Follow security best practices
This project is licensed under the MIT License - see LICENSE for details.
- API Rate Limits
# Check current usage
curl -H "X-Api-Key: your_key" https://api.congress.gov/v3/market-data/usage- Missing API Keys
# Verify environment variables
echo $CONGRESS_API_KEY- Database Migrations
# Reset database
cd backend
alembic downgrade base
alembic upgrade head