A modern, real-time administrative dashboard for managing civic issues with integrated AI capabilities, built with Next.js, TypeScript, and Claude AI integration.
- π Real-time Dashboard - Live statistics and metrics
- πΊοΈ Interactive Issue Map - Visualize civic issues geographically
- π€ AI Assistant - Claude AI-powered chat for intelligent insights
- π Analytics & Reporting - Comprehensive data visualization
- π Smart Notifications - Real-time alerts for critical issues
- π₯ Department Management - Efficient task routing and assignment
- π§ Automatic issue classification and severity scoring
- π Predictive analytics for resource allocation
- π¬ Natural language query processing
- π― Smart routing recommendations
β οΈ Escalation prediction- π Automated report generation
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- UI Library: Material-UI (MUI) v5
- State Management: Zustand
- Data Fetching: React Query + SWR
- Maps: Mapbox GL JS
- Charts: Recharts + D3.js
- Real-time: Socket.io Client
- Styling: Tailwind CSS + Emotion
- API: RESTful + GraphQL
- WebSockets: Real-time updates
- AI Services: Claude API, OpenAI
- Authentication: JWT + OAuth2
Before you begin, ensure you have the following installed:
- Node.js (v18.0.0 or higher)
- npm or yarn
- Git
git clone https://github.com/SadiqueCodes/CivicIssue_adminpanel.git
cd CivicIssue_adminpanelnpm install
# or
yarn installCreate a .env.local file in the root directory:
# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:3000/api/v1
NEXT_PUBLIC_WS_URL=ws://localhost:3000
NEXT_PUBLIC_GRAPHQL_URL=http://localhost:3000/graphql
# Map Configuration
NEXT_PUBLIC_MAPBOX_TOKEN=your_mapbox_token_here
# AI Services
ANTHROPIC_API_KEY=your_anthropic_api_key
OPENAI_API_KEY=your_openai_api_key
# Authentication
NEXTAUTH_URL=http://localhost:3001
NEXTAUTH_SECRET=your_secret_key_here
JWT_SECRET=your_jwt_secret
# Database (if connecting directly)
DATABASE_URL=postgresql://user:password@localhost:5432/civic_db
# Analytics
NEXT_PUBLIC_GA_ID=your_google_analytics_id
NEXT_PUBLIC_SENTRY_DSN=your_sentry_dsnnpm run dev
# or
yarn devOpen http://localhost:3001 to view the application.
CivicIssue_adminpanel/
βββ app/ # Next.js 14 App Directory
β βββ (auth)/ # Authentication routes
β β βββ login/ # Login page
β β βββ register/ # Registration page
β βββ dashboard/ # Main dashboard
β β βββ page.tsx # Dashboard home
β β βββ issues/ # Issues management
β β βββ analytics/ # Analytics views
β β βββ departments/ # Department management
β β βββ ai-insights/ # AI insights page
β βββ api/ # API routes
β β βββ auth/ # Authentication endpoints
β β βββ issues/ # Issue management
β β βββ ai/ # AI service endpoints
β βββ layout.tsx # Root layout
βββ components/ # React components
β βββ Dashboard/ # Dashboard components
β βββ Map/ # Map components
β βββ Charts/ # Data visualization
β βββ AIChat/ # AI assistant chat
β βββ common/ # Shared components
βββ lib/ # Utility functions
β βββ api/ # API client
β βββ hooks/ # Custom React hooks
β βββ utils/ # Helper functions
β βββ validators/ # Form validation
βββ public/ # Static assets
βββ styles/ # Global styles
βββ types/ # TypeScript definitions
βββ config/ # Configuration files
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run type-check # Run TypeScript compiler
# Testing
npm run test # Run unit tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Generate coverage report
npm run e2e # Run E2E tests
# Database
npm run db:migrate # Run database migrations
npm run db:seed # Seed database with sample data
# Code Quality
npm run format # Format code with Prettier
npm run analyze # Analyze bundle size- StatCard - Display key metrics
- IssueTable - Manage issues with filtering
- PriorityQueue - View high-priority items
- DepartmentGrid - Department overview
- HeatmapLayer - Visualize issue density
- ClusterMarkers - Group nearby issues
- RouteOptimization - Optimal path planning
- LiveTracking - Real-time team locations
- ChatInterface - Conversational AI assistant
- InsightCards - AI-generated insights
- PredictionCharts - Forecast visualizations
- AutoSuggestions - Smart recommendations
The admin panel supports multiple authentication methods:
- Email/Password - Traditional authentication
- OAuth2 - Google, GitHub, Microsoft
- SSO - Single Sign-On for enterprises
- Role-Based Access - Admin, Manager, Operator roles
// Issues
GET /api/v1/issues // List all issues
POST /api/v1/issues // Create new issue
GET /api/v1/issues/:id // Get issue details
PUT /api/v1/issues/:id // Update issue
DELETE /api/v1/issues/:id // Delete issue
// Analytics
GET /api/v1/analytics/dashboard // Dashboard metrics
GET /api/v1/analytics/trends // Trend analysis
GET /api/v1/analytics/heatmap // Heatmap data
// AI Services
POST /api/v1/ai/classify // Classify issue
POST /api/v1/ai/chat // AI chat
GET /api/v1/ai/predictions // Get predictions# Get issues with filters
query GetIssues($filter: IssueFilter) {
issues(filter: $filter) {
id
title
description
status
priority
location {
lat
lng
}
}
}
# Real-time subscription
subscription IssueUpdates {
issueUpdated {
id
status
assignedTo
}
}# Build Docker image
docker build -t civic-admin-panel .
# Run container
docker run -p 3001:3000 \
-e NEXT_PUBLIC_API_URL=http://api.example.com \
civic-admin-panel# Install Vercel CLI
npm i -g vercel
# Deploy
vercel --prod# Build and deploy to AWS
npm run build
aws s3 sync .next/static s3://your-bucket/static
aws cloudfront create-invalidation --distribution-id YOUR_DIST_ID --paths "/*"npm run testnpm run test:integrationnpm run e2e- Code Splitting - Automatic route-based splitting
- Image Optimization - Next.js Image component
- Lazy Loading - Components loaded on demand
- Caching Strategy - SWR for data caching
- Bundle Analysis - Regular bundle size monitoring
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js - React framework
- Material-UI - UI components
- Mapbox - Mapping platform
- Claude AI - AI assistant
- Vercel - Deployment platform
- Documentation: docs.civicissue.com
- Issues: GitHub Issues
- Email: support@civicissue.com
- Discord: Join our community
- Mobile responsive improvements
- Offline mode support
- Advanced AI predictions
- Multi-language support
- Dark mode enhancement
- Export functionality
- Webhook integrations
- Performance monitoring dashboard
Built with β€οΈ by SadiqueCodes