Demo β’ Documentation β’ Report Bug β’ Request Feature
- About The Project
- Key Features
- Built With
- Getting Started
- Usage
- Project Structure
- Development
- Testing
- Deployment
- Contributing
- Security
- License
- Contact
- Acknowledgments
Polisee is an open-source web application that democratizes access to legislative information by transforming complex bills into personalized impact reports. Using advanced AI and Natural Language Processing, Polisee helps citizens understand how proposed legislation will directly affect their lives.
- Legislative Complexity: Bills often exceed 1,000 pages, making manual review infeasible
- Citizen Engagement Gap: Voters struggle to connect policy provisions to personal circumstances
- Misinformation Risk: AI-generated summaries without source verification can spread false information
Polisee provides:
- Personalized Analysis: AI-generated impact reports tailored to individual user personas
- Verifiable Claims: Every analysis links directly to source text in the original bill
- Admin-Managed Content: Administrators upload and manage bills while users focus on understanding impacts
- Sentiment Feedback: Users can provide feedback on specific bill sections that affect them
- π Multi-Step Persona Creation - Comprehensive demographic profiling for accurate analysis
- π€ AI-Powered Analysis - OpenAI-driven personalized impact generation with RAG
- π Advanced PDF Viewer - Full-featured PDF viewing with text highlighting and search
- π Source Citations - Click-to-view source text with context highlighting
- π¬ Sentiment Feedback - Track user opinions on specific bill impacts
- π± Responsive Design - Mobile-first UI with professional UX
- π Secure Authentication - Supabase Auth with role-based access control
- π Real-time Analytics - Track engagement and feedback metrics
- π¨ Modern UI/UX - Built with Shadcn UI and Tailwind CSS
- π High Performance - Optimized for fast analysis generation (< 30 seconds)
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- Shadcn UI - Re-usable component library
- React PDF - PDF rendering in React
- Supabase - PostgreSQL database, Auth, and Storage
- OpenAI API - AI text generation and embeddings
- Congress.gov API - Legislative data source
- Resend - Email notifications
- Vercel - Frontend hosting
- GitHub Actions - CI/CD pipeline
- Gitleaks - Security scanning
- Node.js 18+ and npm
- Supabase account (free tier available)
- OpenAI API key
- Congress.gov API key
-
Clone the repository
git clone https://github.com/PoliseeAI/polisee.git cd polisee -
Install dependencies
npm install
-
Install backend dependencies (Python)
cd backend pip install -r requirements.txt cd ..
-
Create environment variables
cp .env.example .env.local
-
Configure your
.env.localfile# Supabase Configuration NEXT_PUBLIC_SUPABASE_URL=your-supabase-project-url NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key # Congress.gov API Configuration CONGRESS_API_KEY=your-congress-api-key # OpenAI Configuration OPENAI_API_KEY=your-openai-api-key # Email Configuration (Optional) RESEND_API_KEY=your-resend-api-key RESEND_FROM_EMAIL=noreply@poliseeai.com # Application Configuration NEXT_PUBLIC_APP_URL=http://localhost:3000
-
Set up the database
Run the migration scripts in your Supabase SQL editor:
# Copy the contents of these files to your Supabase SQL editor: - supabase/migrations/*.sql - local_schema.sql (for initial setup)
-
Configure Supabase Storage
Create a bucket named
billsin your Supabase Storage for PDF storage. -
Run the development server
npm run dev
-
Access the application
Open http://localhost:3000 in your browser.
- Create Persona - Fill out demographic information (location, occupation, family status, etc.)
- Browse Bills - View available legislative bills with search and filtering
- Get Personalized Analysis - AI generates impact analysis tailored to your persona
- Review Sources - Click citations to view exact bill text in the PDF viewer
- Provide Feedback - Share your sentiment on specific bill impacts
POST /api/analyze-bill- Generate personalized bill analysisGET /api/search-bills- Search legislative billsPOST /api/vote-bill- Submit sentiment feedbackGET /api/ai-summary/[billId]- Get cached AI analysis
For detailed API documentation, see API.md.
polisee/
βββ src/
β βββ app/ # Next.js app router pages
β βββ components/ # React components
β β βββ auth/ # Authentication components
β β βββ feedback/ # Feedback & sentiment components
β β βββ layout/ # Layout components
β β βββ persona/ # Persona creation wizard
β β βββ policy/ # Policy analysis components
β β βββ ui/ # Reusable UI components
β βββ lib/ # Utility functions and services
β βββ types/ # TypeScript type definitions
βββ backend/ # Python backend for bill scraping
β βββ scraper/ # Congress.gov scraper
βββ supabase/ # Database migrations
βββ scripts/ # Utility scripts
βββ docs/ # Documentation
βββ public/ # Static assets
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
# Database
npm run db:migrate # Run database migrations
npm run db:test # Test database connection
npm run db:types # Generate TypeScript types from database
# Bill Scraping
npm run scraper:initial # Initial bill data download
npm run scraper:daily # Daily bill updates
npm run scraper:search # Search for specific bills
# AI Processing
npm run ai:batch-summaries # Generate batch AI summaries
npm run ai:batch-status # Check batch processing status
# Security
npm run security:scan # Run security scans
npm run security:full # Full security auditThis project uses:
- ESLint for code linting
- Prettier for code formatting
- TypeScript for type safety
graph TD
A[User Browser] -->|HTTPS| B[Next.js Frontend]
B --> C[Supabase Auth]
B --> D[Supabase Database]
B --> E[OpenAI API]
B --> F[Congress.gov API]
D --> G[PostgreSQL with RLS]
B --> H[Supabase Storage]
H --> I[Bill PDFs]
# Run unit tests
npm run test
# Run integration tests
npm run test:integration
# Run E2E tests
npm run test:e2e
# Test database connection
npm run db:test- Fork this repository
- Create a new project on Vercel
- Connect your GitHub repository
- Add environment variables in Vercel dashboard
- Deploy!
See DEPLOYMENT.md for detailed self-hosting instructions.
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow the installation steps above
- Create a new branch for your feature
- Make your changes
- Run tests and linting
- Submit a PR with a clear description
- All data is encrypted in transit (HTTPS) and at rest
- Row Level Security (RLS) enabled on all database tables
- API keys stored securely in environment variables
- Regular security scans with Gitleaks and TruffleHog
- See SECURITY.md for security policy
Please report security vulnerabilities to security@poliseeai.com
This project is licensed under the MIT License - see the LICENSE file for details.
Project Maintainers:
- PoliseeAI Team - @poliseeai
- Email - contact@poliseeai.com
Project Link: https://github.com/PoliseeAI/polisee
- Congress.gov for legislative data access
- Supabase for backend infrastructure
- Vercel for hosting and deployment
- Shadcn UI for the component library
- The open-source community for invaluable tools and libraries