How udinjmng/desapintar works
Desa Pintar is a village-services portal for discovering local places and businesses, reading community news, and submitting or tracking public reports; administrators review and manage village activity. The visible report-submission flow runs from the citizen portal to the reports API and database. The repository also documents AI recommendations, chat, business-performance analysis, and administrative telemetry. Source excerpts establish only some runtime links, so uncertain connections are omitted; paths for unsampled capabilities use their existing route directories.
Main entry points: db.ts MySQL Store · page.tsx Village Home · ai.ts AI Gateway · route.ts Telemetry Analysis
Components 25
Citizen Portal
- Village Home
app/page.tsx - Featured Places
components/dashboard/FeaturedPlaces.tsx - Community News
components/dashboard/CommunityNews.tsx - Report Submission
app/laporan/page.tsx - News Reader
components/modals/SlideReaderDrawer.tsx - Account Access
app/login/page.tsx - User Profile
app/profil/page.tsx - Business Registration
app/umkm/daftar/page.tsx
Administration
- Admin Dashboard
app/admin/page.tsx - Admin Telemetry
app/admin/page.tsx
Service Routes
- Places API
app/api/places/route.ts - Reports API
app/api/reports/route.ts - Business API
app/api/businesses/route.ts - News API
app/api/news/route.ts - Authentication API
app/api/auth/login/route.ts - Profile API
app/api/users/profile/route.ts - AI Recommendations
app/api/ai/recommend/route.ts - AI Chat
app/api/ai/chat/route.ts - Business Analysis
app/api/ai/business-performance/route.ts - Telemetry Analysis
app/api/ai/admin-telemetry/route.ts
Data And AI
- MySQL Store
lib/db.ts - AI Gateway
lib/ai.ts - Alert Context
context/AlertContext.tsx - Domain Types
data/types.ts
Other components
- Resident
Connections 28
- Resident → Village Home: opens portal
app/page.tsx - Resident → Report Submission: submits report
app/laporan/page.tsx - Village Home → Featured Places: renders
app/page.tsx - Village Home → Community News: renders
app/page.tsx - Village Home → Reports API: posts report
app/page.tsx - Report Submission → Reports API: posts report
app/laporan/page.tsx - Featured Places → Domain Types: uses types
components/dashboard/FeaturedPlaces.tsx - Community News → Domain Types: uses types
components/dashboard/CommunityNews.tsx - Village Home → News Reader: opens reader
app/page.tsx - News Reader → Alert Context: uses alerts
components/modals/SlideReaderDrawer.tsx - Resident → Account Access: signs in
app/login/page.tsx - Resident → User Profile: manages profile
app/profil/page.tsx - Resident → Business Registration: registers business
- Admin Dashboard → Business API: updates status
app/admin/page.tsx - Admin Dashboard → Admin Telemetry: shows analytics
app/admin/page.tsx - Admin Telemetry → Telemetry Analysis: requests analysis
- Places API → MySQL Store: queries places
app/api/places/route.ts - Reports API → MySQL Store: stores reports
app/api/reports/route.ts - Business API → MySQL Store: queries businesses
app/api/businesses/route.ts - News API → MySQL Store: queries news
app/api/news/route.ts - Profile API → MySQL Store: accesses profiles
app/api/users/profile/route.ts - Authentication API → MySQL Store: accesses accounts
- AI Recommendations → MySQL Store: reads records
app/api/ai/recommend/route.ts - AI Recommendations → AI Gateway: requests AI
app/api/ai/recommend/route.ts - AI Chat → AI Gateway: requests AI
- Business Analysis → AI Gateway: requests analysis
app/api/ai/business-performance/route.ts - Telemetry Analysis → MySQL Store: reads reports
app/api/ai/admin-telemetry/route.ts - Telemetry Analysis → AI Gateway: summarizes data
app/api/ai/admin-telemetry/route.ts