A comprehensive real-time data analytics platform for the City of Revere, Massachusetts, providing municipal data visualization, AI-powered insights, and citizen engagement tools.
- Police Logs: Real-time monitoring and analysis of police department activity
- Budget Analysis: Interactive budget data exploration with AI-powered insights
- Demographics: Population statistics and trends
- Economy & Revenue: Economic indicators and city revenue tracking
- Transportation: MBTA Blue Line integration and transit analytics
- Weather & Climate: Real-time weather data and climate trends
- AI chatbot with RAG (Retrieval-Augmented Generation) capabilities
- Natural language queries for city data
- Document analysis and insights generation
- Voice-enabled interactions
- Housing market analytics
- Education statistics
- Health metrics
- Social indicators
- Interactive charts and visualizations
- Frontend: React 18, TypeScript, Vite
- UI Components: shadcn/ui, Radix UI, Tailwind CSS
- Backend: Supabase (PostgreSQL, Edge Functions, Storage)
- AI/ML: Google Gemini AI, LangChain, OpenAI
- Data Visualization: Recharts
- State Management: React Query, Context API
- Node.js 18+ (or Bun runtime)
- npm or bun package manager
- Supabase account
- Clone the repository:
git clone <repository-url>
cd revere-city-insights- Install dependencies:
npm install
# or
bun install- Set up environment variables:
Create a .env file in the root directory:
# Required: Google Gemini API Key
VITE_GEMINI_API_KEY=your_gemini_api_key_here
# Supabase Configuration
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
VITE_SUPABASE_PUBLISHABLE_KEY=your_supabase_publishable_key
VITE_SUPABASE_PROJECT_ID=your_project_idNote: See
.env.examplefor a template
- Run database migrations:
# Apply migrations in your Supabase dashboard
# See: supabase/migrations/- Start the development server:
npm run dev
# or
bun devThe application will be available at http://localhost:8080
revere-city-insights/
├── src/
│ ├── components/ # Reusable UI components
│ ├── pages/ # Application pages/routes
│ ├── services/ # API and data services
│ ├── hooks/ # Custom React hooks
│ ├── contexts/ # React context providers
│ ├── lib/ # Utility functions
│ └── integrations/ # Third-party integrations
├── supabase/
│ ├── functions/ # Supabase Edge Functions
│ └── migrations/ # Database migrations
├── public/ # Static assets
└── scripts/ # Utility scripts
npm run dev- Start development servernpm run build- Build for productionnpm run build:dev- Build in development modenpm run preview- Preview production buildnpm run lint- Run ESLint
- Automated daily sync from Revere Police Department
- Full-text search and filtering
- Analytics dashboards with call type distribution
- Historical trend analysis
- Interactive budget data exploration
- AI-powered budget insights and Q&A
- Document upload and analysis
- Vector search capabilities
- MBTA Blue Line predictions
- Current weather conditions
- Live city data updates
- Natural language interface for city data
- Context-aware responses
- Document analysis capabilities
- Voice interaction support
| Variable | Description | Required |
|---|---|---|
VITE_GEMINI_API_KEY |
Google Gemini API key for AI features | Yes |
VITE_SUPABASE_URL |
Supabase project URL | Yes |
VITE_SUPABASE_ANON_KEY |
Supabase anonymous key | Yes |
VITE_SUPABASE_PUBLISHABLE_KEY |
Supabase publishable key | Yes |
VITE_SUPABASE_PROJECT_ID |
Supabase project ID | Yes |
The application requires several database tables and functions. Apply migrations in order:
20241005_create_police_logs.sql- Police logs tables and indexes20241007_create_budget_vectors.sql- Budget vector search20241026_create_document_tables.sql- Document storage20241026_create_chat_history.sql- Chat history
See the supabase/migrations/ directory for SQL migration files.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Never commit
.envfiles or API keys to the repository - Rotate any exposed API keys immediately
- Use environment variables for all sensitive configuration
- Review the
.gitignorefile before committing
MIT License - see LICENSE file for details.
- City of Revere, Massachusetts
- Revere Police Department for public safety data
- MBTA for transit data API
- Visual Crossing Weather API