How dculussoftwares/indiastats-cms works
IndiaStats CMS combines election-data administration with a public election analytics site. Visitors explore state, district, assembly, booth, historical-results, prediction, and demographic views; the application serves data through Next.js routes and visualizes it in dashboards, maps, charts, and generated sharing images. Payload provides CMS collections, APIs, and editorial content management. The README also documents Excel portability and behavioral analytics. The graph uses documented capabilities and visible call relationships; unsampled route implementations are represented at their exact enclosing directories, with no speculative connections.
Main entry points: (frontend) Web pages · index.tsx Election maps · collections Election collections · payload.config.ts Payload CMS
Components 22
Public Election Site
- Web pages
src/app/(frontend) - Election maps
src/components/AssemblyMap/index.tsx - Map statistics
src/components/MapStatsDashboard/index.tsx
Election Data
- State registry
src/config/states/index.ts - Assembly routing
src/lib/assemblyRouting.ts - Results API
src/app/api/election-results/route.ts - Election APIs
src/app/api - Election analysis
src/lib/electionAnalysis.ts - Prediction tools
src/lib/electionPredictions.ts - Demographic insights
src/app/api/caste-data/route.ts - Election collections
src/collections - Excel portability
src/utilities/excelExport.ts
Content Management
- Payload CMS
src/payload.config.ts - Admin interface
src/app/(payload)/admin/[[...segments]]/page.tsx - Editorial content
src/collections/Posts/index.ts - CMS plugins
src/plugins/index.ts - Media storage
src/plugins/index.ts - Content search
src/search/beforeSync.ts
Analytics and Sharing
- Sharing images
src/app/api/og/[assemblyId]/route.tsx - Event tracking
src/analytics/tracker.ts
Other components
- Visitor
- CMS editor
Connections 21
- Visitor → Web pages: browses
README.md - Web pages → Election APIs: requests data
- Web pages → Election maps: renders
- Web pages → Sharing images: shares via
- Election maps → State registry: reads state
src/components/AssemblyMap/index.tsx - Election maps → Map statistics: renders
src/components/AssemblyMap/index.tsx - Election maps → Event tracking: tracks clicks
src/components/AssemblyMap/index.tsx - Results API → State registry: validates years
src/app/api/election-results/route.ts - Results API → Election collections: queries results
src/app/api/election-results/route.ts - Sharing images → Election collections: queries history
src/app/api/og/[assemblyId]/route.tsx - Sharing images → State registry: reads state
src/app/api/og/[assemblyId]/route.tsx - CMS editor → Admin interface: manages content
- Admin interface → Payload CMS: uses CMS
- Payload CMS → Election collections: manages records
- Payload CMS → CMS plugins: configures
src/plugins/index.ts - CMS plugins → Content search: indexes posts
src/plugins/index.ts - CMS plugins → Media storage: stores uploads
src/plugins/index.ts - Web pages → Election analysis: analysis views
- Web pages → Prediction tools: prediction views
- Web pages → Demographic insights: demographic views
- Election collections → Excel portability: exports data