A full-stack AI-powered civic engagement platform that transforms government documents into interactive, personalized insights. Upload PDFs, get AI analysis, chat with documents, and take action on local issues.
- Input ZIP code + interests (housing, transport, environment, business, etc.)
- AI highlights only document portions that directly affect you
- Tailored summaries based on your civic interests
- Natural language chat interface for government documents
- Ask questions like "How will this zoning change affect parking near me?"
- Answers in plain English with source citations
- Analyzes public comments and transcripts for sentiment
- Visual charts showing support vs opposition
- Sample comments with sentiment analysis
- Pre-drafted emails to representatives
- RSVP links to public hearings
- Share buttons for social engagement
- Compares local proposals with nearby cities
- Uses open civic datasets for context
- Example: "Your city spends 2x more on policing than nearby towns"
- AI predicts likely policy impacts based on historical patterns
- Confidence scores and timeframes
- Example: "If passed, expect +15% traffic near Main St. within 2 years"
- Frontend: Next.js 15 + React 19 + Tailwind CSS
- Backend: Next.js API Routes
- AI: OpenAI GPT-4o + Google Gemini
- Charts: Recharts for data visualization
- File Processing: PDF parsing with pdf-parse
- Database: Mock in-memory (easily replaceable with Supabase/PostgreSQL)
git clone <your-repo-url>
cd roocodehack
npm installCopy .env.example to .env.local and add your API keys:
cp .env.example .env.localRequired API Key:
- GEMINI_API_KEY: Get from Google AI Studio (Free!)
Optional (for extended features):
- NEWS_API_KEY: Get from NewsAPI.org
- OPENCAGE_API_KEY: Get from OpenCage Geocoding
npm run devOpen http://localhost:3000 in your browser.
- Enter your ZIP code (try: 94102)
- Select interests (housing, transport, environment, etc.)
- Upload a government PDF or use pre-loaded sample documents
- Watch AI process and analyze the document
- Get personalized insights based on your interests
- Dashboard: View impact analysis, action buttons, charts
- Chat: Ask questions about the document in natural language
- Sentiment: See public opinion analysis
- Forecasts: View predicted impacts and scenarios
The app comes with realistic sample data:
- 3 Government Documents: Housing proposal, transportation budget, environmental assessment
- Public Comments: With sentiment analysis (positive/negative/neutral)
- Comparative Data: Budget comparisons across Bay Area cities
- Forecasts: AI-generated impact predictions
src/
βββ app/
β βββ api/ # API routes
β β βββ documents/ # Document CRUD operations
β β βββ chat/ # AI chat functionality
β β βββ ...
β βββ page.tsx # Main dashboard
β βββ layout.tsx # App layout
βββ components/
β βββ PersonalizationSetup.tsx # ZIP + interests setup
β βββ DocumentUpload.tsx # PDF upload with processing
β βββ DocumentDashboard.tsx # Main insights dashboard
β βββ ChatInterface.tsx # AI chat component
β βββ SentimentHeatmap.tsx # Sentiment visualization
β βββ ComparativeContext.tsx # City comparisons
β βββ ForecastScenarios.tsx # Impact predictions
βββ database/
βββ schema.sql # Database schema
βββ seed-data.sql # Sample data
- Update the upload handler in
src/app/api/documents/upload/route.ts - Add processing logic for new document formats
- Update the AI prompts for document-specific analysis
- Modify prompts in the processing functions
- Add new insight categories
- Customize action item generation
Replace the mock database with real persistence:
- Set up Supabase or PostgreSQL
- Run the schema from
database/schema.sql - Update API routes to use real database queries
- Responsive Design: Works on desktop, tablet, and mobile
- Dark Mode: Full dark mode support
- Loading States: Smooth loading animations
- Error Handling: Graceful error states and user feedback
- Accessibility: WCAG compliant components
npm run build
# Deploy to Vercel# Build Docker image
docker build -t community-transparency-digest .
# Run container
docker run -p 3000:3000 community-transparency-digest- Start with personalization - Show ZIP code + interests setup
- Upload a sample PDF - Demonstrate real-time AI processing
- Explore the dashboard - Highlight personalized insights and action buttons
- Use the chat feature - Ask natural language questions
- Show visualizations - Sentiment charts and comparative data
- Demonstrate forecasts - AI-predicted impacts with confidence scores
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details
Built for civic engagement and government transparency ποΈβ¨
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.