ποΈ AI-Powered Local Government Law Interpreter - Understanding local laws in plain English, built with Bolt.new
π Live Demo | β‘ Built with Bolt.new
LocalGov.AI is an innovative AI-powered platform that democratizes access to local government information by translating complex legal language into clear, understandable explanations. Citizens can ask questions about local laws, ordinances, and policies in natural language and receive instant, accurate responses.
π Try it now: localgov.kroszborg.co
π― Problem Solved: Local government laws and regulations are often written in complex legal jargon that's difficult for average citizens to understand. LocalGov.AI bridges this gap by providing clear, AI-powered explanations of local policies.
This project was developed using Bolt.new, showcasing the platform's capabilities for rapid full-stack development. All core functionality runs within the Bolt environment, demonstrating modern web development practices and AI integration.
π Bolt.new Project: https://bolt.new/~/sb1-qhracknh
- β Primary Development Platform: Built entirely with Bolt.new
- β Bolt.new Project URL: https://bolt.new/~/sb1-qhracknh
- β Bolt.new Badge: Prominently displayed on homepage with proper linking
- β Full-Stack Implementation: Complete Next.js application with authentication
- β Production Ready: Deployed and publicly accessible at localgov.kroszborg.co
- β Live Demo: Fully functional application ready for testing
- Streaming Responses: Real-time AI responses that appear character-by-character
- Smart Caching: 95% faster repeated queries with intelligent 1-hour cache
- Toast Notifications: Clear feedback for all user actions
- Keyboard Shortcuts: Quick access with Cmd/Ctrl + K
- Loading Skeletons: Professional skeleton screens instead of spinners
- Custom 404 Page: Helpful error page with navigation options
- Markdown Rendering: Beautiful formatted responses with code blocks, lists, and headers
- Natural language query processing
- Location-specific legal information
- Real-time streaming responses using Google Gemini 2.0 Flash
- Comprehensive legal disclaimers and source citations
- Response caching for instant repeated queries
- Autocomplete for 500+ cities worldwide
- Location-specific ordinance lookup
- Support for international jurisdictions
- Intelligent city/state/country recognition
- Secure authentication with Supabase
- Personal search history tracking
- Bookmark system for important responses
- Account settings and data management
- Toast notifications for all actions
- Responsive design with Tailwind CSS
- Dark/light theme support with system detection
- Smooth animations with Framer Motion
- Mobile-first design approach
- Accessibility-compliant interface
- Keyboard shortcuts for power users
- PKCE-based authentication flow
- Rate limiting on API endpoints
- Secure password requirements
- GDPR-compliant data handling
- Content Security Policy implementation
- Framework: Next.js 14.1.0 with App Router
- Language: TypeScript 5.8.3
- Styling: Tailwind CSS 3.3.3 with custom design system
- UI Components: Radix UI + shadcn/ui
- Animations: Framer Motion
- Icons: Lucide React
- Authentication: Supabase Auth with PKCE flow
- Database: Supabase PostgreSQL
- AI Integration: Google Gemini API
- Deployment: Vercel with Analytics
- Middleware: Custom rate limiting and security
- Build System: Next.js with SWC compiler
- Code Quality: ESLint + TypeScript strict mode
- Styling: PostCSS with Tailwind CSS
- Package Manager: npm
localgov-ai/
βββ app/ # Next.js App Router
β βββ api/ # API routes
β β βββ search/ # AI search endpoint
β β βββ delete-account/# Account management
β β βββ auth/ # Authentication callbacks
β βββ auth/ # Authentication pages
β βββ dashboard/ # User dashboard
β βββ about/ # About page
β βββ privacy/ # Privacy policy
β βββ terms/ # Terms of service
β βββ settings/ # User settings
βββ components/ # Reusable UI components
β βββ ui/ # shadcn/ui components
β βββ header.tsx # Navigation header
β βββ footer.tsx # Site footer
β βββ theme-provider.tsx# Theme management
βββ lib/ # Utility libraries
β βββ supabase.ts # Supabase client
β βββ utils.ts # Utility functions
βββ hooks/ # Custom React hooks
βββ public/ # Static assets
β βββ *_circle_360x360.png # Bolt.new badges
β βββ *.jpeg # Background images
βββ middleware.ts # Request middleware
- Primary: Neutral black/white with smart contrast
- Secondary: Muted grays for subtle elements
- Accent: Primary color for interactive elements
- Semantic: Green (success), Red (destructive), Amber (warning)
- Font Family: Satoshi (custom) with Inter fallback
- Hierarchy: Clear heading/body text distinction
- Responsive: Scales appropriately across devices
- Cards: Elevated surfaces for content organization
- Buttons: Multiple variants (default, outline, ghost, destructive)
- Forms: Accessible inputs with proper validation
- Navigation: Responsive header with mobile menu
- Node.js 18+ and npm
- Supabase account with project setup
- Google Gemini API key
Create a .env.local file with:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
# Google Gemini Configuration
GEMINI_API_KEY=your_gemini_api_key# Clone and install dependencies
npm install
# Run development server
npm run dev
# Build for production
npm run build
# Start production server
npm startRequired Supabase tables:
-- Search history table
CREATE TABLE search_history (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
query TEXT NOT NULL,
location TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Bookmarks table
CREATE TABLE bookmarks (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
title TEXT NOT NULL,
query TEXT NOT NULL,
location TEXT NOT NULL,
content TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);- Landing Page: Compelling hero with demo interface
- Sign Up: Simple email/password registration
- Onboarding: Immediate access to search functionality
- First Search: Location input + question β AI response
- Discovery: Explore bookmarks, history, and settings
- Dashboard: Personal search history and bookmarks
- Quick Search: Streamlined interface with autocomplete
- Management: Easy access to saved content and settings
- Modern Stack: Latest Next.js with TypeScript and advanced React patterns
- AI Integration: Sophisticated Google Gemini implementation with context awareness
- Database Design: Efficient Supabase schema with proper relationships
- Security: Industry-standard authentication and data protection
- Intuitive Design: Clean, accessible interface that anyone can use
- Performance: Optimized loading, caching, and smooth animations
- Responsiveness: Seamless experience across all device sizes
- Accessibility: WCAG compliance with proper semantic markup
- Real-World Problem: Addresses genuine civic engagement challenges
- Scalable Solution: Architecture supports growth to thousands of cities
- Community Value: Empowers citizens with legal knowledge access
- Future Potential: Foundation for broader civic tech initiatives
- Context Awareness: Understands location-specific legal frameworks
- Source Attribution: Provides general source guidance
- Disclaimer Integration: Automatic legal disclaimers on responses
- Query Optimization: Processes natural language effectively
- Secure Authentication: Supabase Auth with email verification
- Data Persistence: Search history and bookmarks saved
- Privacy Controls: Account deletion and data export options
- Profile Management: User preferences and settings
- History Tracking: Automatic search history with timestamps
- Bookmark System: Save and organize important responses
- Quick Access: Recently searched items for easy reference
- Data Export: Copy responses and search again functionality
- Encryption: All data encrypted in transit and at rest
- Authentication: Secure JWT-based session management
- Rate Limiting: API protection against abuse
- Content Security: CSP headers and XSS protection
- GDPR Ready: Right to access, rectify, and delete data
- Transparent Policies: Clear privacy policy and terms of service
- Minimal Data: Only collect essential information
- User Control: Account deletion and data portability
- Platform: Vercel with edge functions
- Live URL: localgov.kroszborg.co
- Analytics: Vercel Analytics for performance monitoring
- CDN: Global edge distribution for fast loading
- Monitoring: Error tracking and performance metrics
- Image Optimization: Next.js automatic image optimization
- Code Splitting: Automatic route-based code splitting
- Caching: Strategic caching for API responses
- Bundle Analysis: Optimized JavaScript bundle sizes
- All responses include appropriate legal disclaimers
- Clear messaging that content is for informational purposes only
- Encouragement to verify information with official sources
- Prominent "not legal advice" notices throughout the application
- Comprehensive Terms of Service with user responsibilities
- Detailed Privacy Policy explaining data collection and usage
- GDPR-compliant data handling procedures
- Clear consent mechanisms for data processing
- Multi-language support for international users
- Advanced search filters and sorting options
- Email notifications for bookmarked content updates
- Integration with more government data sources
- Mobile app development (React Native)
- Real-time notifications for law changes
- Community features for shared bookmarks
- API for third-party integrations
- Advanced analytics and insights
This project was built for the Bolt.new hackathon and showcases modern web development practices. While originally developed as a submission, the codebase demonstrates:
- Clean Architecture: Well-organized, maintainable code structure
- Best Practices: TypeScript, proper error handling, security measures
- Scalable Design: Patterns that support growth and feature additions
- Documentation: Comprehensive comments and type definitions
This project is developed for the Bolt.new hackathon. All third-party integrations are properly licensed, and the codebase follows open source best practices.
- Bolt.new - For providing an exceptional development platform that enabled rapid full-stack development
- Google - For Gemini API that powers the intelligent legal explanations
- Supabase - For robust authentication and database infrastructure
- Vercel - For seamless deployment and performance optimization
- shadcn/ui - For beautiful, accessible UI components
Built with β€οΈ using Bolt.new
This project demonstrates the power of modern web development tools in creating meaningful civic technology solutions.