Skip to content

KevinSijuEappen/RoocodeHackathonProject

Repository files navigation

Community Transparency Digest

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.

πŸš€ Core Features

1. Personalized "Impact Lens"

  • 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

2. AI Town Hall Chatbot

  • 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

3. Policy Sentiment Heatmap

  • Analyzes public comments and transcripts for sentiment
  • Visual charts showing support vs opposition
  • Sample comments with sentiment analysis

4. Automatic "What You Can Do" Action Buttons

  • Pre-drafted emails to representatives
  • RSVP links to public hearings
  • Share buttons for social engagement

5. Comparative Context Generator

  • Compares local proposals with nearby cities
  • Uses open civic datasets for context
  • Example: "Your city spends 2x more on policing than nearby towns"

6. Future Forecast Scenarios

  • 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"

πŸ›  Tech Stack

  • 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)

⚑ Quick Start (15 minutes)

1. Clone and Install

git clone <your-repo-url>
cd roocodehack
npm install

2. Environment Setup

Copy .env.example to .env.local and add your API keys:

cp .env.example .env.local

Required API Key:

Optional (for extended features):

3. Run the Application

npm run dev

Open http://localhost:3000 in your browser.

🎯 Demo Flow

Step 1: Personalization Setup

  1. Enter your ZIP code (try: 94102)
  2. Select interests (housing, transport, environment, etc.)

Step 2: Document Upload

  1. Upload a government PDF or use pre-loaded sample documents
  2. Watch AI process and analyze the document
  3. Get personalized insights based on your interests

Step 3: Explore Features

  • 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

πŸ“Š Sample Data Included

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

πŸ— Architecture

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

πŸ”§ Customization

Adding New Document Types

  1. Update the upload handler in src/app/api/documents/upload/route.ts
  2. Add processing logic for new document formats
  3. Update the AI prompts for document-specific analysis

Extending AI Analysis

  1. Modify prompts in the processing functions
  2. Add new insight categories
  3. Customize action item generation

Database Integration

Replace the mock database with real persistence:

  1. Set up Supabase or PostgreSQL
  2. Run the schema from database/schema.sql
  3. Update API routes to use real database queries

🎨 UI/UX Features

  • 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

πŸš€ Deployment

Vercel (Recommended)

npm run build
# Deploy to Vercel

Docker

# Build Docker image
docker build -t community-transparency-digest .

# Run container
docker run -p 3000:3000 community-transparency-digest

πŸ“ˆ Hackathon Demo Tips

  1. Start with personalization - Show ZIP code + interests setup
  2. Upload a sample PDF - Demonstrate real-time AI processing
  3. Explore the dashboard - Highlight personalized insights and action buttons
  4. Use the chat feature - Ask natural language questions
  5. Show visualizations - Sentiment charts and comparative data
  6. Demonstrate forecasts - AI-predicted impacts with confidence scores

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

MIT License - see LICENSE file for details


Built for civic engagement and government transparency πŸ›οΈβœ¨

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors