How krisnakrnwnn/portal-rpjmd-pasuruan works
Portal RPJMD Kabupaten Pasuruan serves public planning information and documents, with an AI assistant grounded in ingested PDFs. The main workflow is a citizen asking a question, the chatbot retrieving document context and conversation history, then generating a response through the configured AI provider. Administrators manage portal content, AI settings, document ingestion, and OTP-protected access. The graph includes the documented Privia conversation feature, but its runtime wiring was not shown; some ingestion and admin-controller relationships are likewise left unconnected where excerpts do not establish the calls.
Main entry points: ChatbotController.php RPJMD chatbot · AIManager.php AI manager · AdminOtpController.php Admin OTP verification · AdminController.php Admin content and settings
Components 24
Public portal
- RPJMD portal
app/Http/Controllers/PortalController.php - Public documents
app/Models/PublicDocument.php
AI assistant
- RPJMD chatbot
app/Http/Controllers/ChatbotController.php - Document chunks
app/Models/DocumentChunk.php - Chat sessions and messages
app/Models/ChatSession.php - Gemini embeddings API
- AI manager
app/Services/AI/AIManager.php - AI settings
app/Services/AI/AiSettings.php - AI providers
app/Services/AI/Providers - PDF ingestion
app/Services/DocumentIngestor.php - Ingestion job
app/Jobs/IngestDocumentJob.php - Ingestion status
app/Models/DocumentIngestion.php - Privia conversations
app/Http/Controllers/PriviaController.php - Conversation service
app/Services/PriviaConversationService.php
Administration
- Admin content and settings
app/Http/Controllers/Admin/AdminController.php - Admin pages
app/Http/Controllers/Admin/AdminPageController.php - Portal data models
app/Models
Access and security
- Admin OTP verification
app/Http/Controllers/Auth/AdminOtpController.php - OTP service
app/Services/AdminOtpService.php - OTP challenges
app/Models/AdminLoginOtp.php - Email delivery
app/Mail/AdminLoginOtpMail.php - Security event recording
app/Services/AuthSecurityEventRecorder.php
Other components
- Citizen
- Administrator
Connections 23
- Citizen → RPJMD portal: browses
README.md - Citizen → RPJMD chatbot: asks questions
README.md - RPJMD chatbot → Gemini embeddings API: embeds question
app/Http/Controllers/ChatbotController.php - RPJMD chatbot → Document chunks: retrieves chunks
app/Http/Controllers/ChatbotController.php - RPJMD chatbot → Chat sessions and messages: saves messages
app/Http/Controllers/ChatbotController.php - RPJMD chatbot → AI manager: requests answer
app/Http/Controllers/ChatbotController.php - AI manager → AI settings: reads active model
app/Services/AI/AIManager.php - AI manager → AI providers: dispatches generation
app/Services/AI/AIManager.php - AI manager → Administrator: test model
- Administrator → Admin content and settings: manages portal
README.md - Administrator → Ingestion job: starts PDF ingestion
- Ingestion job → PDF ingestion: runs ingestion
app/Jobs/IngestDocumentJob.php - PDF ingestion → Document chunks: writes chunks
app/Services/DocumentIngestor.php - Admin content and settings → Ingestion job: dispatches job
app/Http/Controllers/Admin/AdminController.php - Admin content and settings → Portal data models: manages content
app/Http/Controllers/Admin/AdminController.php - Admin pages → Portal data models: reads portal data
app/Http/Controllers/Admin/AdminPageController.php - Administrator → Admin OTP verification: verifies login
README.md - Admin OTP verification → OTP service: verifies challenge
app/Http/Controllers/Auth/AdminOtpController.php - Admin OTP verification → OTP challenges: loads challenge
app/Http/Controllers/Auth/AdminOtpController.php - OTP service → OTP challenges: updates challenge
app/Services/AdminOtpService.php - OTP service → Email delivery: sends code
app/Services/AdminOtpService.php - Admin OTP verification → Security event recording: records verification
app/Http/Controllers/Auth/AdminOtpController.php - Privia conversations → Conversation service: delegates conversations
app/Http/Controllers/PriviaController.php